cppcms-users Mailing List for CppCMS C++ Web Framework (Page 63)
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
|
| 2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
|
From: Christian G. <chr...@gm...> - 2013-02-04 15:41:10
|
What's the current state of development of cppcms? -- Christian Gmeiner, MSc |
|
From: 彭贝城 <has...@16...> - 2013-01-30 09:25:14
|
Hi guys I am quite new to this framework,and I tried to run wikipp which is based on cppcms on my laptop,but 404 occured on my browser. I installed cppcms as well as cppdb properly according to the official instruction.I successfully built the wikipp and passed all the "make test" during compilation.I set up my mysql server with the proper .sql script,and when I ran wikipp -c config.js,the shell prompt did not showing anything but idling as if it is working well.But when I tried to browse wikipp on my firefox, 404 error occured.I tried switching the port to various ones,but the error still apperared. Is toggling wikipp to webservers like lighttpd neccessary to just test the program?Or is it a must? |
|
From: niXman <i.n...@gm...> - 2013-01-30 07:36:49
|
> You skipped a stage in build instructions from SVN that are different > from the build instructions form the released sources... Oh, sorry.. I thought it was an error in the documentation. I never saw such that, after getting the sources from CVS, it was necessary to unpack the archive, also received with the sources %) Thank you. -- Regards, niXman ___________________________________________________ Dual-target(32 & 64-bit) MinGW compilers for 32 and 64-bit Windows: http://sourceforge.net/projects/mingwbuilds/ ___________________________________________________ Another online IDE: http://liveworkspace.org/ |
|
From: Artyom B. <art...@ya...> - 2013-01-29 21:13:43
|
No, trunk is working... You skipped a stage in build instructions from SVN that are different from the build instructions form the released sources... RTFM Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ ----- Original Message ----- > From: niXman <i.n...@gm...> > To: Artyom Beilis <art...@ya...>; cpp...@li... > Cc: > Sent: Tuesday, January 29, 2013 9:45 PM > Subject: Re: [Cppcms-users] cppcms_boost/bind.hpp not found > > 2013/1/29 niXman <i.n...@gm...>: > >> I.e. trunk now in a non-working state? > ping? > > > -- > Regards, > niXman > ___________________________________________________ > Dual-target(32 & 64-bit) MinGW compilers for 32 and 64-bit Windows: > http://sourceforge.net/projects/mingwbuilds/ > ___________________________________________________ > Another online IDE: http://liveworkspace.org/ > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. ON SALE this month only -- learn more at: > http://p.sf.net/sfu/learnnow-d2d > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
|
From: niXman <i.n...@gm...> - 2013-01-29 19:45:57
|
2013/1/29 niXman <i.n...@gm...>: > I.e. trunk now in a non-working state? ping? -- Regards, niXman ___________________________________________________ Dual-target(32 & 64-bit) MinGW compilers for 32 and 64-bit Windows: http://sourceforge.net/projects/mingwbuilds/ ___________________________________________________ Another online IDE: http://liveworkspace.org/ |
|
From: niXman <i.n...@gm...> - 2013-01-29 12:07:55
|
> You had missed a small step: > > http://cppcms.com/wikipp/en/page/cppcms_1x_build#Getting.The.Sources > > tar -xjvf cppcms_boost.tar.bz2 I.e. trunk now in a non-working state? -- Regards, niXman ___________________________________________________ Dual-target(32 & 64-bit) MinGW compilers for 32 and 64-bit Windows: http://sourceforge.net/projects/mingwbuilds/ ___________________________________________________ Another online IDE: http://liveworkspace.org/ |
|
From: Artyom B. <art...@ya...> - 2013-01-29 12:03:06
|
You had missed a small step: http://cppcms.com/wikipp/en/page/cppcms_1x_build#Getting.The.Sources tar -xjvf cppcms_boost.tar.bz2 Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ ----- Original Message ----- > From: niXman <i.n...@gm...> > To: cpp...@li... > Cc: > Sent: Tuesday, January 29, 2013 1:57 PM > Subject: [Cppcms-users] cppcms_boost/bind.hpp not found > > Hi, > > When I try to build CppCMS from > trunk(svn://svn.code.sf.net/p/cppcms/code/framework/trunk) at rev2238, > I get the following error: >> ... >> Scanning dependencies of target cppcms >> [ 19%] Building CXX object CMakeFiles/cppcms.dir/src/service.cpp.oIn file > included from cppcms-code/src/service.cpp:35:0: >> cppcms-code/private/prefork_acceptor.h:28:33: fatal error: > cppcms_boost/bind.hpp: no such file or directory > > What I`am doing wrongly? > Thanks. > > > -- > Regards, > niXman > ___________________________________________________ > Dual-target(32 & 64-bit) MinGW compilers for 32 and 64-bit Windows: > http://sourceforge.net/projects/mingwbuilds/ > ___________________________________________________ > Another online IDE: http://liveworkspace.org/ > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. ON SALE this month only -- learn more at: > http://p.sf.net/sfu/learnnow-d2d > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
|
From: niXman <i.n...@gm...> - 2013-01-29 11:57:49
|
Hi, When I try to build CppCMS from trunk(svn://svn.code.sf.net/p/cppcms/code/framework/trunk) at rev2238, I get the following error: > ... > Scanning dependencies of target cppcms > [ 19%] Building CXX object CMakeFiles/cppcms.dir/src/service.cpp.oIn file included from cppcms-code/src/service.cpp:35:0: > cppcms-code/private/prefork_acceptor.h:28:33: fatal error: cppcms_boost/bind.hpp: no such file or directory What I`am doing wrongly? Thanks. -- Regards, niXman ___________________________________________________ Dual-target(32 & 64-bit) MinGW compilers for 32 and 64-bit Windows: http://sourceforge.net/projects/mingwbuilds/ ___________________________________________________ Another online IDE: http://liveworkspace.org/ |
|
From: bruce x. <bru...@gm...> - 2013-01-29 02:06:11
|
The problem doesn't reproduce so far. I think that it have been solved~ Thanks 2013/1/28 Artyom Beilis <art...@ya...> > Had it solved the problem? > > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > ------------------------------ > *From:* bruce xiu <bru...@gm...> > *To:* Artyom Beilis <art...@ya...>; > cpp...@li... > *Sent:* Monday, January 21, 2013 10:10 AM > *Subject:* Re: [Cppcms-users] exception about endpoint > > Thanks, > I don't known when the exception will reproduce. I'll fix it and rebuild > cppcms. No matter if the exception reproduces, I will tell you~ > > 2013/1/21 Artyom Beilis <art...@ya...> > > Ok, > > > this is incorrect code: > > > 86 endpoint basic_socket::remote_endpoint(system::error_code &e) > 87 { > 88 std::vector<char> endpoint_raw_(1000,0); // apply 1000 bytes > 89 sockaddr *sa = reinterpret_cast<sockaddr > *>(&endpoint_raw_.front()); > 90 socklen_t len = endpoint_raw_.size(); > 91 if(::getpeername(native(),sa,&len) < 0) > 92 e=geterror(); > 93 endpoint ep; > 94 ep.raw(sa,len); // An exception thrown > 95 return ep; > 96 } > > > > It should be > > > endpoint basic_socket::remote_endpoint(system::error_code &e) > { > std::vector<char> endpoint_raw_(1000,0); // apply 1000 bytes > sockaddr *sa = reinterpret_cast<sockaddr *>(&endpoint_raw_.front()); > socklen_t len = endpoint_raw_.size(); > endpoint ep; > if(::getpeername(native(),sa,&len) < 0) { > e=geterror(); > return ep; > } > ep.raw(sa,len); // An exception thrown > return ep; > } > > Can you please check if it helps? > > > > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > ------------------------------ > *From:* bruce xiu <bru...@gm...> > *To:* cpp...@li... > *Sent:* Monday, January 21, 2013 6:03 AM > *Subject:* [Cppcms-users] exception about endpoint > > Hi, everyone, I set up a web service server using cppcms-1.0.2 some time > ago , outside is nginx, and it went well. A weeks ago, I removed the nginx > when I put the app to another server. And then an exception often > occured. The following is exception and trace : > > -- aio::: invalid endpoint > 0x7f7dc7acda18: booster::aio::endpoint::throw_invalid() const + 0xe8 in > PATH_TO_LIBS/libbooster.so.0 > 0x7f7dc7acdc75: booster::aio::endpoint::raw(sockaddr const*, int) + 0x25 > in PATH_TO_LIBS/libbooster.so.0 > 0x7f7dc7ad948b: > booster::aio::basic_socket::remote_endpoint(booster::system::error_code&) + > 0xab in PATH_TO_LIBS/libbooster.so.0 > 0x7f7dc7f00645: > cppcms::impl::cgi::http::process_request(booster::callback<void > (booster::system::error_code const&)> const&) + 0x3b5 in > PATH_TO_LIBS/libcppcms.so.1 > 0x7f7dc7f0154b: > cppcms::impl::cgi::http::some_headers_data_read(booster::system::error_code > const&, unsigned long, booster::callback<void (booster::system::error_code > const&)> const&) + 0x32b in PATH_TO_LIBS/libcppcms.so.1 > 0x7f7dc7ade609: ??? + 0xc7ade609 in PATH_TO_LIBS/libbooster.so.0 > 0x7f7dc7ad0c6c: booster::callback<void ()>::callable_impl<void, > booster::aio::event_loop_impl::event_handler_dispatcher>::operator()() + > 0x1c in PATH_TO_LIBS/libbooster.so.0 > 0x7f7dc7ad2176: > booster::aio::event_loop_impl::run_one(booster::aio::reactor::event*, > unsigned long) + 0x106 in PATH_TO_LIBS/libbooster.so.0 > 0x7f7dc7acf3e8: booster::aio::io_service::run() + 0x78 in > PATH_TO_LIBS/libbooster.so.0 > 0x7f7dc7e18c85: cpp > cms::service::run() + 0x65 in PATH_TO_LIBS/libcppcms.so.1 > > Then I traced the exception in code, and found the function in > booster/lib/aio/src/basic_socket.cpp > > 86 endpoint basic_socket::remote_endpoint(system::error_code &e) > 87 { > 88 std::vector<char> endpoint_raw_(1000,0); // apply 1000 bytes > 89 sockaddr *sa = reinterpret_cast<sockaddr > *>(&endpoint_raw_.front()); > 90 socklen_t len = endpoint_raw_.size(); > 91 if(::getpeername(native(),sa,&len) < 0) > 92 e=geterror(); > 93 endpoint ep; > 94 ep.raw(sa,len); // An exception thrown > 95 return ep; > 96 } > > in booster/lib/aio/src/endpoint.cpp > > 228 void endpoint::raw(sockaddr const *p,int size) > 229 { > 230 if(size > int(sizeof(d->sa))) // sizeof(d->sa) is 256 > 231 throw_invalid(); //from here > 232 d->size=size; > 233 memcpy(&d->sa.sa,p,size); > 234 } > > remote_endpoint doesn't handle this exception. I don't know the reason of > the exception exactly, I doubt that someone makes trouble deliberately. > In getpeername(), when len > 256 && len <= 1000, an exception will be > thrown, normally sockaddr won't be so long.Then I want to modify the source > in remote_endpoint > > >>>std::vector<char> endpoint_raw_(1000,0) > <<<std::vector<char> endpoint_raw_(256, 0) > > then getpeername will handle the exception and return -1, and geterror() > will run. > > It will cause any problem? > > -- > ZhiXin XIU > > Computer Science & Engineering Dept., > Shanghai Jiao Tong University, > 800 Dongchuan Rd., Shanghai, > CHINA > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET <http://asp.net/>, C# > 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. SALE $99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122412 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET <http://asp.net/>, C# > 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. SALE $99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122412 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > -- > ZhiXin XIU > > Computer Science & Engineering Dept., > Shanghai Jiao Tong University, > 800 Dongchuan Rd., Shanghai, > CHINA > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. SALE $99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122412 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. ON SALE this month only -- learn more at: > http://p.sf.net/sfu/learnnow-d2d > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > -- ZhiXin XIU Computer Science & Engineering Dept., Shanghai Jiao Tong University, 800 Dongchuan Rd., Shanghai, CHINA |
|
From: Artyom B. <art...@ya...> - 2013-01-28 13:20:08
|
Had it solved the problem? Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: bruce xiu <bru...@gm...> >To: Artyom Beilis <art...@ya...>; cpp...@li... >Sent: Monday, January 21, 2013 10:10 AM >Subject: Re: [Cppcms-users] exception about endpoint > > >Thanks, >I don't known when the exception will reproduce. I'll fix it and rebuild cppcms. No matter if the exception reproduces, I will tell you~ > > >2013/1/21 Artyom Beilis <art...@ya...> > >Ok, >> >> >>this is incorrect code: >> >> >> >> >>86 endpoint basic_socket::remote_endpoint(system::error_code &e) >> 87 { >> 88 std::vector<char> endpoint_raw_(1000,0); // apply 1000 bytes >> 89 sockaddr *sa = reinterpret_cast<sockaddr *>(&endpoint_raw_.front()); >> 90 socklen_t len = endpoint_raw_.size(); >> 91 if(::getpeername(native(),sa,&len) < 0) >> 92 e=geterror(); >> 93 endpoint ep; >> 94 ep.raw(sa,len); // An exception thrown >> 95 return ep; >> 96 } >> >> >> >>It should be >> >> >> >> >> >> endpoint basic_socket::remote_endpoint(system::error_code &e) >> { >> std::vector<char> endpoint_raw_(1000,0); // apply 1000 bytes >> sockaddr *sa = reinterpret_cast<sockaddr *>(&endpoint_raw_.front()); >> socklen_t len = endpoint_raw_.size(); >> endpoint ep; if(::getpeername(native(),sa,&len) < 0) { >> >> e=geterror(); >> return ep; >> } >> >> ep.raw(sa,len); // An exception thrown >> return ep; >> } >> >>Can you please check if it helps? >> >> >> >> >> >> >> >>Artyom Beilis >>-------------- >>CppCMS - C++ Web Framework: http://cppcms.com/ >>CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >> >> >> >>>________________________________ >>> From: bruce xiu <bru...@gm...> >>>To: cpp...@li... >>>Sent: Monday, January 21, 2013 6:03 AM >>>Subject: [Cppcms-users] exception about endpoint >>> >>> >>> >>>Hi, everyone, I set up a web service server using cppcms-1.0.2 some time ago , outside is nginx, and it went well. A weeks ago, I removed the nginx when I put the app to another server. And then an exception often occured. The following is exception and trace : >>> >>>-- aio::: invalid endpoint >>>0x7f7dc7acda18: booster::aio::endpoint::throw_invalid() const + 0xe8 in PATH_TO_LIBS/libbooster.so.0 >>>0x7f7dc7acdc75: booster::aio::endpoint::raw(sockaddr const*, int) + 0x25 in PATH_TO_LIBS/libbooster.so.0 >>>0x7f7dc7ad948b: booster::aio::basic_socket::remote_endpoint(booster::system::error_code&) + 0xab in PATH_TO_LIBS/libbooster.so.0 >>>0x7f7dc7f00645: cppcms::impl::cgi::http::process_request(booster::callback<void (booster::system::error_code const&)> const&) + 0x3b5 in PATH_TO_LIBS/libcppcms.so.1 >>>0x7f7dc7f0154b: cppcms::impl::cgi::http::some_headers_data_read(booster::system::error_code const&, unsigned long, booster::callback<void (booster::system::error_code const&)> const&) + 0x32b in PATH_TO_LIBS/libcppcms.so.1 >>>0x7f7dc7ade609: ??? + 0xc7ade609 in PATH_TO_LIBS/libbooster.so.0 >>>0x7f7dc7ad0c6c: booster::callback<void ()>::callable_impl<void, booster::aio::event_loop_impl::event_handler_dispatcher>::operator()() + 0x1c in PATH_TO_LIBS/libbooster.so.0 >>>0x7f7dc7ad2176: booster::aio::event_loop_impl::run_one(booster::aio::reactor::event*, unsigned long) + 0x106 in PATH_TO_LIBS/libbooster.so.0 >>>0x7f7dc7acf3e8: booster::aio::io_service::run() + 0x78 in PATH_TO_LIBS/libbooster.so.0 >>>0x7f7dc7e18c85: cpp >>>cms::service::run() + 0x65 in PATH_TO_LIBS/libcppcms.so.1 >>> >>> >>>Then I traced the exception in code, and found the function in booster/lib/aio/src/basic_socket.cpp >>> >>> >>>86 endpoint basic_socket::remote_endpoint(system::error_code &e) >>> 87 { >>> 88 std::vector<char> endpoint_raw_(1000,0); // apply 1000 bytes >>> 89 sockaddr *sa = reinterpret_cast<sockaddr *>(&endpoint_raw_.front()); >>> 90 socklen_t len = endpoint_raw_.size(); >>> 91 if(::getpeername(native(),sa,&len) < 0) >>> 92 e=geterror(); >>> 93 endpoint ep; >>> 94 ep.raw(sa,len); // An exception thrown >>> 95 return ep; >>> 96 } >>> >>> >>>in booster/lib/aio/src/endpoint.cpp >>> >>> >>>228 void endpoint::raw(sockaddr const *p,int size) >>>229 { >>>230 if(size > int(sizeof(d->sa))) // sizeof(d->sa) is 256 >>>231 throw_invalid(); //from here >>>232 d->size=size; >>>233 memcpy(&d->sa.sa,p,size); >>>234 } >>> >>> >>>remote_endpoint doesn't handle this exception. I don't know the reason of the exception exactly, I doubt that someone makes trouble deliberately. >>>In getpeername(), when len > 256 && len <= 1000, an exception will be thrown, normally sockaddr won't be so long.Then I want to modify the source in remote_endpoint >>> >>> >>>>>>std::vector<char> endpoint_raw_(1000,0) >>><<<std::vector<char> endpoint_raw_(256, 0) >>> >>> >>>then getpeername will handle the exception and return -1, and geterror() will run. >>> >>> >>>It will cause any problem? >>> >>>-- >>>ZhiXin XIU >>> >>>Computer Science & Engineering Dept., >>>Shanghai Jiao Tong University, >>>800 Dongchuan Rd., Shanghai, >>>CHINA >>>------------------------------------------------------------------------------ >>>Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >>>MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >>>with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >>>MVPs and experts. SALE $99.99 this month only -- learn more at: >>>http://p.sf.net/sfu/learnmore_122412 >>>_______________________________________________ >>>Cppcms-users mailing list >>>Cpp...@li... >>>https://lists.sourceforge.net/lists/listinfo/cppcms-users >>> >>> >>> >>------------------------------------------------------------------------------ >>Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >>MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >>with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >>MVPs and experts. SALE $99.99 this month only -- learn more at: >>http://p.sf.net/sfu/learnmore_122412 >>_______________________________________________ >>Cppcms-users mailing list >>Cpp...@li... >>https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> > > > >-- >ZhiXin XIU > >Computer Science & Engineering Dept., >Shanghai Jiao Tong University, >800 Dongchuan Rd., Shanghai, >CHINA >------------------------------------------------------------------------------ >Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >MVPs and experts. SALE $99.99 this month only -- learn more at: >http://p.sf.net/sfu/learnmore_122412 >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: Artyom B. <art...@ya...> - 2013-01-28 13:15:42
|
>> Try to explain what exactly you are trying to do and what behavior do you want.
>
>Im tryin make messaging, like a chat (facebook example) but between only two
>users.
>cppcms json rpc or sse?
>Artyom you can explain how i can make it?
I'd create an instance of asynchronous application that handles all long running
events.
The async app needs to keep multiple queues for different
users and when an ordinary (sync) application handles the rest.
Now when new message arrives you just need to notify an async. app on such
a message and push it to an appropriate queue. Note if you push a message
from sync. app. to async. one you need to pass it via service().post()
to the thread that runs the event loop.
std::string new_message=...,user=...; service().post([=]{
// will be executed in event loop's thread
global_async_app_ptr->handle_new_message_for_user(new_message,user);
});
Artyom Beilis
--------------
CppCMS - C++ Web Framework: http://cppcms.com/
CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
>
>
>------------------------------------------------------------------------------
>Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
>MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
>with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
>MVPs and experts. ON SALE this month only -- learn more at:
>http://p.sf.net/sfu/learnnow-d2d
>_______________________________________________
>Cppcms-users mailing list
>Cpp...@li...
>https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
>
|
|
From: Sergey S. <ser...@gm...> - 2013-01-28 12:58:15
|
Artyom Beilis <artyomtnk@...> writes: > > Try to explain what exactly you are trying to do and what behavior do you want. Im tryin make messaging, like a chat (facebook example) but between only two users. cppcms json rpc or sse? Artyom you can explain how i can make it? |
|
From: Marcel H. <ke...@co...> - 2013-01-24 11:26:22
|
Am 23.01.2013 14:50, schrieb Artyom Beilis: > I would suggest in general... > > Not get into situations where you can get a error, or at least if you > expect a error catch it. Think of registration. A Username should be unique and a email adrress should be unique too. I will not check this, because IMO this is a task for the database. > > What kind of errors can happen: > > 1. Constrain violation: > * Check it before from a transaction assuming isolation > * Catch at specific point - assume that the error is constraint > violation. > 2. Deadlock - due to colliding statements - not much to do. Or let 500 > response to happen or catch a cppdb error at the root of you > app hierarchy main and say (oops) > 3. Connection errors or other stuff - 500 is more than reasonable - or > do it what you did in 2 > > Now about specific errors. > > Probably it would be good idea to derive several sub exceptions like: > > cppdb::constraint_error > cppdb::deadlock_error > cppdb::connection_error Could be good, but there are over 100 errors that can happen while you execute a statement. But i will have a look and see what i can do. > > Similarly to the current > set: http://cppcms.com/sql/cppdb/classcppdb_1_1cppdb__error.html > > Maybe some more I can't think about them right now. > > But this requires some code writing and what is even more important - > updating each backend and probably > the most hard would be ODBC. > > Any volunteers? > > > Artyom Beilis Marcel |
|
From: Artyom B. <art...@ya...> - 2013-01-23 13:50:30
|
I would suggest in general... Not get into situations where you can get a error, or at least if you expect a error catch it. What kind of errors can happen: 1. Constrain violation: * Check it before from a transaction assuming isolation * Catch at specific point - assume that the error is constraint violation. 2. Deadlock - due to colliding statements - not much to do. Or let 500 response to happen or catch a cppdb error at the root of you app hierarchy main and say (oops) 3. Connection errors or other stuff - 500 is more than reasonable - or do it what you did in 2 Now about specific errors. Probably it would be good idea to derive several sub exceptions like: cppdb::constraint_error cppdb::deadlock_error cppdb::connection_error Similarly to the current set: http://cppcms.com/sql/cppdb/classcppdb_1_1cppdb__error.html Maybe some more I can't think about them right now. But this requires some code writing and what is even more important - updating each backend and probably the most hard would be ODBC. Any volunteers? Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Marcel Hellwig <ke...@co...> >To: cpp...@li... >Sent: Wednesday, January 23, 2013 2:35 PM >Subject: [Cppcms-users] How to catch CPPDB errors > >-----BEGIN PGP SIGNED MESSAGE----- >Hash: SHA1 > >Hi everyone, > >I'd like to know the "correct" way of handling errors in cppdb >statements. >If I do something like this: > "INSERT INTO ...." << cppdb::exec; >and there will be an error, a 500 respond will be given to the client. >Not that nice. >Next try was to catch the exception: > > try { > "INSERT INTO ...." << cppdb::exec; > } catch(cppdb::cppdb_error const &e) { > //what can we do here? > } > >Nice try, but cppdb_error has only the method what() and what gives me >back a char* with the error description. But there could be more than >one error in that query. That's why there are error codes. But >unfortunately every sql provider has different error codes. >Another problem with cppdb error is that the message will be >localized, so you cannot parse it. > >So... what is the right way to do this? > >Regards >-----BEGIN PGP SIGNATURE----- >Version: GnuPG v1.4.13 (GNU/Linux) >Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ > >iQIcBAEBAgAGBQJQ/9kvAAoJEIROXYQnkAHpZPEQAJwW8mdI96vYANq+9Akaf65C >ykNGxrygD87HMizKQ0EPhH7qS1KuvvjYHL1z+eryEOHcILsRfvbnaHRsCAGlq6Lk >hMNrCzKeMQpcKkkYqBN4YGHzXMA+slsnQVNRQtpi7QrB3Veeg5M4Unm2tYZJenUH >HNRM1rIqqih0R2swYTZa9HXVqNkZyC9ssPo5YUtd5KK/qftv5mb5fbUgh5TIoYh6 >2GqTEZJYqamMeLnUjTGkZ2EOnz07KGPlW0/PBrhYdeTIxesHIKQC3flDKvWPX8cL >CA0N4uTiAg7EF6L8CJ+CsmsEBe1wa6TSncShcqmqImM0K1ZBmFG/e1AThC80biW2 >u/0A2pBfMqxdJFXDBg+/CS3ewu5A9UFX79bT0EfiZm3cLwsrLZ0bYvsC/c/aAG2v >7UfENgldy+79Rk4nUS6ZQxKbMJRmOxznsMrCrAPZl4es1VcNpfm5Drsvm6VV4sCs >0KBqN11o8rZMfLj8fWc139PwJjKGqcGW8xRjykhpWpDFwennygTBz0Hqn0BJf9Of >8nENk0bPoORGtqcgR2hf5Yp4HrM7QBP2+/hTdWNmrur+pr6tnP08U13hcBZtNlur >swTucg5WVp1GjHAmf9BZozEHhKZAY7sJZvWAZQJrbcfdYywTO9y6hERj/5sS2J2P >EmlSmccnwf7Slmw7+5n6 >=CiN2 >-----END PGP SIGNATURE----- > >------------------------------------------------------------------------------ >Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >MVPs and experts. ON SALE this month only -- learn more at: >http://p.sf.net/sfu/learnnow-d2d >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: Marcel H. <ke...@co...> - 2013-01-23 12:36:10
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi everyone,
I'd like to know the "correct" way of handling errors in cppdb
statements.
If I do something like this:
"INSERT INTO ...." << cppdb::exec;
and there will be an error, a 500 respond will be given to the client.
Not that nice.
Next try was to catch the exception:
try {
"INSERT INTO ...." << cppdb::exec;
} catch(cppdb::cppdb_error const &e) {
//what can we do here?
}
Nice try, but cppdb_error has only the method what() and what gives me
back a char* with the error description. But there could be more than
one error in that query. That's why there are error codes. But
unfortunately every sql provider has different error codes.
Another problem with cppdb error is that the message will be
localized, so you cannot parse it.
So... what is the right way to do this?
Regards
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBAgAGBQJQ/9kvAAoJEIROXYQnkAHpZPEQAJwW8mdI96vYANq+9Akaf65C
ykNGxrygD87HMizKQ0EPhH7qS1KuvvjYHL1z+eryEOHcILsRfvbnaHRsCAGlq6Lk
hMNrCzKeMQpcKkkYqBN4YGHzXMA+slsnQVNRQtpi7QrB3Veeg5M4Unm2tYZJenUH
HNRM1rIqqih0R2swYTZa9HXVqNkZyC9ssPo5YUtd5KK/qftv5mb5fbUgh5TIoYh6
2GqTEZJYqamMeLnUjTGkZ2EOnz07KGPlW0/PBrhYdeTIxesHIKQC3flDKvWPX8cL
CA0N4uTiAg7EF6L8CJ+CsmsEBe1wa6TSncShcqmqImM0K1ZBmFG/e1AThC80biW2
u/0A2pBfMqxdJFXDBg+/CS3ewu5A9UFX79bT0EfiZm3cLwsrLZ0bYvsC/c/aAG2v
7UfENgldy+79Rk4nUS6ZQxKbMJRmOxznsMrCrAPZl4es1VcNpfm5Drsvm6VV4sCs
0KBqN11o8rZMfLj8fWc139PwJjKGqcGW8xRjykhpWpDFwennygTBz0Hqn0BJf9Of
8nENk0bPoORGtqcgR2hf5Yp4HrM7QBP2+/hTdWNmrur+pr6tnP08U13hcBZtNlur
swTucg5WVp1GjHAmf9BZozEHhKZAY7sJZvWAZQJrbcfdYywTO9y6hERj/5sS2J2P
EmlSmccnwf7Slmw7+5n6
=CiN2
-----END PGP SIGNATURE-----
|
|
From: Artyom B. <art...@ya...> - 2013-01-22 13:56:08
|
Strange! - Compiler, platform, OS information please - Can you show the full code or provide a sample that would reproduce the error - How do you compile the code. - Can you show the exact compiler output. - How did you build CppCMS have you altered it? Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Messianos Messianos <mes...@gm...> >To: cpp...@li... >Sent: Tuesday, January 22, 2013 3:48 PM >Subject: [Cppcms-users] Build problem with Forms > > >Hello, > >We are having troubles including a login form in our project. >We follow the steps in http://cppcms.com/wikipp/en/page/cppcms_1x_forms > >This is the definition of the form: > >struct SignInFormInfo : public cppcms::form { >/* Error 1 */ cppcms::widgets::text user_name; >/* Error 2 */ cppcms::widgets::password password; >cppcms::widgets::submit submit; > >SignInFormInfo() { >user_name.message("User name"); >password.message("Password"); >submit.value("Sign in"); > >add(user_name); >add(password); >add(submit); > >// Restrictions >user_name.limits(1, 31); >password.non_empty(); >} >}; > >and we get these build errors: > >Error 1: The type 'cppcms::widgets::text' must implement the inherited >pure virtual method 'cppcms::base_form::load' >Error 2: The type 'cppcms::widgets::password' must implement the >inherited pure virtual method >'cppcms::widgets::base_widget::render_input' > >We also get errors in the cppcms libraries "cppcms/form.h" and >"booster/hold_ptr.h" about the variable "_data" being private. > >We are using 1.0.3 version of CppCMS. > >Thanks for your help > >Messianos Team > >------------------------------------------------------------------------------ >Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >MVPs and experts. ON SALE this month only -- learn more at: >http://p.sf.net/sfu/learnnow-d2d >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: Messianos M. <mes...@gm...> - 2013-01-22 13:49:04
|
Hello, We are having troubles including a login form in our project. We follow the steps in http://cppcms.com/wikipp/en/page/cppcms_1x_forms This is the definition of the form: struct SignInFormInfo : public cppcms::form { /* Error 1 */ cppcms::widgets::text user_name; /* Error 2 */ cppcms::widgets::password password; cppcms::widgets::submit submit; SignInFormInfo() { user_name.message("User name"); password.message("Password"); submit.value("Sign in"); add(user_name); add(password); add(submit); // Restrictions user_name.limits(1, 31); password.non_empty(); } }; and we get these build errors: Error 1: The type 'cppcms::widgets::text' must implement the inherited pure virtual method 'cppcms::base_form::load' Error 2: The type 'cppcms::widgets::password' must implement the inherited pure virtual method 'cppcms::widgets::base_widget::render_input' We also get errors in the cppcms libraries "cppcms/form.h" and "booster/hold_ptr.h" about the variable "_data" being private. We are using 1.0.3 version of CppCMS. Thanks for your help Messianos Team |
|
From: Artyom B. <art...@ya...> - 2013-01-21 10:25:19
|
The obvious would be to cleanup the storage in the factory destructor. If the applications shuts down properly (using SIGTERM for example) than the destructor should be called. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Christian Gmeiner <chr...@gm...> >To: cpp...@li... >Sent: Monday, January 21, 2013 12:19 PM >Subject: [Cppcms-users] Destroying all sessions on application exit > >Hi. > >I am using a custom session_storage, which creates a temporary folder >for each user-session at a defined path - e.g. /media/session_storage. > > >namespace cppcms { >namespace sessions { > > class session_memory_ext_storage_factory; > > class CPPCMS_API session_memory_ext_storage : public session_storage { > public: > session_memory_ext_storage(std::string const &base) : base_(base) {} > virtual ~session_memory_ext_storage() {} > > virtual void save(std::string const &key,time_t to,std::string >const &value); > virtual bool load(std::string const &key,time_t &to,std::string &value); > virtual void remove(std::string const &key); > virtual bool is_blocking(); > > private: > void gc(); > bool removeRecursively(const QString &path); > > typedef std::multimap<time_t,std::string> timeout_type; > struct _data { > time_t timeout; > std::string info; > std::string path; > timeout_type::iterator timeout_ptr; > }; > typedef boost::unordered_map<std::string,_data> map_type; > map_type map_; > timeout_type timeout_; > booster::shared_mutex mutex_; > > std::string base_; > > friend class session_memory_ext_storage_factory; > }; > > class CPPCMS_API session_memory_ext_storage_factory : public >session_storage_factory { > public: > session_memory_ext_storage_factory(std::string const &base); > virtual booster::shared_ptr<session_storage> get(); > virtual bool requires_gc(); > virtual void gc_job(); > virtual ~session_memory_ext_storage_factory(); > private: > booster::shared_ptr<session_memory_ext_storage> storage_; > }; > >} // sessions >} // cppcms > > >If i kill the cppcms based application some session folders are still >existent. Is there a way to clean-up all sessions on application exit? > >thanks >-- >Christian Gmeiner, MSc > >------------------------------------------------------------------------------ >Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >MVPs and experts. SALE $99.99 this month only -- learn more at: >http://p.sf.net/sfu/learnmore_122412 >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: Christian G. <chr...@gm...> - 2013-01-21 10:20:21
|
Hi.
I am using a custom session_storage, which creates a temporary folder
for each user-session at a defined path - e.g. /media/session_storage.
namespace cppcms {
namespace sessions {
class session_memory_ext_storage_factory;
class CPPCMS_API session_memory_ext_storage : public session_storage {
public:
session_memory_ext_storage(std::string const &base) : base_(base) {}
virtual ~session_memory_ext_storage() {}
virtual void save(std::string const &key,time_t to,std::string
const &value);
virtual bool load(std::string const &key,time_t &to,std::string &value);
virtual void remove(std::string const &key);
virtual bool is_blocking();
private:
void gc();
bool removeRecursively(const QString &path);
typedef std::multimap<time_t,std::string> timeout_type;
struct _data {
time_t timeout;
std::string info;
std::string path;
timeout_type::iterator timeout_ptr;
};
typedef boost::unordered_map<std::string,_data> map_type;
map_type map_;
timeout_type timeout_;
booster::shared_mutex mutex_;
std::string base_;
friend class session_memory_ext_storage_factory;
};
class CPPCMS_API session_memory_ext_storage_factory : public
session_storage_factory {
public:
session_memory_ext_storage_factory(std::string const &base);
virtual booster::shared_ptr<session_storage> get();
virtual bool requires_gc();
virtual void gc_job();
virtual ~session_memory_ext_storage_factory();
private:
booster::shared_ptr<session_memory_ext_storage> storage_;
};
} // sessions
} // cppcms
If i kill the cppcms based application some session folders are still
existent. Is there a way to clean-up all sessions on application exit?
thanks
--
Christian Gmeiner, MSc
|
|
From: Marcel H. <ke...@co...> - 2013-01-21 10:17:09
|
>> >> Am 20.01.2013 20:00, schrieb Artyom Beilis: >>> 1. Try to upgrade CppCMS, because in 1.0.3 the automatic type >>> detection is already done in headers. >> As I said, i am on master (it's a term from git, but I think it exist >> in svn too. Means i have the latest svn revision checked out) > > > Are you using the correct SVN repo? > > Recently (several months ago) the repository migrated to > the new location: > > See: http://cppcms.com/wikipp/en/page/cppcms_1x_build#Getting.The.Sources > Come on Artyom. I wrote you 2 weeks ago to change the url on the sourceforge page, do you remember? And to prove it: svn info Path: . Working Copy Root Path: /home/marcel/tmp/cppcms/cppcms URL: http://svn.code.sf.net/p/cppcms/code/framework/trunk Repository Root: http://svn.code.sf.net/p/cppcms/code Repository UUID: 831565cc-8e21-4ad5-8334-98019c97bd36 Revision: 2238 Node Kind: directory Schedule: normal Last Changed Author: artyom-beilis Last Changed Rev: 2238 Last Changed Date: 2013-01-09 21:39:06 +0100 (Wed, 09 Jan 2013) Regards |
|
From: bruce x. <bru...@gm...> - 2013-01-21 08:10:29
|
Thanks,
I don't known when the exception will reproduce. I'll fix it and rebuild
cppcms. No matter if the exception reproduces, I will tell you~
2013/1/21 Artyom Beilis <art...@ya...>
> Ok,
>
>
> this is incorrect code:
>
>
> 86 endpoint basic_socket::remote_endpoint(system::error_code &e)
> 87 {
> 88 std::vector<char> endpoint_raw_(1000,0); // apply 1000 bytes
> 89 sockaddr *sa = reinterpret_cast<sockaddr
> *>(&endpoint_raw_.front());
> 90 socklen_t len = endpoint_raw_.size();
> 91 if(::getpeername(native(),sa,&len) < 0)
> 92 e=geterror();
> 93 endpoint ep;
> 94 ep.raw(sa,len); // An exception thrown
> 95 return ep;
> 96 }
>
>
>
> It should be
>
>
> endpoint basic_socket::remote_endpoint(system::error_code &e)
> {
> std::vector<char> endpoint_raw_(1000,0); // apply 1000 bytes
> sockaddr *sa = reinterpret_cast<sockaddr *>(&endpoint_raw_.front());
> socklen_t len = endpoint_raw_.size();
> endpoint ep;
> if(::getpeername(native(),sa,&len) < 0) {
> e=geterror();
> return ep;
> }
> ep.raw(sa,len); // An exception thrown
> return ep;
> }
>
> Can you please check if it helps?
>
>
>
>
> Artyom Beilis
> --------------
> CppCMS - C++ Web Framework: http://cppcms.com/
> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
>
> ------------------------------
> *From:* bruce xiu <bru...@gm...>
> *To:* cpp...@li...
> *Sent:* Monday, January 21, 2013 6:03 AM
> *Subject:* [Cppcms-users] exception about endpoint
>
> Hi, everyone, I set up a web service server using cppcms-1.0.2 some time
> ago , outside is nginx, and it went well. A weeks ago, I removed the nginx
> when I put the app to another server. And then an exception often
> occured. The following is exception and trace :
>
> -- aio::: invalid endpoint
> 0x7f7dc7acda18: booster::aio::endpoint::throw_invalid() const + 0xe8 in
> PATH_TO_LIBS/libbooster.so.0
> 0x7f7dc7acdc75: booster::aio::endpoint::raw(sockaddr const*, int) + 0x25
> in PATH_TO_LIBS/libbooster.so.0
> 0x7f7dc7ad948b:
> booster::aio::basic_socket::remote_endpoint(booster::system::error_code&) +
> 0xab in PATH_TO_LIBS/libbooster.so.0
> 0x7f7dc7f00645:
> cppcms::impl::cgi::http::process_request(booster::callback<void
> (booster::system::error_code const&)> const&) + 0x3b5 in
> PATH_TO_LIBS/libcppcms.so.1
> 0x7f7dc7f0154b:
> cppcms::impl::cgi::http::some_headers_data_read(booster::system::error_code
> const&, unsigned long, booster::callback<void (booster::system::error_code
> const&)> const&) + 0x32b in PATH_TO_LIBS/libcppcms.so.1
> 0x7f7dc7ade609: ??? + 0xc7ade609 in PATH_TO_LIBS/libbooster.so.0
> 0x7f7dc7ad0c6c: booster::callback<void ()>::callable_impl<void,
> booster::aio::event_loop_impl::event_handler_dispatcher>::operator()() +
> 0x1c in PATH_TO_LIBS/libbooster.so.0
> 0x7f7dc7ad2176:
> booster::aio::event_loop_impl::run_one(booster::aio::reactor::event*,
> unsigned long) + 0x106 in PATH_TO_LIBS/libbooster.so.0
> 0x7f7dc7acf3e8: booster::aio::io_service::run() + 0x78 in
> PATH_TO_LIBS/libbooster.so.0
> 0x7f7dc7e18c85: cpp
> cms::service::run() + 0x65 in PATH_TO_LIBS/libcppcms.so.1
>
> Then I traced the exception in code, and found the function in
> booster/lib/aio/src/basic_socket.cpp
>
> 86 endpoint basic_socket::remote_endpoint(system::error_code &e)
> 87 {
> 88 std::vector<char> endpoint_raw_(1000,0); // apply 1000 bytes
> 89 sockaddr *sa = reinterpret_cast<sockaddr
> *>(&endpoint_raw_.front());
> 90 socklen_t len = endpoint_raw_.size();
> 91 if(::getpeername(native(),sa,&len) < 0)
> 92 e=geterror();
> 93 endpoint ep;
> 94 ep.raw(sa,len); // An exception thrown
> 95 return ep;
> 96 }
>
> in booster/lib/aio/src/endpoint.cpp
>
> 228 void endpoint::raw(sockaddr const *p,int size)
> 229 {
> 230 if(size > int(sizeof(d->sa))) // sizeof(d->sa) is 256
> 231 throw_invalid(); //from here
> 232 d->size=size;
> 233 memcpy(&d->sa.sa,p,size);
> 234 }
>
> remote_endpoint doesn't handle this exception. I don't know the reason of
> the exception exactly, I doubt that someone makes trouble deliberately.
> In getpeername(), when len > 256 && len <= 1000, an exception will be
> thrown, normally sockaddr won't be so long.Then I want to modify the source
> in remote_endpoint
>
> >>>std::vector<char> endpoint_raw_(1000,0)
> <<<std::vector<char> endpoint_raw_(256, 0)
>
> then getpeername will handle the exception and return -1, and geterror()
> will run.
>
> It will cause any problem?
>
> --
> ZhiXin XIU
>
> Computer Science & Engineering Dept.,
> Shanghai Jiao Tong University,
> 800 Dongchuan Rd., Shanghai,
> CHINA
>
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. SALE $99.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122412
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
>
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. SALE $99.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122412
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
--
ZhiXin XIU
Computer Science & Engineering Dept.,
Shanghai Jiao Tong University,
800 Dongchuan Rd., Shanghai,
CHINA
|
|
From: Artyom B. <art...@ya...> - 2013-01-21 07:54:51
|
No, there is no such feature, also you should notice that CppCMS may work behind FastCGI or SCGI and not with HTTP directly. Also you may probably use HTTP redirection or if you can distinguish between the "Poxy" links and normal links by request only you can use URL rewriting at web server side. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ ----- Original Message ----- > From: Sab <rim...@gm...> > To: cpp...@li... > Cc: > Sent: Friday, January 18, 2013 2:35 PM > Subject: [Cppcms-users] Proxy > > Hi guys, > > I would like to implement something like a proxy. In a normal case I process > http requests in my CppCMS application from clients and return some response > but in some special cases I need to function as a client: to send the request > further to another webserver, get some resource back as response and return > that as my response to my client. Any suggestions how I could realize this > with the least effort? > > I found some libraries that could do the trick but I was wondering if I > could do the same thing by only using CppCMS. > > If the answer is no, I would appreciate some suggestions from those of you, > who already used a library that can do it (e.g. libcurl, poco, etc). > > Sab > > > ------------------------------------------------------------------------------ > Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and > much more. Get web development skills now with LearnDevNow - > 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. > SALE $99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122812 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
|
From: Artyom B. <art...@ya...> - 2013-01-21 07:47:17
|
Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Marcel Hellwig <ke...@co...> >To: Artyom Beilis <art...@ya...>; cpp...@li... >Sent: Sunday, January 20, 2013 9:26 PM >Subject: Re: [Cppcms-users] message board fails to build > >-----BEGIN PGP SIGNED MESSAGE----- >Hash: SHA1 > >Am 20.01.2013 20:00, schrieb Artyom Beilis: >> 1. Try to upgrade CppCMS, because in 1.0.3 the automatic type >> detection is already done in headers. >As I said, i am on master (it's a term from git, but I think it exist >in svn too. Means i have the latest svn revision checked out) Are you using the correct SVN repo? Recently (several months ago) the repository migrated to the new location: See: http://cppcms.com/wikipp/en/page/cppcms_1x_build#Getting.The.Sources Regards Artyom |
|
From: Artyom B. <art...@ya...> - 2013-01-21 07:45:27
|
Ok,
this is incorrect code:
86 endpoint basic_socket::remote_endpoint(system::error_code &e)
87 {
88 std::vector<char> endpoint_raw_(1000,0); // apply 1000 bytes
89 sockaddr *sa = reinterpret_cast<sockaddr *>(&endpoint_raw_.front());
90 socklen_t len = endpoint_raw_.size();
91 if(::getpeername(native(),sa,&len) < 0)
92 e=geterror();
93 endpoint ep;
94 ep.raw(sa,len); // An exception thrown
95 return ep;
96 }
It should be
endpoint basic_socket::remote_endpoint(system::error_code &e)
{
std::vector<char> endpoint_raw_(1000,0); // apply 1000 bytes
sockaddr *sa = reinterpret_cast<sockaddr *>(&endpoint_raw_.front());
socklen_t len = endpoint_raw_.size();
endpoint ep; if(::getpeername(native(),sa,&len) < 0) {
e=geterror();
return ep;
}
ep.raw(sa,len); // An exception thrown
return ep;
}
Can you please check if it helps?
Artyom Beilis
--------------
CppCMS - C++ Web Framework: http://cppcms.com/
CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
>________________________________
> From: bruce xiu <bru...@gm...>
>To: cpp...@li...
>Sent: Monday, January 21, 2013 6:03 AM
>Subject: [Cppcms-users] exception about endpoint
>
>
>Hi, everyone, I set up a web service server using cppcms-1.0.2 some time ago , outside is nginx, and it went well. A weeks ago, I removed the nginx when I put the app to another server. And then an exception often occured. The following is exception and trace :
>
>-- aio::: invalid endpoint
>0x7f7dc7acda18: booster::aio::endpoint::throw_invalid() const + 0xe8 in PATH_TO_LIBS/libbooster.so.0
>0x7f7dc7acdc75: booster::aio::endpoint::raw(sockaddr const*, int) + 0x25 in PATH_TO_LIBS/libbooster.so.0
>0x7f7dc7ad948b: booster::aio::basic_socket::remote_endpoint(booster::system::error_code&) + 0xab in PATH_TO_LIBS/libbooster.so.0
>0x7f7dc7f00645: cppcms::impl::cgi::http::process_request(booster::callback<void (booster::system::error_code const&)> const&) + 0x3b5 in PATH_TO_LIBS/libcppcms.so.1
>0x7f7dc7f0154b: cppcms::impl::cgi::http::some_headers_data_read(booster::system::error_code const&, unsigned long, booster::callback<void (booster::system::error_code const&)> const&) + 0x32b in PATH_TO_LIBS/libcppcms.so.1
>0x7f7dc7ade609: ??? + 0xc7ade609 in PATH_TO_LIBS/libbooster.so.0
>0x7f7dc7ad0c6c: booster::callback<void ()>::callable_impl<void, booster::aio::event_loop_impl::event_handler_dispatcher>::operator()() + 0x1c in PATH_TO_LIBS/libbooster.so.0
>0x7f7dc7ad2176: booster::aio::event_loop_impl::run_one(booster::aio::reactor::event*, unsigned long) + 0x106 in PATH_TO_LIBS/libbooster.so.0
>0x7f7dc7acf3e8: booster::aio::io_service::run() + 0x78 in PATH_TO_LIBS/libbooster.so.0
>0x7f7dc7e18c85: cpp
>cms::service::run() + 0x65 in PATH_TO_LIBS/libcppcms.so.1
>
>
>Then I traced the exception in code, and found the function in booster/lib/aio/src/basic_socket.cpp
>
>
>86 endpoint basic_socket::remote_endpoint(system::error_code &e)
> 87 {
> 88 std::vector<char> endpoint_raw_(1000,0); // apply 1000 bytes
> 89 sockaddr *sa = reinterpret_cast<sockaddr *>(&endpoint_raw_.front());
> 90 socklen_t len = endpoint_raw_.size();
> 91 if(::getpeername(native(),sa,&len) < 0)
> 92 e=geterror();
> 93 endpoint ep;
> 94 ep.raw(sa,len); // An exception thrown
> 95 return ep;
> 96 }
>
>
>in booster/lib/aio/src/endpoint.cpp
>
>
>228 void endpoint::raw(sockaddr const *p,int size)
>229 {
>230 if(size > int(sizeof(d->sa))) // sizeof(d->sa) is 256
>231 throw_invalid(); //from here
>232 d->size=size;
>233 memcpy(&d->sa.sa,p,size);
>234 }
>
>
>remote_endpoint doesn't handle this exception. I don't know the reason of the exception exactly, I doubt that someone makes trouble deliberately.
>In getpeername(), when len > 256 && len <= 1000, an exception will be thrown, normally sockaddr won't be so long.Then I want to modify the source in remote_endpoint
>
>
>>>>std::vector<char> endpoint_raw_(1000,0)
><<<std::vector<char> endpoint_raw_(256, 0)
>
>
>then getpeername will handle the exception and return -1, and geterror() will run.
>
>
>It will cause any problem?
>
>--
>ZhiXin XIU
>
>Computer Science & Engineering Dept.,
>Shanghai Jiao Tong University,
>800 Dongchuan Rd., Shanghai,
>CHINA
>------------------------------------------------------------------------------
>Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
>MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
>with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
>MVPs and experts. SALE $99.99 this month only -- learn more at:
>http://p.sf.net/sfu/learnmore_122412
>_______________________________________________
>Cppcms-users mailing list
>Cpp...@li...
>https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
> |
|
From: bruce x. <bru...@gm...> - 2013-01-21 04:03:32
|
Hi, everyone, I set up a web service server using cppcms-1.0.2 some time
ago , outside is nginx, and it went well. A weeks ago, I removed the nginx
when I put the app to another server. And then an exception often
occured. The following is exception and trace :
-- aio::: invalid endpoint
0x7f7dc7acda18: booster::aio::endpoint::throw_invalid() const + 0xe8 in
PATH_TO_LIBS/libbooster.so.0
0x7f7dc7acdc75: booster::aio::endpoint::raw(sockaddr const*, int) + 0x25 in
PATH_TO_LIBS/libbooster.so.0
0x7f7dc7ad948b:
booster::aio::basic_socket::remote_endpoint(booster::system::error_code&) +
0xab in PATH_TO_LIBS/libbooster.so.0
0x7f7dc7f00645:
cppcms::impl::cgi::http::process_request(booster::callback<void
(booster::system::error_code const&)> const&) + 0x3b5 in
PATH_TO_LIBS/libcppcms.so.1
0x7f7dc7f0154b:
cppcms::impl::cgi::http::some_headers_data_read(booster::system::error_code
const&, unsigned long, booster::callback<void (booster::system::error_code
const&)> const&) + 0x32b in PATH_TO_LIBS/libcppcms.so.1
0x7f7dc7ade609: ??? + 0xc7ade609 in PATH_TO_LIBS/libbooster.so.0
0x7f7dc7ad0c6c: booster::callback<void ()>::callable_impl<void,
booster::aio::event_loop_impl::event_handler_dispatcher>::operator()() +
0x1c in PATH_TO_LIBS/libbooster.so.0
0x7f7dc7ad2176:
booster::aio::event_loop_impl::run_one(booster::aio::reactor::event*,
unsigned long) + 0x106 in PATH_TO_LIBS/libbooster.so.0
0x7f7dc7acf3e8: booster::aio::io_service::run() + 0x78 in
PATH_TO_LIBS/libbooster.so.0
0x7f7dc7e18c85: cppcms::service::run() + 0x65 in PATH_TO_LIBS/libcppcms.so.1
Then I traced the exception in code, and found the function in
booster/lib/aio/src/basic_socket.cpp
86 endpoint basic_socket::remote_endpoint(system::error_code &e)
87 {
88 std::vector<char> endpoint_raw_(1000,0); // apply 1000 bytes
89 sockaddr *sa = reinterpret_cast<sockaddr *>(&endpoint_raw_.front());
90 socklen_t len = endpoint_raw_.size();
91 if(::getpeername(native(),sa,&len) < 0)
92 e=geterror();
93 endpoint ep;
94 ep.raw(sa,len); // An exception thrown
95 return ep;
96 }
in booster/lib/aio/src/endpoint.cpp
228 void endpoint::raw(sockaddr const *p,int size)
229 {
230 if(size > int(sizeof(d->sa))) // sizeof(d->sa) is 256
231 throw_invalid(); //from here
232 d->size=size;
233 memcpy(&d->sa.sa,p,size);
234 }
remote_endpoint doesn't handle this exception. I don't know the reason of
the exception exactly, I doubt that someone makes trouble deliberately.
In getpeername(), when len > 256 && len <= 1000, an exception will be
thrown, normally sockaddr won't be so long.Then I want to modify the source
in remote_endpoint
>>>std::vector<char> endpoint_raw_(1000,0)
<<<std::vector<char> endpoint_raw_(256, 0)
then getpeername will handle the exception and return -1, and geterror()
will run.
It will cause any problem?
--
ZhiXin XIU
Computer Science & Engineering Dept.,
Shanghai Jiao Tong University,
800 Dongchuan Rd., Shanghai,
CHINA
|