From: Dean M. B. <mik...@gm...> - 2008-08-09 13:44:36
|
Hi Guys, I've just checked in revision 48 which fixes the Python CGI script that returns incomplete headers. I had to make it print the http status line (which I'm not sure is required) and add the correct line endings to the printed header: instead of just '\n', I made it print "\r\n\r\n" in the end to signify that it was the last header responded to. Divye, please make sure that this is the correct way to do CGI scripts in Python -- I really have no idea how to do that, and I only hacked the script to make it not fail in just the CGI case. I haven't tried this in Windows yet, but I'm thinking it should be do-able. Another thing: maybe we should put the startup/shutdown of the server in a global fixture in the test suite for localhost_test? Has anybody done this with Boost.Test before? That way when we start the server, we should be able to stop it as well at the end of the whole test. HTH PS. I will only now be doing the refactoring to support HEAD requests. I'm pretty sure I'll be refactoring the client implementation to make it "cleaner" and make the actual 'get' body implementation shorter. On Sat, Aug 9, 2008 at 6:03 PM, Dean Michael Berris <mik...@gm...> wrote: > Hi Allister, > > On Sat, Aug 9, 2008 at 2:20 PM, Allister Levi Sanchez > <all...@gm...> wrote: >> Hi again, >> >> I did a test with GCC 4.2.3 (Kubuntu 8.04 LTS as VM guest on Windows Vista) >> with Dean's latest commit on http_integration branch. Here's the result. >> > > Sweet, thanks. :) > >> As in my Windows Vista test, I get an error during the localhost_tests. The >> python server window pops up with this log: >> >> ================== start: python server log >> localhost - - [09/Aug/2008 08:02:42] "GET / HTTP/1.0" 200 - >> localhost - - [09/Aug/2008 08:02:42] "GET / HTTP/1.0" 200 - >> localhost - - [09/Aug/2008 08:02:42] "GET /boost.jpg HTTP/1.0" 200 - >> localhost - - [09/Aug/2008 08:02:42] "GET /test.xml HTTP/1.0" 200 - >> localhost - - [09/Aug/2008 08:02:42] "GET /test.xml HTTP/1.0" 200 - >> localhost - - [09/Aug/2008 08:02:42] "GET /boost.jpg HTTP/1.0" 200 - >> localhost - - [09/Aug/2008 08:02:42] "GET /cgi-bin/requestinfo.py?query=1 >> HTTP/1.0" 200 - >> Traceback (most recent call last): >> File "/usr/lib/python2.5/CGIHTTPServer.py", line 251, in run_cgi >> os.execve(scriptfile, args, os.environ) >> OSError: [Errno 13] Permission denied > > It looks like you'll have to 'chmod +x' flag to the cgi script inside > the cgi-bin/ directory. > >> localhost - - [09/Aug/2008 08:02:42] CGI script exit status 0x7f00 >> localhost - - [09/Aug/2008 08:02:42] code 404, message File not found >> localhost - - [09/Aug/2008 08:02:42] "GET /file_not_found HTTP/1.0" 404 - >> ================== end: python server log >> >> Now, unlike on Visual C++ 2008, the build pauses after >> >> gcc.link libs/network/test/bin/gcc-4.2.3/debug/link-static/localhost_tests >> >> and waits for the python server (xterm?) window to be closed. Once I closed >> that window, the build resumes with this error message: >> >> ==================================== snip: log start >> >> gcc.link libs/network/test/bin/gcc-4.2.3/debug/link-static/localhost_tests >> testing.unit-test >> libs/network/test/bin/gcc-4.2.3/debug/link-static/localhost_tests.passed >> Running 10 test cases... >> unknown location(0): fatal error in "cgi_query": std::runtime_error: End of >> file >> libs/network/test/localhost_tests.cpp(182): last checkpoint >> >> *** 1 failure detected in test suite "http 1.0 localhost tests" >> >> LD_LIBRARY_PATH=/usr/bin:/usr/lib:/usr/lib32:/usr/lib64:$LD_LIBRARY_PATH >> export LD_LIBRARY_PATH >> >> libs/network/test/bin/gcc-4.2.3/debug/link-static/localhost_tests && >> touch >> libs/network/test/bin/gcc-4.2.3/debug/link-static/localhost_tests.passed >> >> ...failed testing.unit-test >> libs/network/test/bin/gcc-4.2.3/debug/link-static/localhost_tests.passed... >> gcc.compile.c++ >> libs/network/test/bin/gcc-4.2.3/debug/link-static/message_test.o >> gcc.link libs/network/test/bin/gcc-4.2.3/debug/link-static/message_test >> testing.unit-test >> libs/network/test/bin/gcc-4.2.3/debug/link-static/message_test.passed >> Running 5 test cases... >> >> ==================================== snip: log end >> >> Hope that helps a bit. >> > > I'm not very good with Python, but I think it would be nice if you'd > like to have your hand at looking through the code? :D > > I think Divye would be on it as well. I'll try to look at why the > tests are failing and see if I can remedy on this side. > > I'm going to go ahead and write HEAD support, and refactor the client > code as well. Let's see how far I get with that effort. > > Thanks again, and I hope everyone's having a good weekend. > > -- > Dean Michael C. Berris > Software Engineer, Friendster, Inc. > -- Dean Michael C. Berris Software Engineer, Friendster, Inc. |