On Mon, Nov 28, 2005 at 04:14:33AM +0000, Pigeon wrote: > Hi, > > I have modified dhttpd 1.02a-13 in such a way as to fix bug #333553, > address bug #326897 and make a couple of other minor improvements.
Thanks a lot for the patch. I actually think it do enough changes to allow a bigger version number increse. I do not know if upstream is responding at all but I really suggest that you forward it to him. > > #333553: does not append "/index.html" to all directory paths > > My mod tests if the "file" is in fact a directory, and if it is, > appends "/index.html" to _the_URL_specified_ - _not_ the filename - > and issues a "301 Moved permanently" redirection (which seemed to be > the most appropriate on reading the HTTP spec). > > It is not sufficient to simply send the index.html file in response > to the request. If you do, Firefox, at least, does not recognise > that we have "gone down a level" and can't correctly handle relative > URLs from the page. By redirecting, this problem is avoided. I see. Thanks for that analyze. > > #326897: no log file > > My mod logs to syslog all requests and responses received when > dhttpd is running as a daemon. Additionally, any HTTP header listed > in /etc/dhttpd.conf is also logged. (No check is made that the > contents of /etc/dhttpd.conf actually represent valid header > fields.) The log looks like this (also shows the index.html mod in > action): Do you make any length checks or similar so I do not get a bug about that in the future? I have read through the patch but I am not fully convinced yet. > > Nov 28 02:39:45 nestie dhttpd[17188]: Request from 192.168.1.2: GET > > /stuff/deltic HTTP/1.0 > > Nov 28 02:39:45 nestie dhttpd[17188]: File: /var/www/stuff/deltic > > Nov 28 02:39:45 nestie dhttpd[17188]: Status: 4 (Redirected to > > /stuff/deltic/index.html) > > Nov 28 02:39:45 nestie dhttpd[17188]: User-Agent: Mozilla/5.0 (X11; U; > > Linux i686; en-US; rv:1.7.8) Gecko/20050818 Firefox/1.0.4 (Debian package > > 1.0.4-2) > > Nov 28 02:39:46 nestie dhttpd[17189]: Request from 192.168.1.2: GET > > /stuff/deltic/index.html HTTP/1.0 > > Nov 28 02:39:46 nestie dhttpd[17189]: File: > > /var/www/stuff/deltic/index.html > > Nov 28 02:39:46 nestie dhttpd[17189]: Status: 0 (OK) > > Nov 28 02:39:46 nestie dhttpd[17189]: User-Agent: Mozilla/5.0 (X11; U; > > Linux i686; en-US; rv:1.7.8) Gecko/20050818 Firefox/1.0.4 (Debian package > > 1.0.4-2) > > Nov 28 02:40:38 nestie dhttpd[17240]: Request from 128.30.52.13: GET > > /stuff/index.html HTTP/1.1 > > Nov 28 02:40:38 nestie dhttpd[17240]: File: /var/www/stuff/index.html > > Nov 28 02:40:38 nestie dhttpd[17240]: Status: 0 (OK) > > Nov 28 02:40:38 nestie dhttpd[17240]: User-Agent: > > W3C_Validator/1.432.2.5 > > Nov 28 02:41:25 nestie dhttpd[17292]: Request from 192.168.1.2: GET > > /stuff/crapstuff/index.html HTTP/1.0 > > Nov 28 02:41:25 nestie dhttpd[17292]: File: > > /var/www/stuff/crapstuff/index.html > > Nov 28 02:41:25 nestie dhttpd[17292]: Status: 0 (OK) > > Nov 28 02:41:25 nestie dhttpd[17292]: User-Agent: Mozilla/5.0 (X11; U; > > Linux i686; en-US; rv:1.7.8) Gecko/20050818 Firefox/1.0.4 (Debian package > > 1.0.4-2) > > Nov 28 02:41:25 nestie dhttpd[17292]: Referer: > > http://pigeon.dyndns.org/stuff/index.html > > Nov 28 02:41:25 nestie dhttpd[17293]: Request from 192.168.1.2: GET > > /stuff/crapstuff/windows-sucks.jpg HTTP/1.0 > > Nov 28 02:41:25 nestie dhttpd[17293]: File: > > /var/www/stuff/crapstuff/windows-sucks.jpg > > Nov 28 02:41:25 nestie dhttpd[17293]: Status: 0 (OK) > > Nov 28 02:41:25 nestie dhttpd[17293]: User-Agent: Mozilla/5.0 (X11; U; > > Linux i686; en-US; rv:1.7.8) Gecko/20050818 Firefox/1.0.4 (Debian package > > 1.0.4-2) > > Nov 28 02:41:25 nestie dhttpd[17293]: Referer: > > http://pigeon.dyndns.org/stuff/crapstuff/index.html > > The "File:" and "Status:" entries are logged always. The > "User-Agent:" and "Referer:" entries are configured in > /etc/dhttpd.conf. Can you disable logging totally? > > Other minor things: > > - I've added a MIME type for .mp3. I hate mp3, but it exists... Noticed that in the patch. :) > - I've changed the message returned for a non-implemented HTTP request > from "You're screwed!" to the more polite "Not implemented". :-) Must more polite yes. :) > > I'm attaching a patch... but also a (cleaned) build tree, as my mods > involve some extra files and I'm too thick to work out how to include > a whole new file in a patch... The extra files are "pigeon.c", > "pigeon.h" and "dhttpd.conf", all in the src/ subdirectory. diff -uNr oldsourcetree newsourcetree > Hope this helps... I can tweak it some more if that would be useful. Maybe, depends on if you disable logging (and it must be the default = off). Please also try to contact the upstream author as I see these changes big enough for that. Regards, // Ola > -- > Pigeon > > Be kind to pigeons > Get my GPG key here: > http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x21C61F7F -- --------------------- Ola Lundqvist --------------------------- / [EMAIL PROTECTED] Annebergsslingan 37 \ | [EMAIL PROTECTED] 654 65 KARLSTAD | | +46 (0)54-10 14 30 +46 (0)70-332 1551 | | http://www.opal.dhs.org UIN/icq: 4912500 | \ gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9 / --------------------------------------------------------------- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]