--- lynx2-8-1/WWW/Library/Implementation/HTTP.c.orig Wed Oct 14 05:23:56 1998 +++ lynx2-8-1/WWW/Library/Implementation/HTTP.c Wed Apr 19 23:40:22 2000 @@ -4,6 +4,10 @@ ** 27 Jan 1994 PDM Added Ari Luotonen's Fix for Reload when using proxy ** servers. ** 28 Apr 1997 AJL,FM Do Proxy Authorisation. +** April 1999 A.Daviel add extra http headers +** very crude - contents of /var/lynx/extra-headers.dat is +** inserted into outgoing HTTP request. A demo for +** draft-daviel-http-geo-header-01 */ #include @@ -121,6 +125,11 @@ BOOL doing_redirect, already_retrying = FALSE, bad_location = FALSE; int len = 0; + /* extra-header code */ + FILE *exh ; + char exbuf[80] ; + int lenb ; + void * handle = NULL; if (anAnchor->isHEAD) @@ -303,6 +312,22 @@ StrAllocCat(command, line); sprintf(line, "%c%c", CR, LF); StrAllocCat(command, line); + } + /* extra-header code */ + exh = fopen("/var/lynx/extra-headers.dat","r"); + if (exh) { + while (!feof(exh) && fgets(exbuf, sizeof(exbuf)-1, exh) != NULL) { + lenb = strlen(exbuf); + if (lenb > 0) { + if (exbuf[lenb-1] == '\n' || exbuf[lenb-1] == '\r') + exbuf[lenb-1] = '\0'; + else + exbuf[sizeof(exbuf)-1] = '\0'; + } + sprintf(line, "%s%c%c", exbuf, CR, LF); + StrAllocCat(command, line); + } + fclose(exh) ; } /*