This patch implements a modification of Apache HTTP Server(apache 1.1.3) to support dealing with a new method CLOSE for connection. Copyright (c) 1997 University of Southern California. All rights reserved. Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the University of Southern California, Information Sciences Institute. The name of the University may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. --------------------------------------------------------------------- *** http_protocol.src.c Mon Jul 14 14:48:08 1997 --- http_protocol.c Tue Sep 16 11:51:04 1997 *************** *** 488,493 **** --- 488,497 ---- r->method_number = M_DELETE; else if(!strcmp(r->method,"CONNECT")) r->method_number = M_CONNECT; + #ifdef ISI_CUT + else if(!strcmp(r->method, "CLOSE")) + r->method_number = M_CLOSE; + #endif else r->method_number = M_INVALID; /* Will eventually croak. */ *************** *** 590,596 **** --- 594,604 ---- return OK; } + #ifdef ISI_CUT + #define RESPONSE_CODE_LIST " 200 302 304 400 401 403 404 500 503 501 502 601 " + #else #define RESPONSE_CODE_LIST " 200 302 204 400 401 403 404 500 503 501 502 " + #endif /* ISI_CUT */ /* New Apache routine to map error responses into array indicies * e.g. 400 -> 0, 500 -> 1, 502 -> 2 ... *** http_request.src.c Mon Jul 14 14:48:08 1997 --- http_request.c Tue Sep 16 13:08:16 1997 *************** *** 351,356 **** --- 351,382 ---- */ } + #ifdef ISI_CUT + /* the following part is for close connection from the client part */ + int close_connection_check ( request_rec *r) + { + + conn_rec *c = r->connection; + BUFF *fd = c->client; + + if ( r->method_number == M_CLOSE ) + { + /* which means can close connection now */ + if (r->server->keep_alive_timeout && + (r->server->keep_alive > r->connection->keepalives)) { + + r->connection->keepalive = 0; + r->connection->keepalives = 0; + } + bclose(fd); + return ISI_CLOSE; + } /* close the connection */ + return OK; + + } /* end of close_connection_check */ + #endif /* ISI_CUT */ + int location_walk (request_rec *r) { core_server_config *sconf = get_module_config (r->server->module_config, *************** *** 764,769 **** --- 790,804 ---- die (access_status, r); return; } + + /* check if the header contain Connection : close */ + #ifdef ISI_CUT + if ((access_status = close_connection_check(r))) { + /* die ( access_status, r ); */ + return; + } + else + #endif /* ISI_CUT */ if ((access_status = invoke_handler (r)) != 0) die (access_status, r); *** httpd.src.h Mon Jul 14 14:48:08 1997 --- httpd.h Mon Jul 14 14:58:44 1997 *************** *** 261,266 **** --- 261,270 ---- #define SERVICE_UNAVAILABLE 503 #define RESPONSE_CODES 10 + #ifdef ISI_CUT + #define ISI_CLOSE 601 + #endif + #define M_GET 0 #define M_PUT 1 #define M_POST 2 *************** *** 267,273 **** --- 271,283 ---- #define M_DELETE 3 #define M_CONNECT 4 #define M_INVALID 5 + + #ifdef ISI_CUT + #define METHODS 7 + #define M_CLOSE 6 + #else #define METHODS 6 + #endif #define CGI_MAGIC_TYPE "application/x-httpd-cgi" #define INCLUDES_MAGIC_TYPE "text/x-server-parsed-html"