cgi-devel Mailing List for FastCGI / CGI C++ library (Page 2)
Status: Beta
Brought to you by:
drrngrvy
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
(2) |
Mar
(8) |
Apr
|
May
(2) |
Jun
(13) |
Jul
(7) |
Aug
(9) |
Sep
|
Oct
(1) |
Nov
(4) |
Dec
(2) |
2011 |
Jan
(10) |
Feb
|
Mar
|
Apr
(4) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
(5) |
Oct
|
Nov
(3) |
Dec
|
2012 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Darren G. <lis...@gm...> - 2011-01-12 01:26:09
|
Hi Guys, Just following this up - are you able to reproduce this? The function described below should be redundant since the problem is most likely in the CGI library. I'm wondering if this is coming from reusing an fcgi::request object without calling fcgi::request::clear() between requests? As I mentioned, if you can respond with a minimal example that exhibits the behaviour I can take a look. Cheers, Darren On 2 November 2010 14:17, Scott Bailey <Ba...@in...> wrote: > There's a defect in that function. The behavior of operations on an > iterator after erase() is undefined. Do NOT get in the habit of using > dead iterators, it will eventually bite you. Also, I think using > isgraph and isalnum is redundant? > > Here's an improvement, BUT I'd be willing to be theres a better way, still. > > void remove_non_graph(std::string& str) > { > std::string::iterator i=str.begin(); > while( i != str.end() ) > { > if( isgraph(*i) ) > ++i; > else > i=str.erase(i); > } > } > > > > > On Tue, Nov 2, 2010 at 6:11 AM, <jc...@ol...> wrote: > >> Hello, > >> > >> Some of my POST variable are been added illegal characters at the end. > >> > >> 1986^@^@^@^@^@ > >> > >> insead of > >> 1986 > > > > APplying the following function: > > void > > remove_non_graph(std::string& str) > > { > > for(std::string::iterator i=str.end()-1; i>=str.begin(); --i) > > { > > if ( !isalnum(*i) && !isgraph(*i) ) > > { > > str.erase(i); > > } > > } > > } > > to a variable fixes the issue. > > > > Do you think this is a solid patch? > > If so, where in the source codes, should I add it so that all the > > variables are cleaned this way? > > > > Thanks! > > > >> > >> to read those data I am using: > >> > >> for(typename Map::const_iterator i = m.begin(); i != m.end(); ++i) > >> { > >> os << i->first << " = " << i->second << "\n"; > >> } > >> and > >> > >> req.post.pick("task","default"); > >> > >> with the illegal characters been added in both cases. > >> > >>>From the html, I don't see any reason why that would happen. > >> > >> Any idea on how I could fix this problem? > >> > >> Thanks you > >> > >> > >> > ------------------------------------------------------------------------------ > >> Nokia and AT&T present the 2010 Calling All Innovators-North America > >> contest > >> Create new apps & games for the Nokia N8 for consumers in U.S. and > Canada > >> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in > >> marketing > >> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > >> http://p.sf.net/sfu/nokia-dev2dev > >> _______________________________________________ > >> cgi-devel mailing list > >> cgi...@li... > >> https://lists.sourceforge.net/lists/listinfo/cgi-devel > >> > > > > > > > > > ------------------------------------------------------------------------------ > > Nokia and AT&T present the 2010 Calling All Innovators-North America > contest > > Create new apps & games for the Nokia N8 for consumers in U.S. and > Canada > > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in > marketing > > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > > http://p.sf.net/sfu/nokia-dev2dev > > _______________________________________________ > > cgi-devel mailing list > > cgi...@li... > > https://lists.sourceforge.net/lists/listinfo/cgi-devel > > > > > > -- > Scott Bailey > > > ------------------------------------------------------------------------------ > Nokia and AT&T present the 2010 Calling All Innovators-North America > contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in > marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > _______________________________________________ > cgi-devel mailing list > cgi...@li... > https://lists.sourceforge.net/lists/listinfo/cgi-devel > |
From: Darren G. <lis...@gm...> - 2011-01-10 17:15:05
|
Hi, On 10 January 2011 16:34, <jc...@ol...> wrote: > Hello, > > The have the user download an image (versus having the browser display the > image), one usually writes a script like this: > > header("Pragma: public"); > header("Expires: 0"); > header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); > header("Content-Type: application/force-download"); > header("Content-Disposition: attachment; filename=".basename($file)); > header("Content-Description: File Transfer"); > readfile($file); > > How would that work with the cgi library? I am not sure how to write the > equivalent of the header functions. > There is a general way to stream headers: --- cgi::response resp; resp<< cgi::header("Pragma", "public"); --- There are also some specific helpers, although only a few come "built-in": --- cgi::response resp; resp << cgi::content_type("application/force-download") << cgi::content_disposition("attachment; filename=".basename($file)"); --- After setting headers, one simple option would be to stream the file into the response (which would involve copying the contents) and then send that back to the user. An more efficient approach is to read and write the file in chunks, using the Boost.Asio write() functions on request.client(). There is an example of doing this in svn trunk, which you can find here: https://svn.boost.org/svn/boost/sandbox/SOC/2007/cgi/trunk/libs/cgi/example/fcgi/file_browser/main.cpp HTH, Darren |
From: <jc...@ol...> - 2011-01-10 16:53:56
|
Hello, The have the user download an image (versus having the browser display the image), one usually writes a script like this: header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename=".basename($file)); header("Content-Description: File Transfer"); readfile($file); How would that work with the cgi library? I am not sure how to write the equivalent of the header functions. Thank you |
From: Darren G. <dar...@gm...> - 2011-01-10 10:00:39
|
On 10 January 2011 09:39, Darren Garvey <dar...@gm...> wrote: > <snip> > > boost::fcgi::request request; > /* load the request. */ > > boost::fcgi::form_part& variable = request.post["some-var"]; > > // The filename is what the original file was called. > std::string filename = variable.filename; > Actually, that's a barefaced lie: The filename is also a boost::filesystem::path! Cheers, Darren |
From: Darren G. <dar...@gm...> - 2011-01-10 09:40:08
|
Hi Iwan, On 9 January 2011 04:16, Iwan Zotow <iwa...@gm...> wrote: > Hi, Darren > > just started to use your CGI library > > <snip> > > The problem I have is how to save uploaded file. Ok, I've digged through > source(s), > found BOOST_CGI_KEEP_FILE_UPLOADS, defined it and recompiled examples. > No luck - no file(s) are uploaded to server. I guess I've missed something > simple, > but would be grateful if you point out how to save uploaded data > Well I've had comments that the library shouldn't really store the files on the server. As you've noticed, it should do if BOOST_CGI_KEEP_FILE_UPLOADS is defined When that macro is set, the filename of the uploaded file is kept in the form_part in the request's post data member. You should be able to get at it like so: boost::fcgi::request request; /* load the request. */ boost::fcgi::form_part& variable = request.post["some-var"]; // The filename is what the original file was called. std::string filename = variable.filename; // Whereas path is a boost::filesystem::path showing the location of the stored file. // The library does some mangling of the filename. boost::filesystem::path path = variable.path; // Other members: variable.content_type; variable.content_disposition; variable.name; // The key of the variable, ie. "some-var" As with the other types of request data, a form_part is implicitly convertible to a std::string, for consistency with the other request data types. Hopefully that helps. This should be clearer with the new documentation that I'm working on. Cheers, Darren |
From: Iwan Z. <iwa...@gm...> - 2011-01-09 04:16:13
|
Hi, Darren just started to use your CGI library Platform: Ubuntu 10.10, 64bit, BOOST 1.42 installed from repository, using latest trunk of the CGI library. Apache 2.2.16, mod_fcgid 2.3.5, GCC v4.4.5. Able to compile and run several examples, including echo, quickstart for both CGI and FCGI, file browser, upload. So far so good. Setup is easy enough, so that user have to compile executable, rename them to either xxx.cgi or xxx.fcgi, drop it into /usr/lib/cgi-bin/, "apache2ctl stop", "apache2ctl start", point browser to 127.0.0.1/cgi-bin/upload.fcgi and it is up and running. "apache2ctl fullstat" shows module, how many times it is called, etc. No config files are needed. So far so good. The problem I have is how to save uploaded file. Ok, I've digged through source(s), found BOOST_CGI_KEEP_FILE_UPLOADS, defined it and recompiled examples. No luck - no file(s) are uploaded to server. I guess I've missed something simple, but would be grateful if you point out how to save uploaded data Thank you Iwan |
From: Josep M. <jm...@gm...> - 2010-12-28 00:34:09
|
Hi, I found the FastCGI lib and I was quite impressed by the asyn I/O capabilities so I decided to give it a try. However, I was unable to build the library or compile any of the examples. Unfortunately there wasn't info at: http://cgi.sourceforge.net/docs/fastcgi___cgi/tutorial/running.html After downloading and unpacking cgi-0.7.1, I get: boost/ libs/ README.txt project-root.jam Never seen jam before, but it looks like an ant-like builder... after install bjam (apt-get install bjam) I can only get to: Unable to load Boost.Build: could not find "boost-build.jam" --------------------------------------------------------------- Attempted search from /home/solso/test/cgi-0.7.1 up to the root and in these directories from BOOST_BUILD_PATH and BOOST_ROOT: /usr/share/boost-build. Please consult the documentation at 'http://www.boost.org'. I'm sure some of you will be laughing at the moment, but I not able to find out which directories I should put in the environment to build the library and to compile the example I wanted: http://cgi.sourceforge.net/docs/fastcgi___cgi/examples/fastcgi_examples.html#fastcgi___cgi.examples.fastcgi_examples.asynchronous_echo Please, help would be much appreciated. Thanks a lot, Regards, JM |
From: frp <fr...@sh...> - 2010-12-12 19:57:27
|
Hello! I am developing cgi program. And I use this library. I did not understood, how can I save uploaded data to file on server. Can anyone write small example? - - ShellmiX.com - - |
From: Scott B. <Ba...@In...> - 2010-11-02 14:17:20
|
There's a defect in that function. The behavior of operations on an iterator after erase() is undefined. Do NOT get in the habit of using dead iterators, it will eventually bite you. Also, I think using isgraph and isalnum is redundant? Here's an improvement, BUT I'd be willing to be theres a better way, still. void remove_non_graph(std::string& str) { std::string::iterator i=str.begin(); while( i != str.end() ) { if( isgraph(*i) ) ++i; else i=str.erase(i); } } On Tue, Nov 2, 2010 at 6:11 AM, <jc...@ol...> wrote: >> Hello, >> >> Some of my POST variable are been added illegal characters at the end. >> >> 1986^@^@^@^@^@ >> >> insead of >> 1986 > > APplying the following function: > void > remove_non_graph(std::string& str) > { > for(std::string::iterator i=str.end()-1; i>=str.begin(); --i) > { > if ( !isalnum(*i) && !isgraph(*i) ) > { > str.erase(i); > } > } > } > to a variable fixes the issue. > > Do you think this is a solid patch? > If so, where in the source codes, should I add it so that all the > variables are cleaned this way? > > Thanks! > >> >> to read those data I am using: >> >> for(typename Map::const_iterator i = m.begin(); i != m.end(); ++i) >> { >> os << i->first << " = " << i->second << "\n"; >> } >> and >> >> req.post.pick("task","default"); >> >> with the illegal characters been added in both cases. >> >>>From the html, I don't see any reason why that would happen. >> >> Any idea on how I could fix this problem? >> >> Thanks you >> >> >> ------------------------------------------------------------------------------ >> Nokia and AT&T present the 2010 Calling All Innovators-North America >> contest >> Create new apps & games for the Nokia N8 for consumers in U.S. and Canada >> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in >> marketing >> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store >> http://p.sf.net/sfu/nokia-dev2dev >> _______________________________________________ >> cgi-devel mailing list >> cgi...@li... >> https://lists.sourceforge.net/lists/listinfo/cgi-devel >> > > > > ------------------------------------------------------------------------------ > Nokia and AT&T present the 2010 Calling All Innovators-North America contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > _______________________________________________ > cgi-devel mailing list > cgi...@li... > https://lists.sourceforge.net/lists/listinfo/cgi-devel > -- Scott Bailey |
From: Darren G. <lis...@gm...> - 2010-11-02 13:15:41
|
Hi there, On 2 November 2010 12:38, <jc...@ol...> wrote: > Hello, > > Some of my POST variable are been added illegal characters at the end. > > 1986^@^@^@^@^@ > > insead of > 1986 > > to read those data I am using: > > for(typename Map::const_iterator i = m.begin(); i != m.end(); ++i) > { > os << i->first << " = " << i->second << "\n"; > } > and > > req.post.pick("task","default"); > > with the illegal characters been added in both cases. > This looks like for some reason the buffer holding the input data is longer than it should be. I can't tell from this why that would be. Are you able to reproduce this using a complete test case that I can try compiling? A couple of questions to check: Q. Is the data being sent as multipart/form-data? Q. Does the post data buffer on the request have these extra characters too? You can get hold of the complete post data buffer by looking at request::post_data() - note that it is a vector<char> so you can't stream it to cout directly! Let me know how you get on. Cheers, Darren |
From: <jc...@ol...> - 2010-11-02 13:11:31
|
> Hello, > > Some of my POST variable are been added illegal characters at the end. > > 1986^@^@^@^@^@ > > insead of > 1986 APplying the following function: void remove_non_graph(std::string& str) { for(std::string::iterator i=str.end()-1; i>=str.begin(); --i) { if ( !isalnum(*i) && !isgraph(*i) ) { str.erase(i); } } } to a variable fixes the issue. Do you think this is a solid patch? If so, where in the source codes, should I add it so that all the variables are cleaned this way? Thanks! > > to read those data I am using: > > for(typename Map::const_iterator i = m.begin(); i != m.end(); ++i) > { > os << i->first << " = " << i->second << "\n"; > } > and > > req.post.pick("task","default"); > > with the illegal characters been added in both cases. > >>From the html, I don't see any reason why that would happen. > > Any idea on how I could fix this problem? > > Thanks you > > > ------------------------------------------------------------------------------ > Nokia and AT&T present the 2010 Calling All Innovators-North America > contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in > marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > _______________________________________________ > cgi-devel mailing list > cgi...@li... > https://lists.sourceforge.net/lists/listinfo/cgi-devel > |
From: <jc...@ol...> - 2010-11-02 12:39:06
|
Hello, Some of my POST variable are been added illegal characters at the end. 1986^@^@^@^@^@ insead of 1986 to read those data I am using: for(typename Map::const_iterator i = m.begin(); i != m.end(); ++i) { os << i->first << " = " << i->second << "\n"; } and req.post.pick("task","default"); with the illegal characters been added in both cases. >From the html, I don't see any reason why that would happen. Any idea on how I could fix this problem? Thanks you |
From: <jc...@ol...> - 2010-10-10 17:13:06
|
Hello How do we upload file to the server using fastcgi? How can I define where the file will end? Is there an example somewhere? Thanks |
From: Андрей А. <ala...@gm...> - 2010-08-31 19:18:22
|
I would like to run fastcgi script manually for example 127.0.0.1:9000 how to do it? |
From: Ankur G. <ank...@gm...> - 2010-08-30 19:53:11
|
Hi Darren, Yes, the force would work well. I noticed another error which I believe happened when the old request was getting closed. terminate called after throwing an instance of 'boost::cgi::common::map_read_error<std::multimap<std::basic_string<char, boost::cgi::common::ichar_traits<char>, std::allocator<char> >, std::string, std::less<std::basic_string<char, boost::cgi::common::ichar_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, boost::cgi::common::ichar_traits<char>, std::allocator<char> > const, std::string> > > >' what(): Attempt to access uninitialised data map. Did you forget to call request::load()? Thanks, Ankur On Fri, Aug 20, 2010 at 3:43 AM, Darren Garvey <dar...@gm...>wrote: > On 20 August 2010 03:19, Ankur Gupta <ank...@gm...> wrote: > >> Thanks for your response Darren. When the EPIPE happens, the >> request::commit throws an exception which I am catching. I am creating a >> new request which seems to work fine but closing the old request throws an >> exception. How does one confirm that the resources allocated for the older >> request did get freed up? >> > > You should be able to call request::clear() if the commit() call fails and > then reuse the request. > > request::close() actually sends a specific FastCGI packet to the server to > tell it that the request has been dealt with. Would it be less suprising if > you could pass an extra boolean "force" argument to request::close() that > simply ignored errors and cleared the request anyway? > > Cheers, > Darren > > >> On Wed, Aug 18, 2010 at 4:44 PM, Darren Garvey <dar...@gm...>wrote: >> >>> Hi Ankur, >>> >>> On 17 August 2010 21:11, Ankur Gupta <ank...@gm...> wrote: >>> >>>> >>>> I have encountered another issue. Here is the description: >>>> >>>> Thread gets a request, processes it but gets an EPIPE while committing >>>> the response. The thread could return but instead it continues on to do >>>> another accept. At this point, the accept fails with an already open >>>> message and the thread exits. >>>> >>>> How should this case be handled? >>>> >>> >>> This is an interesting issue, one that could be dealt with in a couple of >>> ways. >>> >>> First off, if the response cannot be written back to the server, the >>> error should be raised by the library in the response::send() call. Are you >>> catching this or is no error being raised? >>> >>> I don't see why the library couldn't handle this by accepting a new >>> request when the request is in an error state. >>> >>> Just note that in general you are responsible for closing a request, >>> either by calling commit() or request::close(). >>> >>> Thanks for the report. >>> >>> Cheers, >>> Darren >>> >>> >>> >> >> > |
From: Darren G. <dar...@gm...> - 2010-08-20 10:44:13
|
On 20 August 2010 03:19, Ankur Gupta <ank...@gm...> wrote: > Thanks for your response Darren. When the EPIPE happens, the > request::commit throws an exception which I am catching. I am creating a > new request which seems to work fine but closing the old request throws an > exception. How does one confirm that the resources allocated for the older > request did get freed up? > You should be able to call request::clear() if the commit() call fails and then reuse the request. request::close() actually sends a specific FastCGI packet to the server to tell it that the request has been dealt with. Would it be less suprising if you could pass an extra boolean "force" argument to request::close() that simply ignored errors and cleared the request anyway? Cheers, Darren > On Wed, Aug 18, 2010 at 4:44 PM, Darren Garvey <dar...@gm...>wrote: > >> Hi Ankur, >> >> On 17 August 2010 21:11, Ankur Gupta <ank...@gm...> wrote: >> >>> >>> I have encountered another issue. Here is the description: >>> >>> Thread gets a request, processes it but gets an EPIPE while committing >>> the response. The thread could return but instead it continues on to do >>> another accept. At this point, the accept fails with an already open >>> message and the thread exits. >>> >>> How should this case be handled? >>> >> >> This is an interesting issue, one that could be dealt with in a couple of >> ways. >> >> First off, if the response cannot be written back to the server, the error >> should be raised by the library in the response::send() call. Are you >> catching this or is no error being raised? >> >> I don't see why the library couldn't handle this by accepting a new >> request when the request is in an error state. >> >> Just note that in general you are responsible for closing a request, >> either by calling commit() or request::close(). >> >> Thanks for the report. >> >> Cheers, >> Darren >> >> >> > > |
From: Ankur G. <ank...@gm...> - 2010-08-20 02:19:13
|
Thanks for your response Darren. When the EPIPE happens, the request::commit throws an exception which I am catching. I am creating a new request which seems to work fine but closing the old request throws an exception. How does one confirm that the resources allocated for the older request did get freed up? -Ankur On Wed, Aug 18, 2010 at 4:44 PM, Darren Garvey <dar...@gm...>wrote: > Hi Ankur, > > On 17 August 2010 21:11, Ankur Gupta <ank...@gm...> wrote: > >> >> I have encountered another issue. Here is the description: >> >> Thread gets a request, processes it but gets an EPIPE while committing >> the response. The thread could return but instead it continues on to do >> another accept. At this point, the accept fails with an already open >> message and the thread exits. >> >> How should this case be handled? >> > > This is an interesting issue, one that could be dealt with in a couple of > ways. > > First off, if the response cannot be written back to the server, the error > should be raised by the library in the response::send() call. Are you > catching this or is no error being raised? > > I don't see why the library couldn't handle this by accepting a new request > when the request is in an error state. > > Just note that in general you are responsible for closing a request, either > by calling commit() or request::close(). > > Thanks for the report. > > Cheers, > Darren > > > |
From: Darren G. <dar...@gm...> - 2010-08-18 23:45:02
|
Hi Ankur, On 17 August 2010 21:11, Ankur Gupta <ank...@gm...> wrote: > > I have encountered another issue. Here is the description: > > Thread gets a request, processes it but gets an EPIPE while committing the > response. The thread could return but instead it continues on to do another > accept. At this point, the accept fails with an already open message and > the thread exits. > > How should this case be handled? > This is an interesting issue, one that could be dealt with in a couple of ways. First off, if the response cannot be written back to the server, the error should be raised by the library in the response::send() call. Are you catching this or is no error being raised? I don't see why the library couldn't handle this by accepting a new request when the request is in an error state. Just note that in general you are responsible for closing a request, either by calling commit() or request::close(). Thanks for the report. Cheers, Darren |
From: Ankur G. <ank...@gm...> - 2010-08-17 20:11:42
|
Hi Darren, I have encountered another issue. Here is the description: Thread gets a request, processes it but gets an EPIPE while committing the response. The thread could return but instead it continues on to do another accept. At this point, the accept fails with an already open message and the thread exits. How should this case be handled? Thanks, -Ankur On Fri, Aug 13, 2010 at 5:09 PM, Ankur Gupta <ank...@gm...> wrote: > Hi Darren, > > Doing 'new_request->clear()' did fix the issue. > > Thanks, > -Ankur > > > On Thu, Aug 12, 2010 at 2:21 AM, Darren Garvey <lis...@gm...>wrote: > >> Hi Ankur, >> >> On 12 August 2010 08:13, Ankur Gupta <ank...@gm...> wrote: >> >>> >>> I am trying out the code for server3 in cgi/example/fcgi. The server >>> has 10 threads. I am noticing that after sending 10 requests old requests >>> start recirculating EVEN THOUGH the request URL is different. Eg: >>> >> >> <snip description> >> >> What platform are you trying this on? This sounds like the request object >> isn't being reset by the accept() handler. Can you try adding the line: >> >> new_request->clear(); >> >> above the call to accept(*new_request) to see if this helps? >> >> Cheers, >> Darren >> > > |
From: Ankur G. <ank...@gm...> - 2010-08-14 00:09:26
|
Hi Darren, Doing 'new_request->clear()' did fix the issue. Thanks, -Ankur On Thu, Aug 12, 2010 at 2:21 AM, Darren Garvey <lis...@gm...>wrote: > Hi Ankur, > > On 12 August 2010 08:13, Ankur Gupta <ank...@gm...> wrote: > >> >> I am trying out the code for server3 in cgi/example/fcgi. The server has >> 10 threads. I am noticing that after sending 10 requests old requests start >> recirculating EVEN THOUGH the request URL is different. Eg: >> > > <snip description> > > What platform are you trying this on? This sounds like the request object > isn't being reset by the accept() handler. Can you try adding the line: > > new_request->clear(); > > above the call to accept(*new_request) to see if this helps? > > Cheers, > Darren > |
From: Darren G. <lis...@gm...> - 2010-08-12 09:21:57
|
Hi Ankur, On 12 August 2010 08:13, Ankur Gupta <ank...@gm...> wrote: > > I am trying out the code for server3 in cgi/example/fcgi. The server has > 10 threads. I am noticing that after sending 10 requests old requests start > recirculating EVEN THOUGH the request URL is different. Eg: > <snip description> What platform are you trying this on? This sounds like the request object isn't being reset by the accept() handler. Can you try adding the line: new_request->clear(); above the call to accept(*new_request) to see if this helps? Cheers, Darren |
From: Ankur G. <ank...@gm...> - 2010-08-12 07:13:15
|
Hi Darren, I am trying out the code for server3 in cgi/example/fcgi. The server has 10 threads. I am noticing that after sending 10 requests old requests start recirculating EVEN THOUGH the request URL is different. Eg: First 10 requests: Thread 1: http://foo?x=1. req.get["x"] == 1 Thread 2: http://foo?x=2 req.get["x"] == 2 Thread 3: http://foo?x=3 req.get["x"] == 3 : : Thread 10: http://foo?x=10 req.get["x"] == 10 11th request http://foo?x=11 However doing "req.get["x"] shows 1" instead of 11 12th request http://foo?x=12 Doing "req.get["x"] shows 2" instead of 12 Why is the old data recirculating? I do see the parse_all getting called but it doesn't seem to have any affect. Any help would be really appreciated! Thanks! Ankur |
From: Ankur G. <ank...@gm...> - 2010-07-27 08:15:32
|
I figured out that iii) was happening due to commit() throwing an exception when the browser session is closed. Thanks, -Ankur On Tue, Jul 27, 2010 at 12:47 AM, Ankur Gupta <ank...@gm...> wrote: > Hi Darren, > > That sounds good. Looking forward to seeing the latest changes. > > I had some feedback from testing some of the stuff that's currently there: > > i) The echo_threaded example seems to block if the first thread hangs. > Even though multiple threads are created, it seems to behave like a single > threaded program. > > ii) server4 example doesn't seem to compile with boost 1.43 > > iii) I saw the following error in serve3 example after adding a delay in > handle_request and sending multiple browser requests. The error happened > when the delay got over. Is this an exception that should be caught? > > Error system:32: Broken pipe > terminate called after throwing an instance of > 'boost::system::system_error' > what(): Broken pipe > Aborted > > > Thanks, > -Ankur > > > On Mon, Jul 26, 2010 at 4:43 PM, Darren Garvey < > lis...@go...> wrote: > >> Hi Ankur, >> >> >> On 26 July 2010 07:02, Ankur Gupta <ank...@gm...> wrote: >> >>> Is there any timeline for Unix domain sockets implementation? This >>> should help performance quite a bit I feel. >>> >> >> I have been making a large chunk of changes locally, none of which are in >> the repository quite yet. >> >> These changes include support for TCP sockets on Windows (ie. for external >> FastCGI) and for Unix sockets, both of which are compile-time choices. There >> is also an experimental dynamic wrapper over the main classes of the >> library, which allows for protocol and / or connection type to be picked at >> runtime. >> >> I will try and find time to commit these in the next couple of weeks. >> Especially with the dynamic CGI stuff, I'm still a bit unsure about the >> naming conventions, async functionality and a couple of other details so >> it'd be interesting to see what other's thoughts were. >> >> Cheers, >> Darren >> > > |
From: Ankur G. <ank...@gm...> - 2010-07-27 07:47:54
|
Hi Darren, That sounds good. Looking forward to seeing the latest changes. I had some feedback from testing some of the stuff that's currently there: i) The echo_threaded example seems to block if the first thread hangs. Even though multiple threads are created, it seems to behave like a single threaded program. ii) server4 example doesn't seem to compile with boost 1.43 iii) I saw the following error in serve3 example after adding a delay in handle_request and sending multiple browser requests. The error happened when the delay got over. Is this an exception that should be caught? Error system:32: Broken pipe terminate called after throwing an instance of 'boost::system::system_error' what(): Broken pipe Aborted Thanks, -Ankur On Mon, Jul 26, 2010 at 4:43 PM, Darren Garvey < lis...@go...> wrote: > Hi Ankur, > > > On 26 July 2010 07:02, Ankur Gupta <ank...@gm...> wrote: > >> Is there any timeline for Unix domain sockets implementation? This >> should help performance quite a bit I feel. >> > > I have been making a large chunk of changes locally, none of which are in > the repository quite yet. > > These changes include support for TCP sockets on Windows (ie. for external > FastCGI) and for Unix sockets, both of which are compile-time choices. There > is also an experimental dynamic wrapper over the main classes of the > library, which allows for protocol and / or connection type to be picked at > runtime. > > I will try and find time to commit these in the next couple of weeks. > Especially with the dynamic CGI stuff, I'm still a bit unsure about the > naming conventions, async functionality and a couple of other details so > it'd be interesting to see what other's thoughts were. > > Cheers, > Darren > |
From: Darren G. <dar...@gm...> - 2010-07-27 00:46:49
|
Hi all, I've been playing around with some benchmarking recently and am wondering what the best tool is for this. I'm using ApacheBench and graphviz to benchmark the library which is OK, but is there a better solution out there? The library needs some benchmarking graphs that show performance of the various protocols (CGI, FastCGI, SCGI) over different numbers of requests and concurrencies. Any pointers would be appreciated! Cheers, Darren |