# specify install location for testing PREFIX=/tmp/lighttpd # get Glen Strauss lighttpd source code - use commit prior to code fix to verify defect exists mkdir -p ~/projects/lighttpd cd ~/projects/lighttpd git clone https://github.com/gstrauss/lighttpd1.4.git cd lighttpd1.4 git checkout dd33a35 # master at end of day 2016 03 26 # build ./autogen.sh && ./configure --prefix=$PREFIX && make && make install # get configuration files in place and adjust paths CONFIG=$PREFIX/etc/lighttpd/lighttpd.conf mkdir -p $PREFIX/etc/lighttpd $PREFIX/var/run $PREFIX/var/log/lighttpd $PREFIX/srv/www/htdocs $PREFIX/var/cache cp -R doc/config/modules.conf doc/config/lighttpd.conf doc/config/conf.d $PREFIX/etc/lighttpd sed --in-place=.bak -e "sI^\(var\..*= \"\)/I\1$PREFIX/Ig" -e "sI^server.port = 80Iserver.port = 8080I" $CONFIG # fetch an index page to verify web server is configured properly $PREFIX/sbin/lighttpd -v > $PREFIX/srv/www/htdocs/index.html $PREFIX/sbin/lighttpd -D -f $CONFIG # cntl-C to stop webserver # then browse to http://localhost:8080 # verify that master without patch fails test # files from http://redmine.lighttpd.net/issues/2655 cp ../refetch-image.html $PREFIX/srv/www/htdocs $PREFIX/sbin/lighttpd -f $LIGHTTPD_CONFIG ( cd .. ; ./alternate-images.sh $PREFIX/srv/www/htdocs ) # cntl-C to stop killall lighttpd # then browse to http://localhost:8080/refetch-image.html # chrome stops update with browser console listing ERR_CONTENT_LENGTH_MISMATCH # firefox keeps running the javascript when the error is encountered with # browser console reporting image corrupt or truncated # rebuild code to test with gstrauss fix on branch bug-2655-http_chunk-open-fstat git checkout bug-2655-http_chunk-open-fstat make && make install # test with fix in place - http://localhost:8080/refetch-image.html $PREFIX/sbin/lighttpd -f $LIGHTTPD_CONFIG ( cd .. ; ./alternate-images.sh $PREFIX/srv/www/htdocs ) # cntl-C to stop killall lighttpd ========================================================================================================= ========================================================================================================= ========================================================================================================= ========================================================================================================= File: refetch-image.html Demonstrate content-length issue when image being fetched is being updated
========================================================================================================= ========================================================================================================= ========================================================================================================= ========================================================================================================= File: alternate-images.sh #!/bin/sh HTDOCS=/tmp/lighttpd/www/htdocs if [ -n "$1" ] ; then HTDOCS=$1 fi while true ; do cp img1.jpg $HTDOCS mv $HTDOCS/img1.jpg $HTDOCS/img.jpg sleep 0.005 cp img2.jpg $HTDOCS mv $HTDOCS/img2.jpg $HTDOCS/img.jpg sleep 0.005 done