cppcms-users Mailing List for CppCMS C++ Web Framework (Page 136)
Brought to you by:
artyom-beilis
You can subscribe to this list here.
2009 |
Jan
|
Feb
(22) |
Mar
|
Apr
(3) |
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
(16) |
Dec
(13) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(4) |
Feb
|
Mar
(8) |
Apr
(8) |
May
(8) |
Jun
(36) |
Jul
(63) |
Aug
(126) |
Sep
(47) |
Oct
(66) |
Nov
(46) |
Dec
(42) |
2011 |
Jan
(87) |
Feb
(24) |
Mar
(54) |
Apr
(21) |
May
(22) |
Jun
(18) |
Jul
(22) |
Aug
(101) |
Sep
(57) |
Oct
(33) |
Nov
(34) |
Dec
(66) |
2012 |
Jan
(64) |
Feb
(76) |
Mar
(73) |
Apr
(105) |
May
(93) |
Jun
(83) |
Jul
(84) |
Aug
(88) |
Sep
(57) |
Oct
(59) |
Nov
(35) |
Dec
(49) |
2013 |
Jan
(67) |
Feb
(17) |
Mar
(49) |
Apr
(64) |
May
(87) |
Jun
(64) |
Jul
(93) |
Aug
(23) |
Sep
(15) |
Oct
(16) |
Nov
(62) |
Dec
(73) |
2014 |
Jan
(5) |
Feb
(23) |
Mar
(21) |
Apr
(11) |
May
(1) |
Jun
(19) |
Jul
(27) |
Aug
(16) |
Sep
(5) |
Oct
(37) |
Nov
(12) |
Dec
(9) |
2015 |
Jan
(7) |
Feb
(7) |
Mar
(44) |
Apr
(28) |
May
(5) |
Jun
(12) |
Jul
(8) |
Aug
|
Sep
(39) |
Oct
(34) |
Nov
(30) |
Dec
(34) |
2016 |
Jan
(66) |
Feb
(23) |
Mar
(33) |
Apr
(15) |
May
(11) |
Jun
(15) |
Jul
(26) |
Aug
(4) |
Sep
(1) |
Oct
(30) |
Nov
(10) |
Dec
|
2017 |
Jan
(52) |
Feb
(9) |
Mar
(24) |
Apr
(16) |
May
(9) |
Jun
(12) |
Jul
(33) |
Aug
(8) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
(6) |
2018 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
(14) |
Jun
(1) |
Jul
(9) |
Aug
(1) |
Sep
(13) |
Oct
(8) |
Nov
(2) |
Dec
(2) |
2019 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2020 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(9) |
Jul
(6) |
Aug
(25) |
Sep
(10) |
Oct
(10) |
Nov
(6) |
Dec
|
2021 |
Jan
|
Feb
|
Mar
(7) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(9) |
Oct
(1) |
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Artyom <art...@ya...> - 2010-07-14 04:08:39
|
> > You have several options: > > > > 1. Simplest define environment variable > > > > export LD_LIBRARY_PATH=/usr/local/lib > > > > 2. Install CppCMS with prexix /usr (cmake -DCMAKE_INSTALL_PREFIX=/usr) > > > > > > (On Linux path for executables and shared libraries is different) > > > > Thank you Artyom, It works! > > I've added a small note in the wiki: > http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_build > This is not really correct, each user should decide where to install libraries, he may even want to install them to /opt/cppcms so he can easily remove them afterwards. Only packagers generally install to `/usr`. So I rolled back changed and added this to troubleshooting page with description of the issue so user can fix it even if library is installed into hist home directory. Generally most users that used any compiled library at least one know how to solve this issue/ Also the issue is common for every ELF platform like BSD, Solaris or Linux. > The people who will join this project and use cppcms will have varying degrees > > of experience. I obviously belong to the least experienced as far as compiling > > stuff is concerned, and I am sure that the extra information will help future > users. It'll save you time in the long run, because you won't have to answer > the same question twice. I agree, there lots of questions lately so updated FAQ is very useful! > > A bit about myself: I am an experienced web application developer. I have been > > programming in PHP for 10 years. I have professionally developed Drupal > modules and I know Drupal well (and that's precisely why I am interested in > cppcms!! ;) Drupal is a hog and performance is always an issue!) Your inputs would be more then wellcome. > > However, I have no experience at all with C++. The few times I have had to > compile stuff for my linux desktop computer, I simply followed blindly without > > understanding the instructions given with the software. > > Thus, it is often the simple things that seem obvious to you that I get stuck > with. I wish your project to be very successful and others like me are bound > to come, so documenting a bit more cannot hurt, I think. > CppCMS 0.99.1 is on beta stages so documentation is far from being complete, but it will be much better when the stable version will be released. > Since I am not (yet) a great C++ developer, the least I can do is help with > the wiki. This would be very useful, thanks, especially inputs from experienced web developer point of view - somebody who codes from other world. Regards, Artyom |
From: augustin <aug...@ov...> - 2010-07-14 03:09:40
|
On Tuesday 13 July 2010 05:25:29 pm Artyom wrote: > You have several options: > > 1. Simplest define environment variable > > export LD_LIBRARY_PATH=/usr/local/lib > > 2. Install CppCMS with prexix /usr (cmake -DCMAKE_INSTALL_PREFIX=/usr) > > > (On Linux path for executables and shared libraries is different) > Thank you Artyom, It works! I've added a small note in the wiki: http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_build You are right to say it's not a cppcms specific problem. Still, some of the other info I added to wiki are not cppcms specific either, for example: how to find which process is blocking port 8080/1. The people who will join this project and use cppcms will have varying degrees of experience. I obviously belong to the least experienced as far as compiling stuff is concerned, and I am sure that the extra information will help future users. It'll save you time in the long run, because you won't have to answer the same question twice. A bit about myself: I am an experienced web application developer. I have been programming in PHP for 10 years. I have professionally developed Drupal modules and I know Drupal well (and that's precisely why I am interested in cppcms!! ;) Drupal is a hog and performance is always an issue!) However, I have no experience at all with C++. The few times I have had to compile stuff for my linux desktop computer, I simply followed blindly without understanding the instructions given with the software. Thus, it is often the simple things that seem obvious to you that I get stuck with. I wish your project to be very successful and others like me are bound to come, so documenting a bit more cannot hurt, I think. As I said, I am a C++ complete newbie, and this will be obvious in some of the questions I may ask in the future. But I am a quick learner. I am spending some time reading and learning from C++ tutorials and manuals available on the web. Artyom, I want to thank you again: I appreciate your making this tool available to us, and I doubly appreciate the speed with which you answer every question on the mailing list. Since I am not (yet) a great C++ developer, the least I can do is help with the wiki. Blessings, Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |
From: Artyom <art...@ya...> - 2010-07-13 21:29:45
|
Hello, > > hey, > > i switched to the beta. however the problem with the missing response > headers persist. so please notify me when you commit changes that should > address this. meanwhile i try to live without response headers. Ok. I cleaup the synchronous and asynchronous request handling added test cases for both, now it looks fine, including sending 404 in case of unmapped url. Hopefully no more surprises are expected. One important change in behavior had added: - if the application do not releases asynchronous request before exiting main function, it is automatically finalized and closed, so if you want to postpone response, don't forget to call release_context(). - it is no more required to call response().finalized() function as async_complete_response() does all job. Thanks for the issue report, Artyom |
From: Frank E. <fra...@an...> - 2010-07-13 19:19:19
|
hey, i switched to the beta. however the problem with the missing response headers persist. so please notify me when you commit changes that should address this. meanwhile i try to live without response headers. cheers frank Am 13.07.2010 21:02, schrieb Artyom: > Hello, > > There had been some restructuring in the internal handling of requests and > responses > and looks like something is messed up. Looks like there are more then few bugs > need to be fixed > connected to all this. > > Hopefully tomorrow I'll be able to commit fixes and cleanup the mess, > > Meanwhile I'll recommend to stick with released beta version, which comes before > numerous updates that messed many things up or wait a little. > > The code below and the previous code you send should work with released beta > version > and they fail in svn. I'll update you as soon as I fix this issues in the svn. > > Thanks for points you had bring up. > > Artyom > > > > > ----- Original Message ---- >> From: Frank Enderle <fra...@an...> >> To: cpp...@li... >> Sent: Tue, July 13, 2010 9:20:10 PM >> Subject: [Cppcms-users] async connections and response headers >> >> hi, >> >> i have an async application: >> >> class Test : public cppcms::application { >> public: >> Test(cppcms::service &srv) >> : cppcms::application(srv) { >> dispatcher().assign("^/test", &Test::test, this); >> } >> >> void main(std::string url) { >> if(!dispatcher().dispatch(url)) { >> response().status(404); >> response().finalize(); >> release_context()->async_complete_response(); >> } >> } >> >> void test() { >> response().set_content_header("text/plain"); >> response().out() << "test"; >> response().finalize(); >> release_context()->async_complete_response(); >> } >> }; >> >> int main(int argc, char *argv[]) { >> try { >> cppcms::service srv(argc, argv); >> booster::intrusive_ptr<Test> app = new Test(srv); >> srv.applications_pool().mount(app, cppcms::mount_point("test")); >> srv.run(); >> } catch(std::exception const &e) { >> std::cerr << e.what() << std::endl; >> } >> } >> >> if i start the application using scgi behind nginx and i call >> http://.../test/test i get the expected 'test' string in the browser, >> but the application sends nothing else (i.e. no response headers) and >> the nginx log emits the following: >> >> upstream sent neither valid HTTP/1.0 header nor "Status" header line >> while reading response header from upstream >> >> whats wrong here? >> >> thanks, >> >> frank >> >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users -- Dipl.-Ing. (FH) Frank Enderle anamica UG (haftungsbeschränkt) Beinsteinerstr. 6 71334 Waiblingen Telefon: +49 151 14981091 Telefax: +49 7151 1335770 E-Mail: fra...@an... Internet: www.anamica.de Handelsregister: AG Stuttgart HRB 732357 Geschäftsführer: Yvonne Holzwarth, Frank Enderle |
From: Artyom <art...@ya...> - 2010-07-13 19:02:45
|
Hello, There had been some restructuring in the internal handling of requests and responses and looks like something is messed up. Looks like there are more then few bugs need to be fixed connected to all this. Hopefully tomorrow I'll be able to commit fixes and cleanup the mess, Meanwhile I'll recommend to stick with released beta version, which comes before numerous updates that messed many things up or wait a little. The code below and the previous code you send should work with released beta version and they fail in svn. I'll update you as soon as I fix this issues in the svn. Thanks for points you had bring up. Artyom ----- Original Message ---- > From: Frank Enderle <fra...@an...> > To: cpp...@li... > Sent: Tue, July 13, 2010 9:20:10 PM > Subject: [Cppcms-users] async connections and response headers > > hi, > > i have an async application: > > class Test : public cppcms::application { > public: > Test(cppcms::service &srv) > : cppcms::application(srv) { > dispatcher().assign("^/test", &Test::test, this); > } > > void main(std::string url) { > if(!dispatcher().dispatch(url)) { > response().status(404); > response().finalize(); > release_context()->async_complete_response(); > } > } > > void test() { > response().set_content_header("text/plain"); > response().out() << "test"; > response().finalize(); > release_context()->async_complete_response(); > } > }; > > int main(int argc, char *argv[]) { > try { > cppcms::service srv(argc, argv); > booster::intrusive_ptr<Test> app = new Test(srv); > srv.applications_pool().mount(app, cppcms::mount_point("test")); > srv.run(); > } catch(std::exception const &e) { > std::cerr << e.what() << std::endl; > } > } > > if i start the application using scgi behind nginx and i call > http://.../test/test i get the expected 'test' string in the browser, > but the application sends nothing else (i.e. no response headers) and > the nginx log emits the following: > > upstream sent neither valid HTTP/1.0 header nor "Status" header line > while reading response header from upstream > > whats wrong here? > > thanks, > > frank > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Frank E. <fra...@an...> - 2010-07-13 18:20:20
|
hi, i have an async application: class Test : public cppcms::application { public: Test(cppcms::service &srv) : cppcms::application(srv) { dispatcher().assign("^/test", &Test::test, this); } void main(std::string url) { if(!dispatcher().dispatch(url)) { response().status(404); response().finalize(); release_context()->async_complete_response(); } } void test() { response().set_content_header("text/plain"); response().out() << "test"; response().finalize(); release_context()->async_complete_response(); } }; int main(int argc, char *argv[]) { try { cppcms::service srv(argc, argv); booster::intrusive_ptr<Test> app = new Test(srv); srv.applications_pool().mount(app, cppcms::mount_point("test")); srv.run(); } catch(std::exception const &e) { std::cerr << e.what() << std::endl; } } if i start the application using scgi behind nginx and i call http://.../test/test i get the expected 'test' string in the browser, but the application sends nothing else (i.e. no response headers) and the nginx log emits the following: upstream sent neither valid HTTP/1.0 header nor "Status" header line while reading response header from upstream whats wrong here? thanks, frank |
From: Frank E. <fra...@an...> - 2010-07-13 16:38:47
|
hi, something else came up. when i use the dispatcher in an async class and a url is requested which is not handled the default main() method in the application class does not handle async connections properly. there's no finalize/async_complete_response and thus giving a 502 bad gateway response instead of 404. i guess the default main method should handle async connections in addition to sync connections. frank. -- Dipl.-Ing. (FH) Frank Enderle anamica UG (haftungsbeschränkt) Beinsteinerstr. 6 71334 Waiblingen Telefon: +49 151 14981091 Telefax: +49 7151 1335770 E-Mail: fra...@an... Internet: www.anamica.de Handelsregister: AG Stuttgart HRB 732357 Geschäftsführer: Yvonne Holzwarth, Frank Enderle |
From: Frank E. <fra...@an...> - 2010-07-13 15:05:47
|
hi, the exception is now gone. thanks. frank. Am 13.07.2010 17:00, schrieb Artyom: > Hello, > > Ok, there was a bug, fixed in changeset 1315, take update from svn. > Now should work. It happened after some code re-factoring that was done > recently. > > Artyom > > > > >> From: Frank Enderle <fra...@an...> >> >> hi, >> >> i added the finalize calls. >> >> - i use cppcms from svn (revision 1314) >> - it happens when i try to access the url for postMessage or >> consumeMessage using chrome (or i guess any other browser) >> >> the application runs in scgi mode behind nginx. could this be the problem? >> >> frank. >> >> Am 13.07.2010 15:59, schrieb Artyom: >>> Hi, >>> >>> I've tested your code and it mostly works. >>> >>> Also I don't see any "Access to unassigned context" errors >>> >>> The only problem is that you need to add "response().finalize();" before >> calling >>> async_complete_response() in case you do not write anything to output (i.e. >> not >> >>> accessed to out()) >>> >>> I've updated the blog post. >>> >>> About unassigned context >>> >>> - what version of CppCMS are you using. >>> - In what case it happens (which URL is accessed and in what method)? >>> >>> This exception is thrown in case you try to use any request/response related >> >>> information >>> after calling release_context(), do you call any functions after >>> release_context() >>> In what location the exception is thrown? >>> >>> Artyom >>> >>> See where to add finalize() in the code below. >>> >>> >>>> >>>> i try to build the example from the blogpost >>>> >>>> http://art-blog.no-ip.info/cppcms/blog/post/47 >>>> >>>> and i'm kind of stuck. the example seems not to be really compatible >>>> with the current cppcms version. i adapted the source as follows: >>>> >>>> class lpTest : public cppcms::application { >>>> public: >>>> lpTest(cppcms::service &srv) : >>>> cppcms::application(srv) { >>>> >>>> dispatcher().assign("^/postMessage$", >>>> &lpTest::postMessage, this); >>>> dispatcher().assign("^/consumeMessage/(\\d+)$", >>>> &lpTest::consumeMessage, this, 1); >>>> } >>>> >>>> void postMessage() { >>>> if(request().request_method() == "POST") { >>>> if(request().post().find("message") != request().post().end()) { >>>> messages.push_back(request().post().find("message")->second); >>>> broadcast(); >>>> } >>>> } >>>> >>> >>> NEED response().finalize() THERE >>> >>>> release_context()->async_complete_response(); >>>> } >>>> >>>> void consumeMessage(std::string id) { >>>> unsigned pos = atoi(id.c_str()); >>>> >>>> if(pos < messages.size()) { >>>> response().set_plain_text_header(); >>>> response().out() << messages[pos]; >>>> release_context()->async_complete_response(); >>>> } else if(pos == messages.size()) { >>>> waiters.push_back(release_context()); >>>> } else { >>>> response().status(404); >>> >>> NEED response().finalize() THERE >>> >>>> release_context()->async_complete_response(); >>>> } >>>> } >>>> >>>> void broadcast() { >>>> // send the message to all waiters >>>> for(unsigned i=0; i<waiters.size(); i++) { >>>> waiters[i]->response().set_plain_text_header(); >>>> waiters[i]->response().out() << messages.back(); >>>> waiters[i]->async_complete_response(); >>>> } >>>> >>>> waiters.clear(); >>>> } >>>> >>>> private: >>>> std::vector<std::string> messages; >>>> std::vector<booster::shared_ptr<cppcms::http::context> > waiters; >>>> }; >>>> >>>> and for main: >>>> >>>> cppcms::service srv(argc, argv); >>>> booster::intrusive_ptr<lpTest> app = new lpTest(srv); >>>> srv.applications_pool().mount(app); >>>> srv.run(); >>>> >>>> as far as i understand this should work. my problem is that if i start >>>> the application and do a request it gives me the following exception: >>>> >>>> Catched excepion [Access to unassigned context] >> (.../http_context.cpp:144) >>>> >>>> it seems like the framework tries to do something with the context >>>> though it has been released by release_context() - what am i missing? >>>> >>>> frank >>>> >>>> >>>> >> ------------------------------------------------------------------------------ >>>> This SF.net email is sponsored by Sprint >>>> What will you do first with EVO, the first 4G phone? >>>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >>>> _______________________________________________ >>>> Cppcms-users mailing list >>>> Cpp...@li... >>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>>> >>> >>> >>> >>> >>> >> ------------------------------------------------------------------------------ >>> This SF.net email is sponsored by Sprint >>> What will you do first with EVO, the first 4G phone? >>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >>> _______________________________________________ >>> Cppcms-users mailing list >>> Cpp...@li... >>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> >> -- >> Dipl.-Ing. (FH) Frank Enderle >> >> anamica UG (haftungsbeschränkt) >> Beinsteinerstr. 6 >> 71334 Waiblingen >> >> Telefon: +49 151 14981091 >> Telefax: +49 7151 1335770 >> E-Mail: fra...@an... >> Internet: www.anamica.de >> >> Handelsregister: AG Stuttgart HRB 732357 >> Geschäftsführer: Yvonne Holzwarth, Frank Enderle >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users -- Dipl.-Ing. (FH) Frank Enderle anamica UG (haftungsbeschränkt) Beinsteinerstr. 6 71334 Waiblingen Telefon: +49 151 14981091 Telefax: +49 7151 1335770 E-Mail: fra...@an... Internet: www.anamica.de Handelsregister: AG Stuttgart HRB 732357 Geschäftsführer: Yvonne Holzwarth, Frank Enderle |
From: Artyom <art...@ya...> - 2010-07-13 15:01:10
|
Hello, Ok, there was a bug, fixed in changeset 1315, take update from svn. Now should work. It happened after some code re-factoring that was done recently. Artyom > From: Frank Enderle <fra...@an...> > > hi, > > i added the finalize calls. > > - i use cppcms from svn (revision 1314) > - it happens when i try to access the url for postMessage or > consumeMessage using chrome (or i guess any other browser) > > the application runs in scgi mode behind nginx. could this be the problem? > > frank. > > Am 13.07.2010 15:59, schrieb Artyom: > > Hi, > > > > I've tested your code and it mostly works. > > > > Also I don't see any "Access to unassigned context" errors > > > > The only problem is that you need to add "response().finalize();" before >calling > > async_complete_response() in case you do not write anything to output (i.e. >not > > > accessed to out()) > > > > I've updated the blog post. > > > > About unassigned context > > > > - what version of CppCMS are you using. > > - In what case it happens (which URL is accessed and in what method)? > > > > This exception is thrown in case you try to use any request/response related > > > information > > after calling release_context(), do you call any functions after > > release_context() > > In what location the exception is thrown? > > > > Artyom > > > > See where to add finalize() in the code below. > > > > > >> > >> i try to build the example from the blogpost > >> > >> http://art-blog.no-ip.info/cppcms/blog/post/47 > >> > >> and i'm kind of stuck. the example seems not to be really compatible > >> with the current cppcms version. i adapted the source as follows: > >> > >> class lpTest : public cppcms::application { > >> public: > >> lpTest(cppcms::service &srv) : > >> cppcms::application(srv) { > >> > >> dispatcher().assign("^/postMessage$", > >> &lpTest::postMessage, this); > >> dispatcher().assign("^/consumeMessage/(\\d+)$", > >> &lpTest::consumeMessage, this, 1); > >> } > >> > >> void postMessage() { > >> if(request().request_method() == "POST") { > >> if(request().post().find("message") != request().post().end()) { > >> messages.push_back(request().post().find("message")->second); > >> broadcast(); > >> } > >> } > >> > > > > NEED response().finalize() THERE > > > >> release_context()->async_complete_response(); > >> } > >> > >> void consumeMessage(std::string id) { > >> unsigned pos = atoi(id.c_str()); > >> > >> if(pos < messages.size()) { > >> response().set_plain_text_header(); > >> response().out() << messages[pos]; > >> release_context()->async_complete_response(); > >> } else if(pos == messages.size()) { > >> waiters.push_back(release_context()); > >> } else { > >> response().status(404); > > > > NEED response().finalize() THERE > > > >> release_context()->async_complete_response(); > >> } > >> } > >> > >> void broadcast() { > >> // send the message to all waiters > >> for(unsigned i=0; i<waiters.size(); i++) { > >> waiters[i]->response().set_plain_text_header(); > >> waiters[i]->response().out() << messages.back(); > >> waiters[i]->async_complete_response(); > >> } > >> > >> waiters.clear(); > >> } > >> > >> private: > >> std::vector<std::string> messages; > >> std::vector<booster::shared_ptr<cppcms::http::context> > waiters; > >> }; > >> > >> and for main: > >> > >> cppcms::service srv(argc, argv); > >> booster::intrusive_ptr<lpTest> app = new lpTest(srv); > >> srv.applications_pool().mount(app); > >> srv.run(); > >> > >> as far as i understand this should work. my problem is that if i start > >> the application and do a request it gives me the following exception: > >> > >> Catched excepion [Access to unassigned context] >(.../http_context.cpp:144) > >> > >> it seems like the framework tries to do something with the context > >> though it has been released by release_context() - what am i missing? > >> > >> frank > >> > >> > >> >------------------------------------------------------------------------------ > >> This SF.net email is sponsored by Sprint > >> What will you do first with EVO, the first 4G phone? > >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > >> _______________________________________________ > >> Cppcms-users mailing list > >> Cpp...@li... > >> https://lists.sourceforge.net/lists/listinfo/cppcms-users > >> > > > > > > > > > > >------------------------------------------------------------------------------ > > This SF.net email is sponsored by Sprint > > What will you do first with EVO, the first 4G phone? > > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > > _______________________________________________ > > Cppcms-users mailing list > > Cpp...@li... > > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > -- > Dipl.-Ing. (FH) Frank Enderle > > anamica UG (haftungsbeschränkt) > Beinsteinerstr. 6 > 71334 Waiblingen > > Telefon: +49 151 14981091 > Telefax: +49 7151 1335770 > E-Mail: fra...@an... > Internet: www.anamica.de > > Handelsregister: AG Stuttgart HRB 732357 > Geschäftsführer: Yvonne Holzwarth, Frank Enderle > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Frank E. <fra...@an...> - 2010-07-13 14:16:33
|
hi, i added the finalize calls. - i use cppcms from svn (revision 1314) - it happens when i try to access the url for postMessage or consumeMessage using chrome (or i guess any other browser) the application runs in scgi mode behind nginx. could this be the problem? frank. Am 13.07.2010 15:59, schrieb Artyom: > Hi, > > I've tested your code and it mostly works. > > Also I don't see any "Access to unassigned context" errors > > The only problem is that you need to add "response().finalize();" before calling > async_complete_response() in case you do not write anything to output (i.e. not > accessed to out()) > > I've updated the blog post. > > About unassigned context > > - what version of CppCMS are you using. > - In what case it happens (which URL is accessed and in what method)? > > This exception is thrown in case you try to use any request/response related > information > after calling release_context(), do you call any functions after > release_context() > In what location the exception is thrown? > > Artyom > > See where to add finalize() in the code below. > > >> >> i try to build the example from the blogpost >> >> http://art-blog.no-ip.info/cppcms/blog/post/47 >> >> and i'm kind of stuck. the example seems not to be really compatible >> with the current cppcms version. i adapted the source as follows: >> >> class lpTest : public cppcms::application { >> public: >> lpTest(cppcms::service &srv) : >> cppcms::application(srv) { >> >> dispatcher().assign("^/postMessage$", >> &lpTest::postMessage, this); >> dispatcher().assign("^/consumeMessage/(\\d+)$", >> &lpTest::consumeMessage, this, 1); >> } >> >> void postMessage() { >> if(request().request_method() == "POST") { >> if(request().post().find("message") != request().post().end()) { >> messages.push_back(request().post().find("message")->second); >> broadcast(); >> } >> } >> > > NEED response().finalize() THERE > >> release_context()->async_complete_response(); >> } >> >> void consumeMessage(std::string id) { >> unsigned pos = atoi(id.c_str()); >> >> if(pos < messages.size()) { >> response().set_plain_text_header(); >> response().out() << messages[pos]; >> release_context()->async_complete_response(); >> } else if(pos == messages.size()) { >> waiters.push_back(release_context()); >> } else { >> response().status(404); > > NEED response().finalize() THERE > >> release_context()->async_complete_response(); >> } >> } >> >> void broadcast() { >> // send the message to all waiters >> for(unsigned i=0; i<waiters.size(); i++) { >> waiters[i]->response().set_plain_text_header(); >> waiters[i]->response().out() << messages.back(); >> waiters[i]->async_complete_response(); >> } >> >> waiters.clear(); >> } >> >> private: >> std::vector<std::string> messages; >> std::vector<booster::shared_ptr<cppcms::http::context> > waiters; >> }; >> >> and for main: >> >> cppcms::service srv(argc, argv); >> booster::intrusive_ptr<lpTest> app = new lpTest(srv); >> srv.applications_pool().mount(app); >> srv.run(); >> >> as far as i understand this should work. my problem is that if i start >> the application and do a request it gives me the following exception: >> >> Catched excepion [Access to unassigned context] (.../http_context.cpp:144) >> >> it seems like the framework tries to do something with the context >> though it has been released by release_context() - what am i missing? >> >> frank >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users -- Dipl.-Ing. (FH) Frank Enderle anamica UG (haftungsbeschränkt) Beinsteinerstr. 6 71334 Waiblingen Telefon: +49 151 14981091 Telefax: +49 7151 1335770 E-Mail: fra...@an... Internet: www.anamica.de Handelsregister: AG Stuttgart HRB 732357 Geschäftsführer: Yvonne Holzwarth, Frank Enderle |
From: Artyom <art...@ya...> - 2010-07-13 13:59:37
|
Hi, I've tested your code and it mostly works. Also I don't see any "Access to unassigned context" errors The only problem is that you need to add "response().finalize();" before calling async_complete_response() in case you do not write anything to output (i.e. not accessed to out()) I've updated the blog post. About unassigned context - what version of CppCMS are you using. - In what case it happens (which URL is accessed and in what method)? This exception is thrown in case you try to use any request/response related information after calling release_context(), do you call any functions after release_context() In what location the exception is thrown? Artyom See where to add finalize() in the code below. > > i try to build the example from the blogpost > > http://art-blog.no-ip.info/cppcms/blog/post/47 > > and i'm kind of stuck. the example seems not to be really compatible > with the current cppcms version. i adapted the source as follows: > > class lpTest : public cppcms::application { > public: > lpTest(cppcms::service &srv) : > cppcms::application(srv) { > > dispatcher().assign("^/postMessage$", > &lpTest::postMessage, this); > dispatcher().assign("^/consumeMessage/(\\d+)$", > &lpTest::consumeMessage, this, 1); > } > > void postMessage() { > if(request().request_method() == "POST") { > if(request().post().find("message") != request().post().end()) { > messages.push_back(request().post().find("message")->second); > broadcast(); > } > } > NEED response().finalize() THERE > release_context()->async_complete_response(); > } > > void consumeMessage(std::string id) { > unsigned pos = atoi(id.c_str()); > > if(pos < messages.size()) { > response().set_plain_text_header(); > response().out() << messages[pos]; > release_context()->async_complete_response(); > } else if(pos == messages.size()) { > waiters.push_back(release_context()); > } else { > response().status(404); NEED response().finalize() THERE > release_context()->async_complete_response(); > } > } > > void broadcast() { > // send the message to all waiters > for(unsigned i=0; i<waiters.size(); i++) { > waiters[i]->response().set_plain_text_header(); > waiters[i]->response().out() << messages.back(); > waiters[i]->async_complete_response(); > } > > waiters.clear(); > } > > private: > std::vector<std::string> messages; > std::vector<booster::shared_ptr<cppcms::http::context> > waiters; > }; > > and for main: > > cppcms::service srv(argc, argv); > booster::intrusive_ptr<lpTest> app = new lpTest(srv); > srv.applications_pool().mount(app); > srv.run(); > > as far as i understand this should work. my problem is that if i start > the application and do a request it gives me the following exception: > > Catched excepion [Access to unassigned context] (.../http_context.cpp:144) > > it seems like the framework tries to do something with the context > though it has been released by release_context() - what am i missing? > > frank > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Frank E. <fra...@an...> - 2010-07-13 13:19:49
|
hi, i try to build the example from the blogpost http://art-blog.no-ip.info/cppcms/blog/post/47 and i'm kind of stuck. the example seems not to be really compatible with the current cppcms version. i adapted the source as follows: class lpTest : public cppcms::application { public: lpTest(cppcms::service &srv) : cppcms::application(srv) { dispatcher().assign("^/postMessage$", &lpTest::postMessage, this); dispatcher().assign("^/consumeMessage/(\\d+)$", &lpTest::consumeMessage, this, 1); } void postMessage() { if(request().request_method() == "POST") { if(request().post().find("message") != request().post().end()) { messages.push_back(request().post().find("message")->second); broadcast(); } } release_context()->async_complete_response(); } void consumeMessage(std::string id) { unsigned pos = atoi(id.c_str()); if(pos < messages.size()) { response().set_plain_text_header(); response().out() << messages[pos]; release_context()->async_complete_response(); } else if(pos == messages.size()) { waiters.push_back(release_context()); } else { response().status(404); release_context()->async_complete_response(); } } void broadcast() { // send the message to all waiters for(unsigned i=0; i<waiters.size(); i++) { waiters[i]->response().set_plain_text_header(); waiters[i]->response().out() << messages.back(); waiters[i]->async_complete_response(); } waiters.clear(); } private: std::vector<std::string> messages; std::vector<booster::shared_ptr<cppcms::http::context> > waiters; }; and for main: cppcms::service srv(argc, argv); booster::intrusive_ptr<lpTest> app = new lpTest(srv); srv.applications_pool().mount(app); srv.run(); as far as i understand this should work. my problem is that if i start the application and do a request it gives me the following exception: Catched excepion [Access to unassigned context] (.../http_context.cpp:144) it seems like the framework tries to do something with the context though it has been released by release_context() - what am i missing? frank |
From: Artyom <art...@ya...> - 2010-07-13 09:25:36
|
You have several options: 1. Simplest define environment variable export LD_LIBRARY_PATH=/usr/local/lib 2. Install CppCMS with prexix /usr (cmake -DCMAKE_INSTALL_PREFIX=/usr) (On Linux path for executables and shared libraries is different) 3. Update system configuration so it would search in /usr/local/lib for libraries. In /etc/ld.so.conf and rerun ldconfig READ man of ldconfig CAREFULLY!!! This is something related to installation of general libraries from sources and not something CppCMS specific. Artyom ----- Original Message ---- > > At first, I thought it was a PATH problem, but it doesn't seem to be so: > > $ echo $PATH >/usr/local/bin:/home/overshoot/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/overshoot/bin:/home/overshoot/bin >n > > |
From: augustin <aug...@ov...> - 2010-07-13 08:51:53
|
Hello again, Thanks to your help, I finally could complete make test and make install successfully. Install the project... -- Install configuration: "RelWithDebInfo" -- Installing: /usr/local/lib/libcppcms.so.1.0.0 -- Installing: /usr/local/lib/libcppcms.so.1 -- Installing: /usr/local/lib/libcppcms.so -- Removed runtime path from "/usr/local/lib/libcppcms.so.1.0.0" But when following the "hello world" tutorial, I get: $ ./hello -c config.js ./hello: error while loading shared libraries: libcppcms.so.1: cannot open shared object file: No such file or directory $ ls -l /usr/local/lib/libcppcms.* /usr/local/lib/libcppcms.a /usr/local/lib/libcppcms.so -> libcppcms.so.1 /usr/local/lib/libcppcms.so.1 -> libcppcms.so.1.0.0 /usr/local/lib/libcppcms.so.1.0.0 At first, I thought it was a PATH problem, but it doesn't seem to be so: $ echo $PATH /usr/local/bin:/home/overshoot/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/overshoot/bin:/home/overshoot/bin Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |
From: augustin <aug...@ov...> - 2010-07-13 08:23:28
|
On Tuesday 13 July 2010 03:04:38 pm Artyom wrote: > Do you have anything that listens on 8081 as well? (forwarder uses also > 8081) LOL! After a bit of searching, I found out that the application listening on port 8080 was ktorrent's web panel. So, I simply incremented ktorrent's port setting to 8081 not knowing it was also required. Now that both ports are available, test 10 and 11 are all ok. 100% tests passed, 0 tests failed out of 46 Thanks a lot for your help so far... I am going to follow the "Hello World" tutorial... my next questions might be about Apache and server configuration... I'll see. Blessings, Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |
From: augustin <aug...@ov...> - 2010-07-13 08:10:51
|
On Tuesday 13 July 2010 03:14:16 pm Artyom wrote: > Actually this is good idea I was thinking about something like that as well > - troubleshooting. > http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_build_troubleshooting Great :) I haven't started using cppcms yet, but I have learned quite a few things, already. I added everything I learned in the above page: Missing dependencies: -------------------------------- one of the most difficult task I find when trying to compile anything, is trying to figure out what are the exact packages I am supposed to install. During my first cmake .. try, I noticed a failed PCRE dependency, and struggled a bit to figure out which package to install. I finally installed libpcre3-dev libpcrecpp0 and after that cmake completed properly. I think it'd be very user (developer) friendly if we list the names of known packages. I have started doing that. 8080 and 8081 ports. ------------------------------ Samewise, I didn't know what application ran on that port. I had to search a bit the web to find out how to figure this out. I have added the information in the wiki. Provide a complete bug report -------------------------------------------- I was able to provide a complete bug report only because I happened to read a forum post in the archives where you asked for all this information. Similarly, I had troubles figuring out the versions of each of the applications. I added it all in the wiki to make your job easier later (no need to repeat everything each time). I hope it's not too much for you. I'm sure some of the extra information will help some new user. Cheers, Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |
From: Artyom <art...@ya...> - 2010-07-13 07:14:23
|
> > > Meanwhile, I like wikis and I feel it's important that things get documented. > Since I'm new here, I wanted to ask first: is it ok if I create new pages on > the wiki to document the information that you provide via email? > I could create a compile troubleshooting page which should help future > compilers. > > Feel free to edit wiki, add pages where appropriate, Actually this is good idea I was thinking about something like that as well - troubleshooting. So I added it: http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_build_troubleshooting Feel free to edit :-) Artyom |
From: Artyom <art...@ya...> - 2010-07-13 07:04:46
|
Hi, > > After patching, I got: > > > 96% tests passed, 2 tests failed out of 46 > Total Test time (real) = 37.60 sec > The following tests FAILED: > 10 - internal_forwarder_test (Failed) > 11 - forwarder_test (SEGFAULT) > Errors while running CTest > make: *** [test] Error 8 > First of all, one test fixed, about next ones: > 10/46 Testing: internal_forwarder_test > > ---------------------------------------------------------- > Tesing internal forwarder > system: Address already in use > <end of output> > Test time = 0.02 sec Do you have anything that listens on 8081 as well? (forwarder uses also 8081) > 11/46 Testing: forwarder_test > 11/46 Test: forwarder_test > Command: "/home/overshoot/devel/svn/cppcms/build/forwarder_test" "-c" > "/home/overshoot/devel/svn/cppcms/tests/forwarder_test.js" "--test- > exec=/usr/bin/python /home/overshoot/devel/svn/cppcms/tests/forwarder_test.py" > > "--test-internal=false" > Directory: /home/overshoot/devel/svn/cppcms/build > "forwarder_test" start time: Jul 13 14:00 CST > Output: > ---------------------------------------------------------- > Tesing application level forwarding > <end of output> > Test time = 0.01 sec Can you please give me a back trace of the fault? run gdb as: gdb /home/overshoot/devel/svn/cppcms/build/forwarder_test Then in gdb r -c /home/overshoot/devel/svn/cppcms/tests/forwarder_test.js --test-exec=/home/overshoot/devel/svn/cppcms/tests/forwarder_test.py --test-internal=false When program crashes, type bt It would print you a stack back trace of the failed program. Thank you, Artyom |
From: augustin <aug...@ov...> - 2010-07-13 06:09:00
|
On Tuesday 13 July 2010 12:35:44 pm Artyom wrote: > These tests had failed because you had an application that > runs and listens to 8080 port, Unit tests use it for communication > with the application - so it can't bind to the port. > > Stop a service or application that listen on them and they should pass. Ok. I found the process and turned it off. > Take a look on file /usr/include/unicode/uversion.h > and see how U_ICU_VERSION is defined. > > It looks like you have 4.0 and I handn't chance to test CppCMS > against this version (tested 3.6, 3.8, 4.2 and 4.4) You are right: #define U_ICU_VERSION "4.0.1" Before patching the source, I tried to compile to see the different. I got: 93% tests passed, 3 tests failed out of 46 Total Test time (real) = 37.90 sec The following tests FAILED: 10 - internal_forwarder_test (SEGFAULT) 11 - forwarder_test (Failed) 42 - test_locale_formatting (Failed) Errors while running CTest make: *** [test] Error 8 > The faults are minor and not critical but can you please change lines > 297, 165 in booster/lib/locale/test/test_formatting.cpp file from > > #if U_ICU_VERSION_MAJOR_NUM >= 4 > to > #if U_ICU_VERSION_MAJOR_NUM*100 + U_ICU_VERSION_MINOR_NUM >= 402 > > And tell me if it helps? After patching, I got: 96% tests passed, 2 tests failed out of 46 Total Test time (real) = 37.60 sec The following tests FAILED: 10 - internal_forwarder_test (Failed) 11 - forwarder_test (SEGFAULT) Errors while running CTest make: *** [test] Error 8 10/46 Testing: internal_forwarder_test 10/46 Test: internal_forwarder_test Command: "/home/overshoot/devel/svn/cppcms/build/forwarder_test" "-c" "/home/overshoot/devel/svn/cppcms/tests/forwarder_test.js" "--test- exec=/usr/bin/python /home/overshoot/devel/svn/cppcms/tests/forwarder_test.py" "--test-internal=true" Directory: /home/overshoot/devel/svn/cppcms/build "internal_forwarder_test" start time: Jul 13 14:00 CST Output: ---------------------------------------------------------- Tesing internal forwarder system: Address already in use <end of output> Test time = 0.02 sec ---------------------------------------------------------- Test Failed. "internal_forwarder_test" end time: Jul 13 14:00 CST "internal_forwarder_test" time elapsed: 00:00:00 ---------------------------------------------------------- 11/46 Testing: forwarder_test 11/46 Test: forwarder_test Command: "/home/overshoot/devel/svn/cppcms/build/forwarder_test" "-c" "/home/overshoot/devel/svn/cppcms/tests/forwarder_test.js" "--test- exec=/usr/bin/python /home/overshoot/devel/svn/cppcms/tests/forwarder_test.py" "--test-internal=false" Directory: /home/overshoot/devel/svn/cppcms/build "forwarder_test" start time: Jul 13 14:00 CST Output: ---------------------------------------------------------- Tesing application level forwarding <end of output> Test time = 0.01 sec ---------------------------------------------------------- Test Failed. "forwarder_test" end time: Jul 13 14:00 CST "forwarder_test" time elapsed: 00:00:00 ---------------------------------------------------------- Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |
From: augustin <aug...@ov...> - 2010-07-13 05:19:21
|
On Tuesday 13 July 2010 12:35:44 pm Artyom wrote: > First of all very good problem report. Thanks, I thought you'd appreciate it. I simply replied to the questions you asked a previous poster. > P.S.: Have you registered to the list? Because your message was blocked > for some reason and I had to unblock it in administrators interface. Yes, I have registered. The message got blocked because of the attachment. I received this after posting: Your mail to 'Cppcms-users' with the subject make test: 72% tests passed, 13 tests failed out of 46 is being held until the list moderator can review it for approval. the reason it is being held: Message body is too big: 42458 bytes with a limit of 40 KB Thanks for your reply about the make test errors. I'll test everything you say and reply later with more information. Meanwhile, I like wikis and I feel it's important that things get documented. Since I'm new here, I wanted to ask first: is it ok if I create new pages on the wiki to document the information that you provide via email? I could create a compile troubleshooting page which should help future compilers. Thanks again, Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |
From: Artyom <art...@ya...> - 2010-07-13 04:35:52
|
Hello, First of all very good problem report. > The following tests FAILED: > 8 - form_test (Failed) > 9 - cookie_test > (Failed) > 10 - > internal_forwarder_test (Failed) > 11 - forwarder_test > (Failed) > 12 - jsonrpc_test > (Failed) > 13 - > proto_test_async_http (Failed) > 14 - > proto_test_async_scgi (Failed) > 16 - > proto_test_sync_http (Failed) > 17 - > proto_test_sync_scgi (Failed) > 34 - test_aio_socket > (Failed) > 35 - > test_aio_endpoint (Failed) > 36 - > test_aio_prefork (Failed) > 42 - These tests had failed because you had an application that runs and listens to 8080 port, Unit tests use it for communication with the application - so it can't bind to the port. Stop a service or application that listen on them and they should pass. > test_locale_formatting (Failed) > > I don't know how to find the ICU version I have. I guess a > recent one (I'm on > Kubuntu 9.11. > Take a look on file /usr/include/unicode/uversion.h and see how U_ICU_VERSION is defined. It looks like you have 4.0 and I handn't chance to test CppCMS against this version (tested 3.6, 3.8, 4.2 and 4.4) The faults are minor and not critical but can you please change lines 297, 165 in booster/lib/locale/test/test_formatting.cpp file from #if U_ICU_VERSION_MAJOR_NUM >= 4 to #if U_ICU_VERSION_MAJOR_NUM*100 + U_ICU_VERSION_MINOR_NUM >= 402 And tell me if it helps? Regards, Artyom P.S.: Have you registered to the list? Because your message was blocked for some reason and I had to unblock it in administrators interface. |
From: augustin <aug...@ov...> - 2010-07-13 00:56:34
|
Hello! First, thanks Artyom for this project. I discovered it 2 days ago and it seems it was exactly what I was looking for. I am trying to make test cppcms but I get this: 72% tests passed, 13 tests failed out of 46 Total Test time (real) = 23.57 sec The following tests FAILED: 8 - form_test (Failed) 9 - cookie_test (Failed) 10 - internal_forwarder_test (Failed) 11 - forwarder_test (Failed) 12 - jsonrpc_test (Failed) 13 - proto_test_async_http (Failed) 14 - proto_test_async_scgi (Failed) 16 - proto_test_sync_http (Failed) 17 - proto_test_sync_scgi (Failed) 34 - test_aio_socket (Failed) 35 - test_aio_endpoint (Failed) 36 - test_aio_prefork (Failed) 42 - test_locale_formatting (Failed) Errors while running CTest make: *** [test] Error 8 I am using Kubuntu. I am using a svn checkout from 2 days ago. # svn update At revision 1314. I didn't run make + options. I simply did: cmake .. make make test # cmake .. -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Performing Test GCC_IS_GCC4 -- Performing Test GCC_IS_GCC4 - Success -- Looking for socket -- Looking for socket - found -- Looking for gethostbyname -- Looking for gethostbyname - found -- Performing Test BOOSTER_HAS_GCC_SYNC -- Performing Test BOOSTER_HAS_GCC_SYNC - Success -- Performing Test BOOSTER_HAVE_GCC_BITS_EXCHANGE_AND_ADD -- Performing Test BOOSTER_HAVE_GCC_BITS_EXCHANGE_AND_ADD - Failed -- Performing Test BOOSTER_HAVE_GCC_EXT_EXCHANGE_AND_ADD -- Performing Test BOOSTER_HAVE_GCC_EXT_EXCHANGE_AND_ADD - Success -- Performing Test BOOSTER_HAVE_FREEBSD_ATOMIC -- Performing Test BOOSTER_HAVE_FREEBSD_ATOMIC - Failed -- Performing Test BOOSTER_HAVE_SOLARIS_ATOMIC -- Performing Test BOOSTER_HAVE_SOLARIS_ATOMIC - Failed -- Performing Test BOOSTER_HAVE_MAC_OS_X_ATOMIC -- Performing Test BOOSTER_HAVE_MAC_OS_X_ATOMIC - Failed -- Performing Test BOOSTER_HAVE_STDINT_H -- Performing Test BOOSTER_HAVE_STDINT_H - Success -- Performing Test BOOSTER_HAVE_INTTYPES_H -- Performing Test BOOSTER_HAVE_INTTYPES_H - Success -- Performing Test BOOSTER_AIO_HAVE_PF_INET6 -- Performing Test BOOSTER_AIO_HAVE_PF_INET6 - Success -- Looking for ICU libraries -- ICU Found, building booster locale -- Performing Test CPPCMS_HAVE_STDINT_H -- Performing Test CPPCMS_HAVE_STDINT_H - Success -- Performing Test CPPCMS_HAVE_INTTYPES_H -- Performing Test CPPCMS_HAVE_INTTYPES_H - Success -- Looking for atoll -- Looking for atoll - found -- Looking for _atoi64 -- Looking for _atoi64 - not found -- Looking for snprintf -- Looking for snprintf - found -- Looking for stat -- Looking for stat - found -- Looking for _stat -- Looking for _stat - not found -- Performing Test LIBC_ICONV -- Performing Test LIBC_ICONV - Success -- Performing Test CPPCMS_HAVE_STD_WSTRING -- Performing Test CPPCMS_HAVE_STD_WSTRING - Success -- Performing Test CPPCMS_HAVE_BSD_TM -- Performing Test CPPCMS_HAVE_BSD_TM - Success -- Performing Test CPPCMS_HAVE_CPP0X_UXSTRING -- Performing Test CPPCMS_HAVE_CPP0X_UXSTRING - Failed -- Performing Test CPPCMS_HAVE_CPP_0X_AUTO -- Performing Test CPPCMS_HAVE_CPP_0X_AUTO - Failed -- Performing Test CPPCMS_HAVE_CPP_0X_DECLTYPE -- Performing Test CPPCMS_HAVE_CPP_0X_DECLTYPE - Failed -- Performing Test CPPCMS_HAVE_GCC_TYPEOF -- Performing Test CPPCMS_HAVE_GCC_TYPEOF - Success -- Performing Test CPPCMS_HAVE_UNDERSCORE_TYPEOF -- Performing Test CPPCMS_HAVE_UNDERSCORE_TYPEOF - Success -- Looking for dlopen -- Looking for dlopen - not found -- Looking for dlopen in dl -- Looking for dlopen in dl - found -- Looking for socket -- Looking for socket - found -- Looking for gethostbyname -- Looking for gethostbyname - found -- Looking for canonicalize_file_name -- Looking for canonicalize_file_name - found GNU Gcrypt library not found, disabling aes_encryptor -- Configuring done -- Generating done $ python -V Python 2.6.4 I don't know how to find the ICU version I have. I guess a recent one (I'm on Kubuntu 9.11. $ cmake --help cmake version 2.8.0 $ pcretest PCRE version 7.8 2008-09-05 I don't know how to find the zlib version. $ gcc --version gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1 $ ldd ./proto_test linux-vdso.so.1 => (0x00007fffd57f3000) libcppcms.so.1 => /home/overshoot/devel/svn/cppcms/build/libcppcms.so.1 (0x00007f5d0155d000) libbooster.so.0 => /home/overshoot/devel/svn/cppcms/build/booster/libbooster.so.0 (0x00007f5d012b6000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007f5d0109a000) libpcre.so.3 => /lib/libpcre.so.3 (0x00007f5d00e6c000) libicuuc.so.40 => /usr/lib/libicuuc.so.40 (0x00007f5d00b24000) libicui18n.so.40 => /usr/lib/libicui18n.so.40 (0x00007f5d00790000) libicudata.so.40 => /usr/lib/libicudata.so.40 (0x00007f5cff84b000) libdl.so.2 => /lib/libdl.so.2 (0x00007f5cff647000) libz.so.1 => /lib/libz.so.1 (0x00007f5cff430000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f5cff120000) libm.so.6 => /lib/libm.so.6 (0x00007f5cfee9c000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f5cfec85000) libc.so.6 => /lib/libc.so.6 (0x00007f5cfe915000) /lib64/ld-linux-x86-64.so.2 (0x00007f5d0194d000) $ ldd ./internal_forwarder_test ldd: ./internal_forwarder_test: No such file or directory Attached is the Lasttest.log. Thank you for your help. Augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |
From: Artyom <art...@ya...> - 2010-07-11 06:24:08
|
> >First off - Artyum, massive thanks for braving new ground and writing what is an > >excellent library and almost the only one of its kind. I really hope cppcms >starts to build more momentum (community) to really take hold as a main stream >alternative solution. I hope so too :-) >I am trying to make use of the internal webserver. When I run any of the >examples, (with -c and the configuration file) it starts up, (i confirmed that >it opens the port in netstat) but when i point the browser at it, i get a >"unable to connect", as if the server isn't responding. Any ideas? What is your configuration file? What version of CppCMS do you use (I mean you need 0.99.1 for embedded web server). Generally take a look on the example file examples/hello_world/config.js - It is important to make sure you have "script_names" defined to the path your application should run on, - If you need to serve html files as well you need also add section like: "file_server" : { "enable" : true, "doument_root" : "/path/to/document/root" }, see as exaple src/config.js > >On the same note, how robust is the internal server? Would you use it >comfortably in a deployed embedded system? Internal web server is developed mostly for debugging purposes and can run in **trusted** networks or behind proxies that sanity HTTP input. I explain way: - It works in very simple way, it does check HTTP input for correctness and handle requests, but for example it does not handle timeouts at all, so it is very vulnerable to DOS attacks. - When serving files it has only single document-root, it performs path checks using system calls like canonicalize_file_name under linux, realpath under other POSIX OSes and GetFullPathName under Windows, but I'm not sure how these checks are really complete and right. On the other hand, from quick glance on mongoose.c, it does not do even this (i.e. its security checks quite primitive and would fail for advanced attacks). - It does not support SSL So, if you deploy it in trusted network where you do not expect attacks on your service, it is more then fine. But I would never expose it to internet or to untrusted clients. > How hard do you suppose it would be > to merge in something like mongoose for use as an internal server? I would not do this for two reasons: 1. All CppCMS APIs (SCGI/FCGI/HTTP) have quite strict requirements for their interfaces: - They required to work in both synchronous and asynchronous modes - They should be integrated with Booster.Aio event loop. So it would not be simple (if possible at all) to integrate it. 2. I'm not sure how good monogose is in terms of security, so I would rather prefer to improve security of internal HTTP server so it would be able to handle requests in much safe way, then to integrate it into CppCMS. So, untill it get reviewed by some securiy experts I would not recommend using internal HTTP server in untrusted networks, as for the rest it is fine. And if you do need secure embedded web server I'd suggest use nginx or lighttpd as they very light (their binary size even smaller they libcppcms.so) so just use them as powerful and secure frontends for CppCMS. Regard, Artyom |
From: David E. <dav...@gm...> - 2010-07-11 03:21:42
|
my first post... First off - Artyum, massive thanks for braving new ground and writing what is an excellent library and almost the only one of its kind. I really hope cppcms starts to build more momentum (community) to really take hold as a main stream alternative solution. On to business. I am trying to make use of the internal webserver. When I run any of the examples, (with -c and the configuration file) it starts up, (i confirmed that it opens the port in netstat) but when i point the browser at it, i get a "unable to connect", as if the server isn't responding. Any ideas? On the same note, how robust is the internal server? Would you use it comfortably in a deployed embedded system? How hard do you suppose it would be to merge in something like mongoose <http://code.google.com/p/mongoose/>for use as an internal server? thanks ~elrom |
From: Hermann S. <of...@he...> - 2010-07-01 09:50:54
|
Yes. Bye, Hermann > Thanks, > > I've committed changes 1301 that should deal with extra zeros. > Hopefully it fixes this test fault. > > Artyom > > > > > ----- Original Message ---- >> From: Hermann Seib <of...@he...> >> To: cpp...@li... >> Sent: Thu, July 1, 2010 10:52:42 AM >> Subject: Re: [Cppcms-users] JSON integer conversion(s) >> >> If it helps you, here's what VC15 (i.e., Visual Studio 2008) generates: >> >> format(1.35e30)="1.35e+030" (note the additional 0). >> >> Bye, >> >> Hermann >> >>> Thanks, >>> >>> Looks like I have to get to MSVC to solve this issue, but it does not look >>> critical. >>> >>> Opened a bug: >>> >> https://sourceforge.net/tracker/?func=detail&aid=3023329&group_id=209965&atid=1011835 >> >>> >>> Artyom >>> >>> >>> >>> >>> ----- Original Message ---- >>>> From: Hermann Seib <of...@he...> >>>> To: cpp...@li... >>>> Sent: Wed, June 30, 2010 2:42:47 PM >>>> Subject: Re: [Cppcms-users] JSON integer conversion(s) >>>> >>>>> Can you run svn update (get 1299) and rebuild once more and give me the >>>> output >>>>> of ./json_test >>>> Failed:Error D:\Dev\CppCMS\tests\json_test.cpp:170 >>>> format(1.35e30)=="1.35e+30" >>>> >>>> Bye, >>>> >>>> Hermann >>>> >>>> >> ------------------------------------------------------------------------------ >>>> This SF.net email is sponsored by Sprint >>>> What will you do first with EVO, the first 4G phone? >>>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >>>> _______________________________________________ >>>> Cppcms-users mailing list >>>> Cpp...@li... >>>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>>> >>> >>> >>> >>> >> ------------------------------------------------------------------------------ >>> This SF.net email is sponsored by Sprint >>> What will you do first with EVO, the first 4G phone? >>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >>> _______________________________________________ >>> Cppcms-users mailing list >>> Cpp...@li... >>> https://lists.sourceforge.net/lists/listinfo/cppcms-users >>> >>> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |