masaori335 commented on code in PR #12906: URL: https://github.com/apache/trafficserver/pull/12906#discussion_r2870052206
########## tests/gold_tests/pluginTest/compress/compress_100_continue_origin.py: ########## @@ -0,0 +1,126 @@ +#!/usr/bin/env python3 +"""Origin server that sends 100 Continue then a compressible 200 OK. + +Used to reproduce the crash in HttpTunnel::producer_run when compress.so +with cache=true is combined with a 100 Continue response from the origin. +""" + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import argparse +import signal +import socket +import sys + + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument('--port', type=int, required=True, help='Port to listen on') + return parser.parse_args() + + +def read_request(conn): + """Read an HTTP request from the connection, returning the raw bytes.""" + data = b'' + while b'\r\n\r\n' not in data: + chunk = conn.recv(4096) + if not chunk: + return None + data += chunk + return data + + +def handle_connection(conn, addr): + """Handle a single client connection.""" + try: + conn.settimeout(10) + request = read_request(conn) + if request is None: + return + + # Send 100 Continue immediately. + conn.sendall(b'HTTP/1.1 100 Continue\r\n\r\n') Review Comment: Thank you for adding this test case. But I guess Proxy-Verifier supports `100 Continue` support. ( we can merge this first and change it later ) @bneradt can we cover this case with proxy-verifier? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
