Branch: Tag:

1998-07-14

1998-07-14 21:41:33 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Now saves all the headers received from the client.

Rev: server/protocols/http.pike:1.108

6: Inside #if defined(MAGIC_ERROR)
  #ifdef MAGIC_ERROR   inherit "highlight_pike";   #endif - constant cvs_version = "$Id: http.pike,v 1.107 1998/07/03 15:57:55 grubba Exp $"; + constant cvs_version = "$Id: http.pike,v 1.108 1998/07/14 21:41:33 grubba Exp $";   // HTTP protocol module.   #include <config.h>   private inherit "roxenlib";
57:   int time;   string raw_url;   int do_not_disconnect; - mapping (string:string) variables = ([ ]); - mapping (string:mixed) misc = ([ ]); - mapping (string:string) cookies = ([ ]); + mapping (string:string) variables = ([ ]); + mapping (string:mixed) misc = ([ ]); + mapping (string:string) cookies = ([ ]); + mapping (string:string) request_headers = ([ ]);      multiset (string) prestate = (< >);   multiset (string) config = (< >);
326:       not_query = simplify_path(http_decode_string(f));    +  request_headers = ([]); // FIXME: KEEP-ALIVE? +     if(sizeof(s)) {   // sscanf(s, "%s\r\n\r\n%s", s, data);   
336:    {    linename=contents=0;    sscanf(line, "%s:%s", linename, contents); -  if(linename&&contents) +  if(linename && contents)    {    linename=lower_case(linename);    sscanf(contents, "%*[\t ]%s", contents);    -  +  request_headers[linename] = contents; +     if(strlen(contents))    {    switch (linename) {