Patch for broken redirect logging
[email protected] Sun, 3 Dec 2006 14:22:38 +0100
| Newsgroups | gmane.comp.web.fnord |
|---|---|
| Organization | [ t]ivano Software GmbH |
| Message-ID | <[email protected]> |
--Boundary-00=_f+scFTmqmrIqF5U Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, when a whole domain is redirected to another, fnord strips the leading slash from the request URL. This stripped URL is later used for logging, which is wrong IMO. The attached patch fixes the problem. Bye, Peter =2D-=20 Peter Conrad | "Freiheit ist immer auch die Freiheit der Alicestra=DFe 102 | Andersdenkenden." 63263 Neu-Isenburg| - Rosa Luxemburg Germany email: [email protected] / WWW: http://www.unix-ag.uni-kl.de/~conr= ad --Boundary-00=_f+scFTmqmrIqF5U Content-Type: text/x-diff; charset="iso-8859-1"; name="fnord-log-redirect.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fnord-log-redirect.patch" --- orig/httpd.c +++ mod/httpd.c @@ -1442,9 +1442,10 @@ if (symlink[0]=='=') { buffer_put(buffer_1,symlink+1,linklen-1); } else { + char *myurl = url; buffer_put(buffer_1,symlink,linklen); - while (url[0]=='/') ++url; - buffer_puts(buffer_1,url); + while (myurl[0]=='/') ++myurl; + buffer_puts(buffer_1,myurl); } retcode=301; buffer_puts(buffer_1,"\r\n\r\n"); --Boundary-00=_f+scFTmqmrIqF5U--