cgi-devel Mailing List for FastCGI / CGI C++ library
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: Leutloff, C. <leu...@xo...> - 2013-04-22 17:57:21
|
Hi Ben, good to hear someone is working again on CGI. I am using it, too. Some of your fixes sounds similar to mine 8-( Development has moved to Github: https://github.com/darrengarvey/cgi. I am interested in your improvements. So please send Darren (and me https://github.com/leutloff/cgi) a pull request, so that we can merge your patches into our repositories. Thanks a lot for your contribution. Bye Christian -- Christian Leutloff xox Industrie IT GmbH WWW: http://www.xoxind.de Von: McCart, Ben Gesendet: Montag, 22. April 2013 17:36 An: cgi...@li... Betreff: [cgi-devel] Where is the SVN source? (I have patches I want to contribute) I couldn't locate matching source for the 0.7.1 release when browsing the svn repository. I have patches for a number of items I would like to contribute, but I can't generate a proper patch file if I can't find svn repository matching the 0.7.1 release. The patches I would like to contribute are summarized as: . Changes needed to compile against boost 1.48 (yes, I know this is now an old release, but it is newer than the original.) . Changes needed to remove all compile warnings (VS2010) . Fixed a binary operator bug in basic_request.hpp (VS2010) . A workaround to allow valid POST content for mime types other than the (very short) hardcoded list. (In my case application/json, which is necessary for certain classes of RESTful services.) If someone can direct me to a svn url with source matching the 0.7.1 release I can contribute unified diff/patch files to the admin if he is at all interested in them. |
From: McCart, B. <bm...@ov...> - 2013-04-22 15:56:43
|
I couldn't locate matching source for the 0.7.1 release when browsing the svn repository. I have patches for a number of items I would like to contribute, but I can't generate a proper patch file if I can't find svn repository matching the 0.7.1 release. The patches I would like to contribute are summarized as: * Changes needed to compile against boost 1.48 (yes, I know this is now an old release, but it is newer than the original.) * Changes needed to remove all compile warnings (VS2010) * Fixed a binary operator bug in basic_request.hpp (VS2010) * A workaround to allow valid POST content for mime types other than the (very short) hardcoded list. (In my case application/json, which is necessary for certain classes of RESTful services.) If someone can direct me to a svn url with source matching the 0.7.1 release I can contribute unified diff/patch files to the admin if he is at all interested in them. Ben McCart Senior Software Engineer OVERWATCH An Operating Unit of Textron Systems Ph: 406.829.5270 Fx: 406.829.3593 bm...@ov...<mailto:bm...@ov...> www.overwatch.com<http://www.overwatch.com> "WARNING: Documents that can be viewed, printed or retrieved from this E-Mail may contain technical data whose export is restricted by the Arms Export Control Act (Title 22, U.S.C., Sec 2751, et seq,) or the Export Administration Act of 1979, as amended, Title 50, U.S.C., App. 2401 et seq. and which may not be exported, released or disclosed to non-U.S. persons (i.e. persons who are not U.S. citizens or lawful permanent residents ["green card" holders]) inside or outside the United States, without first obtaining an export license. Violations of these export laws are subject to severe civil, criminal and administrative penalties." |
From: Leutloff, C. <leu...@xo...> - 2012-07-23 19:52:56
|
Hi Mathieu, CGI is a header only library. Just include the header directories and you are done. Btw.: I am using CMake, too. Bye Christian Hi there, I am trying to simply build cgi. I have never used bjam before (cmake user), and bjam fails with: $ git clone git://github.com/darrengarvey/cgi.git $ cd cgi $ bjam project-root.jam:20: in get-boost-root rule ERROR unknown in module Jamfile</home/mathieu/tmp/cgi>. project-root.jam:28: in modules.load /usr/share/boost-build/build/project.jam:314: in load-jamfile /usr/share/boost-build/build/project.jam:62: in load /usr/share/boost-build/build/project.jam:168: in project.find /usr/share/boost-build/build-system.jam:570: in load /usr/share/boost-build/kernel/modules.jam:283: in import /usr/share/boost-build/kernel/bootstrap.jam:142: in boost-build /usr/share/boost-build/boost-build.jam:8: in module scope With: $ apt-cache policy libboost1.49-dev libboost1.49-dev: Installed: 1.49.0-3.1 Candidate: 1.49.0-3.1 Version table: *** 1.49.0-3.1 0 500 http://ftp.fr.debian.org/debian/ sid/main amd64 Packages 100 /var/lib/dpkg/status Thanks much, -- Mathieu |
From: Mathieu M. <mat...@gm...> - 2012-07-23 16:29:28
|
Hi there, I am trying to simply build cgi. I have never used bjam before (cmake user), and bjam fails with: $ git clone git://github.com/darrengarvey/cgi.git $ cd cgi $ bjam project-root.jam:20: in get-boost-root rule ERROR unknown in module Jamfile</home/mathieu/tmp/cgi>. project-root.jam:28: in modules.load /usr/share/boost-build/build/project.jam:314: in load-jamfile /usr/share/boost-build/build/project.jam:62: in load /usr/share/boost-build/build/project.jam:168: in project.find /usr/share/boost-build/build-system.jam:570: in load /usr/share/boost-build/kernel/modules.jam:283: in import /usr/share/boost-build/kernel/bootstrap.jam:142: in boost-build /usr/share/boost-build/boost-build.jam:8: in module scope With: $ apt-cache policy libboost1.49-dev libboost1.49-dev: Installed: 1.49.0-3.1 Candidate: 1.49.0-3.1 Version table: *** 1.49.0-3.1 0 500 http://ftp.fr.debian.org/debian/ sid/main amd64 Packages 100 /var/lib/dpkg/status Thanks much, -- Mathieu |
From: Darren G. <dar...@gm...> - 2012-03-04 19:14:02
|
Hey, A fix for this is up on github: https://github.com/darrengarvey/cgi/commit/88e5d90c9cc99492002d2b8470ebbfba07022cd6 I'm using github now because firstly git is much much better for very branched development and also that hopefully it'll remove some barriers from others to send me any ideas or work they have done with the library themselves (hint hint ;). Cheers, Darren On 4 March 2012 13:29, <jc...@ol...> wrote: > Hi Darren > > I am trying to compile an app with boost 1.49.0. > g++ is complaining that at: > boost.1.49.0/include/boost/cgi/fcgi/acceptor_service_impl.hpp:161: > void boost::asio::socket_acceptor_service::shutdown_service() [with > Protocol = boost::asio::ip::tcp] is private > > Indeed, if I go to > /boost/boost.1.49.0/include/boost/asio/socket_acceptor_service.hpp:264 > and I make the function shutdown_service() public compilation goes through > without error > > http://www.boost.org/doc/libs/1_49_0/doc/html/boost_asio/history.html > Asio 1.6.0 / Boost 1.47 > there is the following change: > Changed the shutdown_service() member functions to be private. > > What do you think would be a good way to fix this error? > > Have a great day > > JCR > > |
From: <jc...@ol...> - 2012-03-04 14:02:00
|
Hi Darren I am trying to compile an app with boost 1.49.0. g++ is complaining that at: boost.1.49.0/include/boost/cgi/fcgi/acceptor_service_impl.hpp:161: void boost::asio::socket_acceptor_service::shutdown_service() [with Protocol = boost::asio::ip::tcp] is private Indeed, if I go to /boost/boost.1.49.0/include/boost/asio/socket_acceptor_service.hpp:264 and I make the function shutdown_service() public compilation goes through without error http://www.boost.org/doc/libs/1_49_0/doc/html/boost_asio/history.html Asio 1.6.0 / Boost 1.47 there is the following change: Changed the shutdown_service() member functions to be private. What do you think would be a good way to fix this error? Have a great day JCR |
From: Darren G. <dar...@gm...> - 2012-01-23 11:23:47
|
Excellent. I'll apply this to the git repo tonight. Thanks for the patch! P.S. Is this patch taken against the SVN version of the repo or have you seen the newer one at github? Cheers, Darren On 18 January 2012 20:36, Leutloff, Christian <leu...@xo...> wrote: > Hi all, > > I have applied some tweaks to get the CGI library to compile with VS2010. > See the attached patch contains five one liners. > > Bye > Christian > > -- > Dr.-Ing. Christian Leutloff > XOX Industrie IT GmbH > WWW: http://www.xoxind.de > > |
From: Darren G. <lis...@go...> - 2011-11-20 23:54:20
|
Hey Clint, This could be one of two things. First is that IIS 7.5 actually does support proper multiplexing, the other is that you've not closed your request before trying to accept another. If it is neither of these, it could be a bug.* By "proper multiplexing", I mean when the server sends more than one request across a single connection at the same time. Most FastCGI-enabled servers support sending more than one request down the same connection, but usually only one after another. ie. request A completes before request B is sent. I don't see anything on the iis website about this, so it could be that you're just not calling close() on request. It'd be awesome if we finally had a server that supported multiplexing, I've been waiting for one for years! I've just picked up development again, after moving over to git and starting to integrate over a bunch of old patches, so in a few weeks I should be back up to speed (although I have said that a few times now). The code is looking very shabby right now! Did you try to use the basic fcgi_echo example against the server? Cheers, Darren * In fact, I'm wondering right now why this line isn't in fcgi_request_service::clear(), in fcgi/fcgi_request_service.hpp: ... impl.id_ = 0; ... On 19 November 2011 22:50, Clint Phillips <cli...@gm...> wrote: > Hello All, > > I wondered if anyone as any thoughts or comments on this. I'm building > fcgi against mingw and trying to run it against IIS 7.5. > > The first request works just fine, but the second throws the following > error: > [fcgi] System error: Multiplexing connections are not yet fully supported. > > > Thanks for any comments. > > Clint > > PS Hopefully you don't get this twice, I send from the wrong email address > the first time. > > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure > contains a definitive record of customers, application performance, > security threats, fraudulent activity, and more. Splunk takes this > data and makes sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-novd2d > _______________________________________________ > cgi-devel mailing list > cgi...@li... > https://lists.sourceforge.net/lists/listinfo/cgi-devel > > |
From: Clint P. <cli...@gm...> - 2011-11-19 22:50:25
|
Hello All, I wondered if anyone as any thoughts or comments on this. I'm building fcgi against mingw and trying to run it against IIS 7.5. The first request works just fine, but the second throws the following error: [fcgi] System error: Multiplexing connections are not yet fully supported. Thanks for any comments. Clint PS Hopefully you don't get this twice, I send from the wrong email address the first time. |
From: Clint P. <cli...@gr...> - 2011-11-19 22:48:14
|
Hello All, I wondered if anyone as any thoughts or comments on this. I'm building fcgi against mingw and trying to run it against IIS 7.5. The first request works just fine, but the second throws the following error: [fcgi] System error: Multiplexing connections are not yet fully supported. Thanks for any comments. Clint |
From: Leutloff, C. <cle...@xo...> - 2011-09-27 08:34:10
|
Hi, you can use wireshark to capture and analyze any network communication. Wireshark is Open Source and available from http://www.wireshark.org/ Hope it helps Christian -----Ursprüngliche Nachricht----- Von: jc...@ol... [mailto:jc...@ol...] Gesendet: Dienstag, 27. September 2011 04:17 An: lis...@gm... Cc: cgi...@li... Betreff: Re: [cgi-devel] truncated post variable Hi Darren I am facing a similar issue again. I wish I could build a small program reproducing the error but somehow I am unable. I must confess that I am lost in the maze of all those classes, functions... I would like to get an idea of the post data that the library is getting from the webserver before any parsing, so that I could know if the issue is inside the CGI library or around the webserver Any idea on how I could do that? Thanks JCR > Hi JC, > > On 6 September 2011 00:18, <jc...@ol...> wrote: > >> Hello Darren, >> >> I am struggling with the following issue. On a linux box with nginx as >> the >> webserver >> >> on the client's side, I am making the following jquery call: >> >> function sign_up() >> { >> $("#sign_up_feedback").html('').hide(); >> $.post >> ( "/", >> { task: 'sign_up', >> member_username: >> $('#member_username').val(), >> member_password: >> $('#member_password').val(), >> member_password_repeat: >> $('#member_password_repeat').val(), >> member_first_name: >> $('#member_first_name').val(), >> member_last_name: >> $('#member_last_name').val(), >> member_phone: $('#member_phone').val(), >> member_email: $('#member_email').val(), >> member_corporation_id: >> $('#member_corporation_id').val(), >> member_unit: $('#member_unit').val(), >> member_card_number: >> $('#member_card_number').val(), >> member_card_expiration: >> $('#member_card_expiration').val() >> }, >> function(data) >> { >> $("#sign_up_feedback").html(data).show(); >> } >> ); >> } >> > > Look fine. > > >> I have used similar functions, thousands of times but, this time,when I >> read the post values server side >> using >> print_variables_(req.post, "POST"); >> with >> template<typename Map> >> void >> print_variables_(Map& m, std::string title) >> { >> std::ostringstream os; >> os << title << "\n"; >> if (m.empty()) >> { >> os << "NONE\n"; >> } >> else >> { >> for(typename Map::const_iterator i = m.begin(); i != m.end(); ++i) >> { >> os << i->first << " = " << i->second << "\n"; >> } >> } >> os << "\n"; >> write_to_file("~/log_requests", os.str()); >> } >> > > Ok. > > >> member_card_number is truncated to member_card! I looked at the http >> headers and the nginx logs and member_card_number is not truncated. >> > > That's odd. Is it just member_card_number that is truncated? Are all of > the > other parameters ok? > > >> I am very puzzled here as this has never really happened to me. >> Where in the source code of the CGI library could I see where the >> parsing >> of the http header is done? >> > > These functions live in: > > http://svn.boost.org/svn/boost/sandbox/SOC/2007/cgi/trunk/boost/cgi/detail/extract_params.hpp > http://svn.boost.org/svn/boost/sandbox/SOC/2007/cgi/trunk/boost/cgi/detail/url_decode.ipp > > There's also parse_url_encoded_form() in: > > http://svn.boost.org/svn/boost/sandbox/SOC/2007/cgi/trunk/boost/cgi/impl/form_parser.ipp > > which will get called for POST params.* > > Although I can't imagine how you're ending up seeing what you're seeing. > Could you provide a minimal compilable file I can try? > > Cheers, > Darren > > * wow I really need to commit this newer code, trunk isn't looking it's > best > I'm afraid. :( > ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 _______________________________________________ cgi-devel mailing list cgi...@li... https://lists.sourceforge.net/lists/listinfo/cgi-devel |
From: <jc...@ol...> - 2011-09-27 02:17:35
|
Hi Darren I am facing a similar issue again. I wish I could build a small program reproducing the error but somehow I am unable. I must confess that I am lost in the maze of all those classes, functions... I would like to get an idea of the post data that the library is getting from the webserver before any parsing, so that I could know if the issue is inside the CGI library or around the webserver Any idea on how I could do that? Thanks JCR > Hi JC, > > On 6 September 2011 00:18, <jc...@ol...> wrote: > >> Hello Darren, >> >> I am struggling with the following issue. On a linux box with nginx as >> the >> webserver >> >> on the client's side, I am making the following jquery call: >> >> function sign_up() >> { >> $("#sign_up_feedback").html('').hide(); >> $.post >> ( "/", >> { task: 'sign_up', >> member_username: >> $('#member_username').val(), >> member_password: >> $('#member_password').val(), >> member_password_repeat: >> $('#member_password_repeat').val(), >> member_first_name: >> $('#member_first_name').val(), >> member_last_name: >> $('#member_last_name').val(), >> member_phone: $('#member_phone').val(), >> member_email: $('#member_email').val(), >> member_corporation_id: >> $('#member_corporation_id').val(), >> member_unit: $('#member_unit').val(), >> member_card_number: >> $('#member_card_number').val(), >> member_card_expiration: >> $('#member_card_expiration').val() >> }, >> function(data) >> { >> $("#sign_up_feedback").html(data).show(); >> } >> ); >> } >> > > Look fine. > > >> I have used similar functions, thousands of times but, this time,when I >> read the post values server side >> using >> print_variables_(req.post, "POST"); >> with >> template<typename Map> >> void >> print_variables_(Map& m, std::string title) >> { >> std::ostringstream os; >> os << title << "\n"; >> if (m.empty()) >> { >> os << "NONE\n"; >> } >> else >> { >> for(typename Map::const_iterator i = m.begin(); i != m.end(); ++i) >> { >> os << i->first << " = " << i->second << "\n"; >> } >> } >> os << "\n"; >> write_to_file("~/log_requests", os.str()); >> } >> > > Ok. > > >> member_card_number is truncated to member_card! I looked at the http >> headers and the nginx logs and member_card_number is not truncated. >> > > That's odd. Is it just member_card_number that is truncated? Are all of > the > other parameters ok? > > >> I am very puzzled here as this has never really happened to me. >> Where in the source code of the CGI library could I see where the >> parsing >> of the http header is done? >> > > These functions live in: > > http://svn.boost.org/svn/boost/sandbox/SOC/2007/cgi/trunk/boost/cgi/detail/extract_params.hpp > http://svn.boost.org/svn/boost/sandbox/SOC/2007/cgi/trunk/boost/cgi/detail/url_decode.ipp > > There's also parse_url_encoded_form() in: > > http://svn.boost.org/svn/boost/sandbox/SOC/2007/cgi/trunk/boost/cgi/impl/form_parser.ipp > > which will get called for POST params.* > > Although I can't imagine how you're ending up seeing what you're seeing. > Could you provide a minimal compilable file I can try? > > Cheers, > Darren > > * wow I really need to commit this newer code, trunk isn't looking it's > best > I'm afraid. :( > |
From: <jc...@ol...> - 2011-09-11 17:52:31
|
Hello Darren Thanks for the answers. I am still investigating the issue. I found a way out by cutting the length of the name of the variable... I know, I know, this is not even a real hack. I don't think it has anything to do with the CGI library, I think it is more in my nginx set up. Any way, I am going to keep on investigating that because this is really strange Ans, yes a new release would be really nice! JCR > On 6 September 2011 00:18, <jc...@ol...> wrote: > >> Hello Darren, >> >> I am struggling with the following issue. On a linux box with nginx as >> the >> webserver >> >> on the client's side, I am making the following jquery call: >> >> function sign_up() >> { >> $("#sign_up_feedback").html('').hide(); >> $.post >> ( "/", >> { task: 'sign_up', >> member_username: >> $('#member_username').val(), >> member_password: >> $('#member_password').val(), >> member_password_repeat: >> $('#member_password_repeat').val(), >> member_first_name: >> $('#member_first_name').val(), >> member_last_name: >> $('#member_last_name').val(), >> member_phone: $('#member_phone').val(), >> member_email: $('#member_email').val(), >> member_corporation_id: >> $('#member_corporation_id').val(), >> member_unit: $('#member_unit').val(), >> member_card_number: >> $('#member_card_number').val(), >> member_card_expiration: >> $('#member_card_expiration').val() >> }, >> function(data) >> { >> $("#sign_up_feedback").html(data).show(); >> } >> ); >> } >> > > Look fine. > > >> I have used similar functions, thousands of times but, this time,when I >> read the post values server side >> using >> print_variables_(req.post, "POST"); >> with >> template<typename Map> >> void >> print_variables_(Map& m, std::string title) >> { >> std::ostringstream os; >> os << title << "\n"; >> if (m.empty()) >> { >> os << "NONE\n"; >> } >> else >> { >> for(typename Map::const_iterator i = m.begin(); i != m.end(); ++i) >> { >> os << i->first << " = " << i->second << "\n"; >> } >> } >> os << "\n"; >> write_to_file("~/log_requests", os.str()); >> } >> > > Ok. > > >> member_card_number is truncated to member_card! I looked at the http >> headers and the nginx logs and member_card_number is not truncated. >> > > That's odd. Is it just member_card_number that is truncated? Are all of > the > other parameters ok? > > >> I am very puzzled here as this has never really happened to me. >> Where in the source code of the CGI library could I see where the >> parsing >> of the http header is done? >> > > These functions live in: > > http://svn.boost.org/svn/boost/sandbox/SOC/2007/cgi/trunk/boost/cgi/detail/extract_params.hpp > http://svn.boost.org/svn/boost/sandbox/SOC/2007/cgi/trunk/boost/cgi/detail/url_decode.ipp > > There's also parse_url_encoded_form() in: > > http://svn.boost.org/svn/boost/sandbox/SOC/2007/cgi/trunk/boost/cgi/impl/form_parser.ipp > > which will get called for POST params.* > > Although I can't imagine how you're ending up seeing what you're seeing. > Could you provide a minimal compilable file I can try? > > Cheers, > Darren > > * wow I really need to commit this newer code, trunk isn't looking it's > best > I'm afraid. :( > |
From: Darren G. <lis...@go...> - 2011-09-06 00:55:16
|
Hi JC, On 6 September 2011 00:18, <jc...@ol...> wrote: > Hello Darren, > > I am struggling with the following issue. On a linux box with nginx as the > webserver > > on the client's side, I am making the following jquery call: > > function sign_up() > { > $("#sign_up_feedback").html('').hide(); > $.post > ( "/", > { task: 'sign_up', > member_username: > $('#member_username').val(), > member_password: > $('#member_password').val(), > member_password_repeat: > $('#member_password_repeat').val(), > member_first_name: > $('#member_first_name').val(), > member_last_name: > $('#member_last_name').val(), > member_phone: $('#member_phone').val(), > member_email: $('#member_email').val(), > member_corporation_id: > $('#member_corporation_id').val(), > member_unit: $('#member_unit').val(), > member_card_number: > $('#member_card_number').val(), > member_card_expiration: > $('#member_card_expiration').val() > }, > function(data) > { > $("#sign_up_feedback").html(data).show(); > } > ); > } > Look fine. > I have used similar functions, thousands of times but, this time,when I > read the post values server side > using > print_variables_(req.post, "POST"); > with > template<typename Map> > void > print_variables_(Map& m, std::string title) > { > std::ostringstream os; > os << title << "\n"; > if (m.empty()) > { > os << "NONE\n"; > } > else > { > for(typename Map::const_iterator i = m.begin(); i != m.end(); ++i) > { > os << i->first << " = " << i->second << "\n"; > } > } > os << "\n"; > write_to_file("~/log_requests", os.str()); > } > Ok. > member_card_number is truncated to member_card! I looked at the http > headers and the nginx logs and member_card_number is not truncated. > That's odd. Is it just member_card_number that is truncated? Are all of the other parameters ok? > I am very puzzled here as this has never really happened to me. > Where in the source code of the CGI library could I see where the parsing > of the http header is done? > These functions live in: http://svn.boost.org/svn/boost/sandbox/SOC/2007/cgi/trunk/boost/cgi/detail/extract_params.hpp http://svn.boost.org/svn/boost/sandbox/SOC/2007/cgi/trunk/boost/cgi/detail/url_decode.ipp There's also parse_url_encoded_form() in: http://svn.boost.org/svn/boost/sandbox/SOC/2007/cgi/trunk/boost/cgi/impl/form_parser.ipp which will get called for POST params.* Although I can't imagine how you're ending up seeing what you're seeing. Could you provide a minimal compilable file I can try? Cheers, Darren * wow I really need to commit this newer code, trunk isn't looking it's best I'm afraid. :( |
From: <jc...@ol...> - 2011-09-05 23:51:09
|
Hello Darren, I am struggling with the following issue. On a linux box with nginx as the webserver on the client's side, I am making the following jquery call: function sign_up() { $("#sign_up_feedback").html('').hide(); $.post ( "/", { task: 'sign_up', member_username: $('#member_username').val(), member_password: $('#member_password').val(), member_password_repeat: $('#member_password_repeat').val(), member_first_name: $('#member_first_name').val(), member_last_name: $('#member_last_name').val(), member_phone: $('#member_phone').val(), member_email: $('#member_email').val(), member_corporation_id: $('#member_corporation_id').val(), member_unit: $('#member_unit').val(), member_card_number: $('#member_card_number').val(), member_card_expiration: $('#member_card_expiration').val() }, function(data) { $("#sign_up_feedback").html(data).show(); } ); } I have used similar functions, thousands of times but, this time,when I read the post values server side using print_variables_(req.post, "POST"); with template<typename Map> void print_variables_(Map& m, std::string title) { std::ostringstream os; os << title << "\n"; if (m.empty()) { os << "NONE\n"; } else { for(typename Map::const_iterator i = m.begin(); i != m.end(); ++i) { os << i->first << " = " << i->second << "\n"; } } os << "\n"; write_to_file("~/log_requests", os.str()); } member_card_number is truncated to member_card! I looked at the http headers and the nginx logs and member_card_number is not truncated. I am very puzzled here as this has never really happened to me. Where in the source code of the CGI library could I see where the parsing of the http header is done? Thank you very much Jean-Christophe |
From: Darren G. <dar...@gm...> - 2011-05-11 22:25:10
|
Hey JC, Apologies for the late response! On 4 May 2011 14:45, <jc...@ol...> wrote: > Hi Darren, > > > 2) Exposing much more of the basic utility functions used internally; eg. > > url encoding / decoding, parsing request environment / get / post / > > cookies into maps, etc. > This task really is quite important and high-impact for users of the library. Don't underestimate the brownie points available for working on this stuff! Doing this involves moving existing code into the cgi::common namespace, documenting and adding tests for the code. Most likely also involves adding new code that does specific things generically and entirely independently from the rest of the library, for instance taking a QUERY_STRING and putting that into a map< string, string >. If you've got specific questions, feel free to ask off-list. One thing to note is that cpp-netlib has some similar functionality for url encoding / decoding, etc. As it develops, it'll need more functionality that this library uses / needs. We're not here to reinvent wheels, but provide things you can take in isolation, call them wheels and stick them on any vehicle and they'll work (as I'm sure you know). Providing standalone components that could potentially work also for cpp-netlib (or any other library for that matter) is a good goal to aim for. Hopefully this goal gives some personal incentive too, since you'll be providing generally useful components and claim credit for them! > > 4) Complete rewrite of the docs > > > If you want to contribute, points 2 and 4 encompass plenty of low-lying > > fruits that might take your fancy! > > > Sounds good! I am definitely interested in helping for the docs and > writing small examples and tutorials. I am not sure how to proceed from > those good intentions! > Good to hear! The docs are incidentally written in quickbook, a simple enough format. Almost simple enough to deal with without compiling into HTML docs. Quickbook docs available here: http://www.boost.org/doc/libs/1_46_1/doc/html/quickbook.html You may have a bit of trouble installing the toolchain required to build the docs, since the install script provided by Boost doesn't really work. That said, it does say what it's trying to do so I actually use that as a guide for what to download (see BOOST_ROOT/tools/boostbook/setup_boostbook.py). The docs for the toolchain are here: http://www.boost.org/doc/libs/1_46_1/doc/html/boostbook/getting/started.html (short note: after the toolchain is installed then using quickbook, updating and building docs is actually very straight-forward and a pleasure to use!) Don't let that put you off though - I'm not precious about that toolchain whatsoever so if you have a better suggestion put it forward. As for examples and tutorials, they're very welcome. Clearer or more comprehensive versions of the existing tutorials would be very nice as are additional ones demonstrating use. In a library like this one, I think there is a significant benefit in providing lots of examples and then consolidating them later. I personally like skimming library examples to get a feel for it. In particular, interesting examples might be server classes that do some custom dispatching to a bunch of registered handlers based on the path_info() in the request. Another would be a file server. :) As I said, design discussions are best raised on this list so we have a public history, but if you have other questions you can contact me off-list. Good luck! Cheers, Darren |
From: <jc...@ol...> - 2011-05-03 03:13:44
|
Hello, When I set resp << boost::cgi::header("Content-Type","image/jpeg"); it appears that the library adds charset=UTF-8 This seems to be a problem because the jpg is not read properly by the browser and the image looks weird. There might be other reasons my images do not display right, but this might be part of my problem. Maybe the charset should not be set for all binary resources unless the content type is text/text. Thanks! Jean-Christophe |
From: <jc...@ol...> - 2011-04-16 02:35:36
|
Hello Darren, I have just upgrade boost from 1.44 to 1.46.1 and if my program compiles properly, I am getting ERROR‌·(abnormal‌·termination) right after the webserver starts the program Can you confirm that the CGI library works properly with boost 1.46.1? Thank you! Jean-Christophe |
From: <jc...@ol...> - 2011-04-14 14:34:59
|
Hello Darren Thanks for your answer. > The raw buffer is held in: > std::string& raw_post_data = req.post_buffer(); I am unable to get that information. Below is my sample program. With my browser I am getting "test" but if I use echo '<doc><item>Some content.</item></doc>' | curl -X POST -H 'Content-type: text/xml' -d @- http://example... I am getting nothing. the above bash command against a php script does show the raw_post_data/ Do you think the progam is right? I am using nginx with supervisord between the request and the fasctcgi app. Regards Jean-Christophe #include <fstream> #include <string> #include <iostream> #include <exception> #include <boost/cgi/fcgi.hpp> #include <boost/cgi/cgi.hpp> #include <boost/algorithm/string.hpp> template<typename Request, typename Response> int handle_request(Request& req, Response& resp) { try { req.clear(); resp.clear(); req.load(boost::fcgi::parse_all); resp << boost::fcgi::content_type("text/html;charset=ISO-8859-1"); resp << "test"; std::string& raw_post_data = req.post_buffer(); resp << raw_post_data; return commit(req, resp, 0); } catch(std::exception const & e ) { return commit(req, resp, 0); } return commit(req, resp, 0); } int main(int argc, char* argv[]) { int ret = 0; // the return value try { boost::fcgi::service s; boost::fcgi::acceptor a(s); for(;;) { boost::fcgi::request req(s); for (;;) { a.accept(req); boost::fcgi::response resp; ret = handle_request(req, resp); if (ret) { break; } } if (!a.is_open()) break; } } catch(boost::system::system_error const& err) { } catch(std::exception const& err) { } catch(...) { } std::cin.get(); return ret; } > Hi there, > > On 11 April 2011 18:42, <jc...@ol...> wrote: > >> Hello, >> >> I need to receive at an url like example.com/feedback an xml >> that could be sent with something like: >> echo '<doc><item>Some content.</item></doc>' | curl -X POST -H >> 'Content-type: text/xml' -d @- http://example.com/feedback >> >> in php, that xml string is captured by $HTTP_RAW_POST_DATA >> >> in my program, I do something like this for each request >> req.load(boost::fcgi::parse_all); >> but then I am unable to find the xml string >> How should I query req to get that xml? >> > > The raw buffer is held in: > > std::string& raw_post_data = req.post_buffer(); > > I've been using a similar pattern to this recently - ie. XML passed around > with the FastCGI protocol just being used as an efficient protocol... But, > the library lacks the client-side code to make it really useful in this > situation. It'd be good to support this type of use-case better. > > Suggestions in this area are most welcome. > > Cheers, > Darren > |
From: Darren G. <lis...@gm...> - 2011-04-11 18:40:35
|
Hi there, On 11 April 2011 18:42, <jc...@ol...> wrote: > Hello, > > I need to receive at an url like example.com/feedback an xml > that could be sent with something like: > echo '<doc><item>Some content.</item></doc>' | curl -X POST -H > 'Content-type: text/xml' -d @- http://example.com/feedback > > in php, that xml string is captured by $HTTP_RAW_POST_DATA > > in my program, I do something like this for each request > req.load(boost::fcgi::parse_all); > but then I am unable to find the xml string > How should I query req to get that xml? > The raw buffer is held in: std::string& raw_post_data = req.post_buffer(); I've been using a similar pattern to this recently - ie. XML passed around with the FastCGI protocol just being used as an efficient protocol... But, the library lacks the client-side code to make it really useful in this situation. It'd be good to support this type of use-case better. Suggestions in this area are most welcome. Cheers, Darren |
From: <jc...@ol...> - 2011-04-11 18:08:17
|
Hello, I need to receive at an url like example.com/feedback an xml that could be sent with something like: echo '<doc><item>Some content.</item></doc>' | curl -X POST -H 'Content-type: text/xml' -d @- http://example.com/feedback in php, that xml string is captured by $HTTP_RAW_POST_DATA in my program, I do something like this for each request req.load(boost::fcgi::parse_all); but then I am unable to find the xml string How should I query req to get that xml? Thanks JCR |
From: Darren G. <dar...@gm...> - 2011-01-12 02:00:46
|
Hi Jean-Christophe, On 12 January 2011 01:42, <jc...@ol...> wrote: > Hello Darren > > I am still struggling with that issue. I know for sure the problem is the > presence of nul terminators at the two ends of post values. > > I must apologize because I have not yet put together a little program > showing the issue. I really like your library (and I use it) and I would > like to hep you a bit. > > Par of the problem is that I noticed the issue when getting post values > from the upload of file throug nginx and the nginx_upload_module. This > module allows the upload of the file to be done by nginx and, once the > file on the server, the request is transferred from the nginx module to > the fascgi backends. To make it harder to write a small code, I was also > using plupload on the client side to manage the upload od several files at > the same time. > I have a little function that cleans the null terminators from every post > value that is used by my program, which solves the consequences of the > problem but is not a satisfactory solution. > > Let me revisit the issue and produce something useful to track the issue. Thanks for looking into this. I've only done very cursory testing with nginx so far, but since that's quite a slick server I'd very much like to support it* without users like yourself needing any hacks. Is it possible that the server is sending extra data to the FastCGI backend and expecting the script to check some meta-data in the form data? Just a stab in the dark really. If you are able to get the complete POST'd data from request.post_data(), dump it to a file and send me it (off-list if you prefer) I can take a look at it. Sorry I can't help more. Cheers, Darren * There were rumours of a multiplexing FastCGI module for nginx, which would be very very nice to get my hands on, if that ever surfaces. |
From: <jc...@ol...> - 2011-01-12 01:43:02
|
Hello Darren I am still struggling with that issue. I know for sure the problem is the presence of nul terminators at the two ends of post values. I must apologize because I have not yet put together a little program showing the issue. I really like your library (and I use it) and I would like to hep you a bit. Par of the problem is that I noticed the issue when getting post values from the upload of file throug nginx and the nginx_upload_module. This module allows the upload of the file to be done by nginx and, once the file on the server, the request is transferred from the nginx module to the fascgi backends. To make it harder to write a small code, I was also using plupload on the client side to manage the upload od several files at the same time. I have a little function that cleans the null terminators from every post value that is used by my program, which solves the consequences of the problem but is not a satisfactory solution. Let me revisit the issue and produce something useful to track the issue. Thanks again Jean-Christophe 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-12 01:38:27
|
Hi Josep, On 28 December 2010 00:34, Josep M. <jm...@gm...> wrote: > 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 > The library is header-only by default so you only need to include the headers you need. Probably: #include <boost/cgi/cgi.hpp> #include <boost/cgi/fcgi.hpp> #include <boost/cgi/scgi.hpp> There is installation instructions, as much as you need them at: <http://cgi.sourceforge.net/docs/fastcgi___cgi/tutorial/running.html> http://cgi.sourceforge.net/docs/fastcgi___cgi/tutorial/installation.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 > No problem. Boost.Build / bjam are the standard Boost installation tools. As it stands, as long as you have Boost installed, you can just add the headers you need, link to Boost.System, Boost.Regex, Boost.Date_time and Boost.Filesystem and you're off. On Windows that linking should be automatic. The Jamfile at libs/cgi/build/Jamfile.v2 is provided to set up the required dependencies. You should be able to grok from that what you need to pass to your compiler of choice. If there is enough traction I wouldn't be adverse to providing another type of installation mechanism. Cheers, Darren |
From: <jc...@ol...> - 2011-01-12 01:31:50
|
Hello Darren Thank you for your answer; it works perfectly! Jean-Christophe > 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 > |