fielding 97/05/28 20:44:33
Modified: src CHANGES http_protocol.c Log: Initialize r->status as request-timed-out until after we successfully read the request-line and header fields. Submitted by: Roy Fielding and Ed Korthof, PR#601 Revision Changes Path 1.281 +7 -0 apache/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache/src/CHANGES,v retrieving revision 1.280 retrieving revision 1.281 diff -C3 -r1.280 -r1.281 *** CHANGES 1997/05/27 08:01:10 1.280 --- CHANGES 1997/05/29 03:44:30 1.281 *************** *** 1,5 **** --- 1,12 ---- Changes with Apache 1.2 + *) Log correct status code if we timeout before receiving a request (408) + or if we received a request-line that was too long to process (414). + [Ed Korthof and Roy Fielding] PR#601 + + *) Virtual hosts with the same ServerName, but on different ports, were + not being selected properly. [Ed Korthof] + *) Added code to return the requested IP address from proxy_host2addr() if gethostbyaddr() fails due to reverse DNS lookup problems. Original change submitted by Jozsef Hollosi <[EMAIL PROTECTED]>. 1.126 +6 -6 apache/src/http_protocol.c Index: http_protocol.c =================================================================== RCS file: /export/home/cvs/apache/src/http_protocol.c,v retrieving revision 1.125 retrieving revision 1.126 diff -C3 -r1.125 -r1.126 *** http_protocol.c 1997/05/29 03:10:53 1.125 --- http_protocol.c 1997/05/29 03:44:31 1.126 *************** *** 630,638 **** signal (SIGUSR1, SIG_IGN); bsetflag( conn->client, B_SAFEREAD, 0 ); if (len == (HUGE_STRING_LEN - 1)) { ! log_printf(r->server, "request failed for %s, reason: header too long", get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME)); ! return 0; /* Should be a 414 error status instead */ } r->request_time = time(NULL); --- 630,639 ---- signal (SIGUSR1, SIG_IGN); bsetflag( conn->client, B_SAFEREAD, 0 ); if (len == (HUGE_STRING_LEN - 1)) { ! log_printf(r->server, "request failed for %s, reason: URI too long", get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME)); ! r->status = HTTP_REQUEST_URI_TOO_LARGE; ! return 0; } r->request_time = time(NULL); *************** *** 786,795 **** r->read_length = 0; r->read_body = REQUEST_NO_BODY; ! r->status = HTTP_OK; /* Until further notice. ! * Only changed by die(), or (bletch!) ! * scan_script_header... ! */ /* Get the request... */ --- 787,793 ---- r->read_length = 0; r->read_body = REQUEST_NO_BODY; ! r->status = HTTP_REQUEST_TIME_OUT; /* Until we get a request */ /* Get the request... */ *************** *** 803,808 **** --- 801,808 ---- get_mime_headers (r); } kill_timeout(r); + + r->status = HTTP_OK; /* Until further notice. */ /* handle Host header here, to get virtual server */