*** skahttpd-0.52.2/httpd.c.orig Tue Dec 4 10:57:37 2001 --- skahttpd-0.52.2/httpd.c Tue Dec 4 13:34:34 2001 *************** *** 57,62 **** --- 57,67 ---- stralloc host = {0}; stralloc path = {0}; stralloc ims = {0}; + /* hirobo */ + stralloc referer = {0}; + stralloc agent = {0}; + stralloc via = {0}; + int flagbody = 1; char filebuf[1024]; *************** *** 117,122 **** --- 122,137 ---- uint32 pos; uint32 len; + /* hirobo */ + void log_env(const char *h,char *s,int len) { + if (len) { + substdio_puts(&err,h); + substdio_put(&err,s,len); + substdio_puts(&err,"\n"); + substdio_flush(&err); + } + } + static void log_redir(char *result,int flagfound) { int i; *************** *** 480,485 **** --- 495,505 ---- if (!stralloc_copys(&path,"")) _exit(21); if (!stralloc_copys(&protocol,"")) _exit(21); if (!stralloc_copys(&ims,"")) _exit(21); + /* 3 lines hirobo */ + if (!stralloc_copys(&referer,"")) _exit(21); + if (!stralloc_copys(&agent,"")) _exit(21); + if (!stralloc_copys(&via,"")) _exit(21); + protocolnum = 2; spaces = 0; *************** *** 581,593 **** if (!stralloc_append(&host,&field.s[i])) _exit(21); if (case_startb(field.s,field.len,"if-modified-since:")) if (!stralloc_copyb(&ims,field.s + 18,field.len - 18)) _exit(21); field.len = 0; } if (!line.len) break; if (!stralloc_cat(&field,&line)) _exit(21); } } ! get(); } } --- 601,623 ---- if (!stralloc_append(&host,&field.s[i])) _exit(21); if (case_startb(field.s,field.len,"if-modified-since:")) if (!stralloc_copyb(&ims,field.s + 18,field.len - 18)) _exit(21); + /* hirobo */ + if (case_startb(field.s,field.len,"referer:")) + if (!stralloc_copyb(&referer,field.s + 8,field.len - 8)) _exit(21); + if (case_startb(field.s,field.len,"user-agent:")) + if (!stralloc_copyb(&agent,field.s + 11,field.len - 11)) _exit(21); + if (case_startb(field.s,field.len,"via:")) + if (!stralloc_copyb(&via,field.s + 4,field.len - 4)) _exit(21); + field.len = 0; } if (!line.len) break; if (!stralloc_cat(&field,&line)) _exit(21); } } ! log_env("ref:",referer.s,referer.len); ! log_env("u-a:",agent.s,agent.len); ! log_env("via:",via.s,via.len); get(); } }