- From: Martin Hamilton <martin@mrrl.lut.ac.uk>
- Date: Mon, 26 Jun 1995 23:29:07 +0100 (BST)
- To: www-talk@w3.org
There was some talk (last year?) about an HTTP header which clients could use to ask servers to keep the connection open ... Pragma: keep-connection Is anyone working on this sort of thing ? i.e. HTTP connection caching/re-use To put my money where my mouth is, I've hacked rudimentary support for "keep-connection" into NCSA httpd 1.4.2 - see below. If I have my thinking head on, the hacked-over server should be willing to keep the connection open after serving up static documents. The rationale is that these should always have an HTTP "Content-length:" header How about it ? :-) Martin *** http_mime.c.FCS Mon Jun 26 20:39:22 1995 --- http_mime.c Mon Jun 26 20:39:30 1995 *************** *** 58,63 **** --- 58,65 ---- extern char referer_ignore[MAX_STRING_LEN]; char referer[HUGE_STRING_LEN]; + extern int keep_connection; + void hash_insert(struct mime_ext *me) { register int i = hash(me->ext[0]); register struct mime_ext *p, *q; *************** *** 459,464 **** --- 461,468 ---- num_inh = 0; num_processed = 0; + keep_connection = 0; + while(!(getline(w,MAX_STRING_LEN-1,fd,timeout))) { if(!w[0]) return; *************** *** 495,500 **** --- 499,510 ---- } if(!strcasecmp(w,"If-modified-since")) strcpy(ims,l); + if(!strcasecmp(w,"Pragma")) { + if(!strcasecmp(l,"keep-connection")) { + keep_connection = 1; + } + continue; + } http2cgi(w); if(in_headers_env) { *** httpd.c.FCS Mon Jun 26 20:39:18 1995 --- httpd.c Mon Jun 26 20:39:30 1995 *************** *** 42,47 **** --- 42,48 ---- int Child=0; int Alone=0; int csd = -1; + int keep_connection=0; #ifndef NO_PASS char donemsg[]="DONE"; *************** *** 296,302 **** rfc931((struct sockaddr_in *)sa_client, sa_server)); ! process_request(0,stdout); fflush(stdout); shutdown(csd,2); close(csd); --- 297,303 ---- rfc931((struct sockaddr_in *)sa_client, sa_server)); ! do { process_request(0,stdout); } while (keep_connection); fflush(stdout); shutdown(csd,2); close(csd); *************** *** 374,380 **** } else remote_logname = NULL; ! process_request(0,stdout); fflush(stdout); shutdown(csd,2); close(csd); --- 375,381 ---- } else remote_logname = NULL; ! do { process_request(0,stdout); } while (keep_connection); fflush(stdout); shutdown(csd,2); close(csd); *************** *** 661,669 **** group_id = getgid(); port = get_portnum(fileno(stdout),stdout); if(do_rfc931) remote_logname = get_remote_logname(stdout); ! process_request(0,stdout); fflush(stdout); } close_logs(); --- 662,673 ---- group_id = getgid(); port = get_portnum(fileno(stdout),stdout); + if(do_rfc931) remote_logname = get_remote_logname(stdout); ! ! do { process_request(0,stdout); } while (keep_connection); ! fflush(stdout); } close_logs();
Received on Monday, 26 June 1995 19:02:11 UTC