On Mon, Oct 27, 2008 at 08:51:44PM +0100, Eriam Schaffter wrote: > Lars Balker Rasmussen a écrit : > >>To reproduce: > >> > >> # mkdir -p /tmp/root/static ; echo foo > /tmp/root/static/foo.txt > >> # perl simplehttp.pl > >> > >>and > >> > >> # wget -O foo.txt.1 http://localhost:8000/static/foo.txt & ; wget -O > >> foo.txt.2 http://localhost:8000/static/foo.txt > >> > >>Both wgets will get the file contents, but only one will close the stream. > >> > >>Is there some kind of obvious mistake I'm making? > >> > It's weird but I can't reproduce: > > [EMAIL PROTECTED] ~/temp]$ perl test.pl > 3 -> GOT_MAIN (from > /usr/local/lib/perl5/site_perl/5.8.8/POE/Component/Server/SimpleHTTP.pm > at 806) > 3 -> GOT_STREAM (from test.pl at 59) > 3 -> CLOSE_STREAM (from > /usr/local/lib/perl5/site_perl/5.8.8/POE/Kernel.pm at 1810) > 3 -> GOT_MAIN (from > /usr/local/lib/perl5/site_perl/5.8.8/POE/Component/Server/SimpleHTTP.pm > at 806) > 3 -> GOT_STREAM (from test.pl at 59) > 3 -> CLOSE_STREAM (from > /usr/local/lib/perl5/site_perl/5.8.8/POE/Kernel.pm at 1810) > > Is this what you expected ?
It looks as if you do two consequitive requests, which'd work fine. The problem is when they're concurrent - note the & in the commmand line, or start a couple of wgets in different terminals (modify the timers to make it easier). -- Lars Balker Rasmussen Consult::Perl
