Re: keep-connection

Martin Hamilton ([email protected])
Thu, 06 Jul 1995 17:22:48 +0100


This is a multipart MIME message.

--===_0_Thu_Jul__6_17:17:56_BST_1995
Content-Type: text/plain; charset=us-ascii

I wrote:

| 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

Since then I've discovered the "HTTP Session Extension" Internet
Draft - cf. draft-ietf-http-ses-ext-00.txt at your local respository

Here's a revised version of my server patch, which I _think_ is
compatible with the session extension spec. It could do with a
mechanism for server side timeouts, though

Anyone implemented client support for this ?

Cheerio,

Martin

--===_0_Thu_Jul__6_17:17:56_BST_1995
Content-Type: application/x-patch
Content-Description: connection-maintain patch

*** http_mime.c.FCS Mon Jun 26 20:39:22 1995
--- http_mime.c Thu Jul 6 17:07:23 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,"Connection")) {
+ if(!strcasecmp(l,"maintain")) {
+ keep_connection = 1;
+ }
+ continue;
+ }

http2cgi(w);
if(in_headers_env) {
***************
*** 584,589 ****
--- 594,601 ----
fprintf(fd,"Location: %s%c",location,LF);
if(content_encoding[0])
fprintf(fd,"Content-encoding: %s%c",content_encoding,LF);
+ if(keep_connection)
+ fprintf(fd,"Connection: maintain%c",LF);
if(out_headers)
fprintf(fd,"%s",out_headers);
fprintf(fd,"%c",LF);

*** httpd.c.FCS Mon Jun 26 20:39:18 1995
--- httpd.c Thu Jul 6 13:33:13 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();

--===_0_Thu_Jul__6_17:17:56_BST_1995--