cppcms-users Mailing List for CppCMS C++ Web Framework (Page 58)
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: Artyom B. <art...@ya...> - 2013-04-30 04:48:36
|
Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ ----- Original Message ----- > From: Jean-Marc Choulet <jm1...@gm...> > To: "cpp...@li..." <cpp...@li...> > Cc: > Sent: Monday, April 29, 2013 8:41 PM > Subject: [Cppcms-users] Windows Service and cppcms > > Hello, > > At work, we need to build somes WebServices on Windows 2008 R2. We don't > want to use script language to do theses WS. Make sure you are reading: http://cppcms.com/wikipp/en/page/notes_for_windows_users > My questions : > > - Is it possible to use cppcms under Windows 2008 R2 Server ? Yes > - Is it possible to compile cppcms with MinGW ? Yes, both mingw and VS are supported, you need quite latest mingw (gcc 4.5, 4.6) > - Is it possible to start cppcms http server as Windows Service ? Yes: http://cppcms.com/wikipp/en/page/cppcms_1x_config#winservice > > Thanks, > > Jean-Marc > > ------------------------------------------------------------------------------ > Try New Relic Now & We'll Send You this Cool Shirt > New Relic is the only SaaS-based application performance monitoring service > that delivers powerful full stack analytics. Optimize and monitor your > browser, app, & servers with just a few lines of code. Try New Relic > and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
|
From: Saikumar G. <sai...@gm...> - 2013-04-30 04:24:47
|
Great. The argument "url" solves my issue.
void loginpage(std::string url)
dispatcher().assign("/login", &server::loginpage, this,0);
With this I can lookup the associated page handler through command pattern
and it can be set in the configuration file.
Thanks.
|
|
From: Saikumar G. <sai...@gm...> - 2013-04-30 03:53:47
|
Good catch. You were right, I had generated the output before setting the cookie. Moving it before the response().out() solved this issue. Thank you. |
|
From: Jean-Marc C. <jm1...@gm...> - 2013-04-29 17:41:38
|
Hello, At work, we need to build somes WebServices on Windows 2008 R2. We don't want to use script language to do theses WS. My questions : - Is it possible to use cppcms under Windows 2008 R2 Server ? - Is it possible to compile cppcms with MinGW ? - Is it possible to start cppcms http server as Windows Service ? Thanks, Jean-Marc |
|
From: Marcel H. <ke...@co...> - 2013-04-29 06:57:28
|
On 29.04.2013 06:08, Saikumar Gandapodi wrote:
> The cookies set in the cppcms app is not visible in the response header at
> the client side.
>
> response().set_cookie(cppcms::http::cookie("COOKIE1","value"));
>
> The configuration is through fastcgi from lighttpd.
>
> fastcgi.server = (
> "/main" => ((
> "bin-path" => "/home/dev/myapp/myapp -c /home/dev/myapp/config.js",
> "socket" => "/tmp/hello-fcgi-socket",
> "max-procs" => 1,
> "check-local" => "disable"
> ))
> )
>
> Could it be because the lighttpd is not forwarding the cookies sent from the
> cppcms app ?
>
> Am I doing something wrong with the settings ?
Also you have to know, that the cookies are not visible immediately, but
on the next request from the client.
|
|
From: Artyom B. <art...@ya...> - 2013-04-29 06:33:21
|
What do you mean?
- You mean what parameter was given?
The obvious
void loginpage(std::string url)
dispatcher().assing("/login,&server::loginpage,this,0);
- What regular expression was used?
For "reverse" path generation you can use
URL mapping (the opposite of dispatching).
- What is the full mapping path? You can use CGI variables:
request().path_info() to get the full path.
Artyom Beilis
--------------
CppCMS - C++ Web Framework: http://cppcms.com/
CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
----- Original Message -----
> From: Saikumar Gandapodi <sai...@gm...>
> To: cpp...@li...
> Cc:
> Sent: Sunday, April 28, 2013 2:54 PM
> Subject: Re: [Cppcms-users] Page handlers from configuration
>
> If there is a mapping like this
>
> dispatcher().assign("/login", &Server::loginpage, this);
>
> Is possible to know the assigned path ( "login") at runtime from
> inside
> the loginpage() method ?
>
>
>
>
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
|
|
From: Artyom B. <art...@ya...> - 2013-04-29 06:28:51
|
> What is mapper().assign( "...", "..." ) used for? All my URL dispatching seems to work by only calling > dispatcher().assign(...) to set up the URLs with a callback function. > What concept am I not understanding that would require the mapper()? The opposite of dispatching :-) See: http://cppcms.com/wikipp/en/page/cppcms_1x_tut_url_mapping Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |
|
From: Artyom B. <art...@ya...> - 2013-04-29 06:26:07
|
It is most likely because you had already generated some output before setting the cookie. if you called response().out() - than the headers were generated and written to the output. So make sure you have no output requested. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Saikumar Gandapodi <sai...@gm...> >To: cpp...@li... >Sent: Monday, April 29, 2013 7:08 AM >Subject: [Cppcms-users] Cookies > > >The cookies set in the cppcms app is not visible in the response header at >the client side. > > response().set_cookie(cppcms::http::cookie("COOKIE1","value")); > >The configuration is through fastcgi from lighttpd. > >fastcgi.server = ( > "/main" => (( > "bin-path" => "/home/dev/myapp/myapp -c /home/dev/myapp/config.js", > "socket" => "/tmp/hello-fcgi-socket", > "max-procs" => 1, > "check-local" => "disable" > )) >) > >Could it be because the lighttpd is not forwarding the cookies sent from the >cppcms app ? > >Am I doing something wrong with the settings ? > > > >------------------------------------------------------------------------------ >Try New Relic Now & We'll Send You this Cool Shirt >New Relic is the only SaaS-based application performance monitoring service >that delivers powerful full stack analytics. Optimize and monitor your >browser, app, & servers with just a few lines of code. Try New Relic >and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: Saikumar G. <sai...@gm...> - 2013-04-29 04:08:59
|
The cookies set in the cppcms app is not visible in the response header at
the client side.
response().set_cookie(cppcms::http::cookie("COOKIE1","value"));
The configuration is through fastcgi from lighttpd.
fastcgi.server = (
"/main" => ((
"bin-path" => "/home/dev/myapp/myapp -c /home/dev/myapp/config.js",
"socket" => "/tmp/hello-fcgi-socket",
"max-procs" => 1,
"check-local" => "disable"
))
)
Could it be because the lighttpd is not forwarding the cookies sent from the
cppcms app ?
Am I doing something wrong with the settings ?
|
|
From: Troy W. <dr...@gm...> - 2013-04-28 21:53:48
|
Thank you. I was so frustrated with not being able to figure it out, the obvious things to do were no longer obvious to me! It was a simple typo on my part and it seems to work now, but the solution raises a further question. What is mapper().assign( "...", "..." ) used for? All my URL dispatching seems to work by only calling dispatcher().assign(...) to set up the URLs with a callback function. What concept am I not understanding that would require the mapper()? On Sun, Apr 28, 2013 at 9:47 PM, Artyom Beilis <art...@ya...> wrote: > make &>log.txt > > :-) > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > ------------------------------ > *From:* Troy Watson <dr...@gm...> > *To:* Artyom Beilis <art...@ya...>; > cpp...@li... > *Sent:* Sunday, April 28, 2013 12:32 PM > *Subject:* Re: [Cppcms-users] URL dispatching help > > Thanks for the help. I used the code from your reply, but it causes dozens > of template errors - so many that the terminal's output buffer overflows > and I can't scroll all the way up to where they begin! > > > On Sun, Apr 28, 2013 at 7:13 PM, Artyom Beilis <art...@ya...>wrote: > > > If you need two parameters i.e. go(std::string id,std::string urd) that > you need provide sleections for both, i.e. > dispatcher().assign( "/go/(\\d+)(.*)", &application::go, this, 1, 2 ); > > Where 1 - is first selected subexpression and 2 is the second one. > > Also I'm not sure but it seems that you need go(std::string id,std::string > url) without const. > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > ------------------------------ > *From:* Troy Watson <dr...@gm...> > *To:* cpp...@li... > *Sent:* Sunday, April 28, 2013 12:04 PM > *Subject:* [Cppcms-users] URL dispatching help > > Despite reading the docs and looking at the examples, I can't figure out > complex dispatching/mapping with regexes. I need some help please! > > My callback member function looks like this: void go( const std::string > id, const std::string url ) { ... } > And the URL to map to the function looks like this: /go/{integer > id}/{string url} > > For example: > /go/10/http://google.com - id=10, url=http://google.com > /go/2921/http://sourceforge.net - id=2921, url=http://sourceforge.net > > The best I could come up with was this: > > dispatcher().assign( "/go/(\\d+)(.*)", &application::go, this, 2 ); > mapper().assign( "go", "/go/{1}/{2}" ); > > ...but obviously that doesn't compile. What should the dispatcher and > mapper call look like to get the functionality I'm looking for? > > Thank you for such an excellent framework! > > > ------------------------------------------------------------------------------ > Try New Relic Now & We'll Send You this Cool Shirt > New Relic is the only SaaS-based application performance monitoring > service > that delivers powerful full stack analytics. Optimize and monitor your > browser, app, & servers with just a few lines of code. Try New Relic > and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > Try New Relic Now & We'll Send You this Cool Shirt > New Relic is the only SaaS-based application performance monitoring service > that delivers powerful full stack analytics. Optimize and monitor your > browser, app, & servers with just a few lines of code. Try New Relic > and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > Try New Relic Now & We'll Send You this Cool Shirt > New Relic is the only SaaS-based application performance monitoring > service > that delivers powerful full stack analytics. Optimize and monitor your > browser, app, & servers with just a few lines of code. Try New Relic > and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > Try New Relic Now & We'll Send You this Cool Shirt > New Relic is the only SaaS-based application performance monitoring service > that delivers powerful full stack analytics. Optimize and monitor your > browser, app, & servers with just a few lines of code. Try New Relic > and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |
|
From: Saikumar G. <sai...@gm...> - 2013-04-28 11:54:42
|
If there is a mapping like this
dispatcher().assign("/login", &Server::loginpage, this);
Is possible to know the assigned path ( "login") at runtime from inside
the loginpage() method ?
|
|
From: Artyom B. <art...@ya...> - 2013-04-28 11:47:21
|
make &>log.txt :-) Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Troy Watson <dr...@gm...> >To: Artyom Beilis <art...@ya...>; cpp...@li... >Sent: Sunday, April 28, 2013 12:32 PM >Subject: Re: [Cppcms-users] URL dispatching help > > > >Thanks for the help. I used the code from your reply, but it causes dozens of template errors - so many that the terminal's output buffer overflows and I can't scroll all the way up to where they begin! > > > >On Sun, Apr 28, 2013 at 7:13 PM, Artyom Beilis <art...@ya...> wrote: > > >>If you need two parameters i.e. go(std::string id,std::string urd) that you need provide sleections for both, i.e. >>dispatcher().assign( "/go/(\\d+)(.*)", &application::go, this, 1, 2 ); >> >>Where 1 - is first selected subexpression and 2 is the second one. >> >>Also I'm not sure but it seems that you need go(std::string id,std::string url) without const. >> >>Artyom Beilis >>-------------- >>CppCMS - C++ Web Framework: http://cppcms.com/ >>CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >> >> >> >>>________________________________ >>> From: Troy Watson <dr...@gm...> >>>To: cpp...@li... >>>Sent: Sunday, April 28, 2013 12:04 PM >>>Subject: [Cppcms-users] URL dispatching help >>> >>> >>> >>>Despite reading the docs and looking at the examples, I can't figure out complex dispatching/mapping with regexes. I need some help please! >>> >>> >>>My callback member function looks like this: void go( const std::string id, const std::string url ) { ... } >>>And the URL to map to the function looks like this: /go/{integer id}/{string url} >>> >>> >>>For example: >>>/go/10/http://google.com - id=10, url=http://google.com >>>/go/2921/http://sourceforge.net - id=2921, url=http://sourceforge.net >>> >>> >>>The best I could come up with was this: >>> >>> >>> dispatcher().assign( "/go/(\\d+)(.*)", &application::go, this, 2 ); >>> >>> mapper().assign( "go", "/go/{1}/{2}" ); >>> >>> >>>...but obviously that doesn't compile. What should the dispatcher and mapper call look like to get the functionality I'm looking for? >>> >>> >>>Thank you for such an excellent framework! >>>------------------------------------------------------------------------------ >>>Try New Relic Now & We'll Send You this Cool Shirt >>>New Relic is the only SaaS-based application performance monitoring service >>>that delivers powerful full stack analytics. Optimize and monitor your >>>browser, app, & servers with just a few lines of code. Try New Relic >>>and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr >>>_______________________________________________ >>>Cppcms-users mailing list >>>Cpp...@li... >>>https://lists.sourceforge.net/lists/listinfo/cppcms-users >>> >>> >>> >>------------------------------------------------------------------------------ >>Try New Relic Now & We'll Send You this Cool Shirt >>New Relic is the only SaaS-based application performance monitoring service >>that delivers powerful full stack analytics. Optimize and monitor your >>browser, app, & servers with just a few lines of code. Try New Relic >>and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr >>_______________________________________________ >>Cppcms-users mailing list >>Cpp...@li... >>https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> > >------------------------------------------------------------------------------ >Try New Relic Now & We'll Send You this Cool Shirt >New Relic is the only SaaS-based application performance monitoring service >that delivers powerful full stack analytics. Optimize and monitor your >browser, app, & servers with just a few lines of code. Try New Relic >and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: Troy W. <dr...@gm...> - 2013-04-28 09:32:40
|
Thanks for the help. I used the code from your reply, but it causes dozens of template errors - so many that the terminal's output buffer overflows and I can't scroll all the way up to where they begin! On Sun, Apr 28, 2013 at 7:13 PM, Artyom Beilis <art...@ya...> wrote: > > If you need two parameters i.e. go(std::string id,std::string urd) that > you need provide sleections for both, i.e. > dispatcher().assign( "/go/(\\d+)(.*)", &application::go, this, 1, 2 ); > > Where 1 - is first selected subexpression and 2 is the second one. > > Also I'm not sure but it seems that you need go(std::string id,std::string > url) without const. > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > ------------------------------ > *From:* Troy Watson <dr...@gm...> > *To:* cpp...@li... > *Sent:* Sunday, April 28, 2013 12:04 PM > *Subject:* [Cppcms-users] URL dispatching help > > Despite reading the docs and looking at the examples, I can't figure out > complex dispatching/mapping with regexes. I need some help please! > > My callback member function looks like this: void go( const std::string > id, const std::string url ) { ... } > And the URL to map to the function looks like this: /go/{integer > id}/{string url} > > For example: > /go/10/http://google.com - id=10, url=http://google.com > /go/2921/http://sourceforge.net - id=2921, url=http://sourceforge.net > > The best I could come up with was this: > > dispatcher().assign( "/go/(\\d+)(.*)", &application::go, this, 2 ); > mapper().assign( "go", "/go/{1}/{2}" ); > > ...but obviously that doesn't compile. What should the dispatcher and > mapper call look like to get the functionality I'm looking for? > > Thank you for such an excellent framework! > > > ------------------------------------------------------------------------------ > Try New Relic Now & We'll Send You this Cool Shirt > New Relic is the only SaaS-based application performance monitoring > service > that delivers powerful full stack analytics. Optimize and monitor your > browser, app, & servers with just a few lines of code. Try New Relic > and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > Try New Relic Now & We'll Send You this Cool Shirt > New Relic is the only SaaS-based application performance monitoring service > that delivers powerful full stack analytics. Optimize and monitor your > browser, app, & servers with just a few lines of code. Try New Relic > and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |
|
From: Artyom B. <art...@ya...> - 2013-04-28 09:13:12
|
If you need two parameters i.e. go(std::string id,std::string urd) that you need provide sleections for both, i.e. dispatcher().assign( "/go/(\\d+)(.*)", &application::go, this, 1, 2 ); Where 1 - is first selected subexpression and 2 is the second one. Also I'm not sure but it seems that you need go(std::string id,std::string url) without const. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Troy Watson <dr...@gm...> >To: cpp...@li... >Sent: Sunday, April 28, 2013 12:04 PM >Subject: [Cppcms-users] URL dispatching help > > > >Despite reading the docs and looking at the examples, I can't figure out complex dispatching/mapping with regexes. I need some help please! > > >My callback member function looks like this: void go( const std::string id, const std::string url ) { ... } >And the URL to map to the function looks like this: /go/{integer id}/{string url} > > >For example: >/go/10/http://google.com - id=10, url=http://google.com >/go/2921/http://sourceforge.net - id=2921, url=http://sourceforge.net > > >The best I could come up with was this: > > > dispatcher().assign( "/go/(\\d+)(.*)", &application::go, this, 2 ); > > mapper().assign( "go", "/go/{1}/{2}" ); > > >...but obviously that doesn't compile. What should the dispatcher and mapper call look like to get the functionality I'm looking for? > > >Thank you for such an excellent framework! >------------------------------------------------------------------------------ >Try New Relic Now & We'll Send You this Cool Shirt >New Relic is the only SaaS-based application performance monitoring service >that delivers powerful full stack analytics. Optimize and monitor your >browser, app, & servers with just a few lines of code. Try New Relic >and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: Troy W. <dr...@gm...> - 2013-04-28 09:04:57
|
Despite reading the docs and looking at the examples, I can't figure out
complex dispatching/mapping with regexes. I need some help please!
My callback member function looks like this: void go( const std::string id,
const std::string url ) { ... }
And the URL to map to the function looks like this: /go/{integer
id}/{string url}
For example:
/go/10/http://google.com - id=10, url=http://google.com
/go/2921/http://sourceforge.net - id=2921, url=http://sourceforge.net
The best I could come up with was this:
dispatcher().assign( "/go/(\\d+)(.*)", &application::go, this, 2 );
mapper().assign( "go", "/go/{1}/{2}" );
...but obviously that doesn't compile. What should the dispatcher and
mapper call look like to get the functionality I'm looking for?
Thank you for such an excellent framework!
|
|
From: Artyom B. <art...@ya...> - 2013-04-27 13:36:13
|
Sometimes it is very useful to have generic HTTP authentication that can be used across different platforms. For example if you want to have centralized login connected to Domain controller etc. Apache has wide range of modules for such authentication - Kerberos that for example allow to run any application behind common scheme like svn apache module can use any authentication schemes provided by Apache. In such case you may relay on the authentication that web server provides and use it as is. When you relay on the web server you indeed need to use specific CGI variables that should be defined by the web server, see: http://tools.ietf.org/html/draft-robinson-www-interface-00#page-10 as you had already mentioned them. However it is not common practice for public web sites to use HTTP authentication. Also once you use HTTP authentication you will still need to handle the authorization in your application to handle the permissions. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Markus Raab <us...@ma...> >To: cpp...@li... >Sent: Saturday, April 27, 2013 1:30 PM >Subject: [Cppcms-users] pass security credentials using fcgi > > >Hello Group! > >I have a rather general question about fcgi but I still post in this group >because I am interested in a solution which plays nicely with cppcms. > >One way to authenticate users is to have some authentication code within >cppcms and keep the auth state within a session. The drawback of this is: >- you need to write the authentication yourself >- you need to have a (in the worst case redudant) passwd/shadow > >Another way is to use authentication methods found within webservers. >I am interested in how those security credentials are passed using fcgi. >E.g. in nginx I found "fastcgi_pass_header Authorization;" and to pass the >information if we are in a secure session "fastcgi_param HTTPS $https;". >I wonder if other webservers also have this feature? > >Is there a standard for which environment variables should be declared and >how they should behave? Are the implementations found in apache/lighttpd >fcgi standard compliant? > >It seems like AUTH_TYPE and REMOTE_USER should be set for this feature. >Cppcms seems to have convenience functions for those. >Unfortunately I could not find detailed information about these. > >Is this approach used in practice? > >I also could not find anything about authentification in >http://cppcms.com/wikipp/en/page/secure_programming > > >best regards >Markus > > >------------------------------------------------------------------------------ >Try New Relic Now & We'll Send You this Cool Shirt >New Relic is the only SaaS-based application performance monitoring service >that delivers powerful full stack analytics. Optimize and monitor your >browser, app, & servers with just a few lines of code. Try New Relic >and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: Markus R. <us...@ma...> - 2013-04-27 10:30:23
|
Hello Group! I have a rather general question about fcgi but I still post in this group because I am interested in a solution which plays nicely with cppcms. One way to authenticate users is to have some authentication code within cppcms and keep the auth state within a session. The drawback of this is: - you need to write the authentication yourself - you need to have a (in the worst case redudant) passwd/shadow Another way is to use authentication methods found within webservers. I am interested in how those security credentials are passed using fcgi. E.g. in nginx I found "fastcgi_pass_header Authorization;" and to pass the information if we are in a secure session "fastcgi_param HTTPS $https;". I wonder if other webservers also have this feature? Is there a standard for which environment variables should be declared and how they should behave? Are the implementations found in apache/lighttpd fcgi standard compliant? It seems like AUTH_TYPE and REMOTE_USER should be set for this feature. Cppcms seems to have convenience functions for those. Unfortunately I could not find detailed information about these. Is this approach used in practice? I also could not find anything about authentification in http://cppcms.com/wikipp/en/page/secure_programming best regards Markus |
|
From: Artyom B. <art...@ya...> - 2013-04-27 07:59:46
|
First of all take a look on some ready modules in contrib section
contrib/server_side/sessions
The factory function is called from CppCMS as
f(srv.settings().find("session.server.settings")
So in your case the code
base_ = val.get<std::string>("dir", "/tmp/");
BOOSTER_INFO("session_memory_ext") << "base folder '" << base_;
Is not correct as the "val" is a string object i.e. is is STRING "dir:'/session_storage/'"
I would suggets:
1. Try to print to "val" to the stream so you know what you get in the factory.
2. Print the backtrace of the exception you catch so you can see where it comes from
Artyom Beilis
--------------
CppCMS - C++ Web Framework: http://cppcms.com/
CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
P.S.: Sorry for late reply was busy
>________________________________
> From: Christian Gmeiner <chr...@gm...>
>To: cpp...@li...
>Sent: Friday, April 26, 2013 1:22 PM
>Subject: Re: [Cppcms-users] session.server.settings example
>
>
>2013/4/23 Christian Gmeiner <chr...@gm...>:
>> Hi all
>>
>> "session" : {
>> "expire" : "renew",
>> "timeout" : 600,
>> "keep_alive_interval" : 60,
>> "location" : "server",
>> "gc" : 600,
>> "server": {
>> "storage":"external",
>> "shared_object":"/opt/libcppcms_session_memory_ext.so",
>> "settings":"dir:'/session_storage/'"
>> }
>> },
>>
>> session_memory_ext_storage(cppcms::json::value const &val)
>> {
>> base_ = val.get<std::string>("dir", "/tmp/");
>> BOOSTER_INFO("session_memory_ext") << "base folder '" << base_;
>> }
>>
>> How must my config.js look like to get this working?
>>
>
>Soo.. i tried this snipped
>
> cppcms::json::value a;
> cppcms::json::object o;
> o.insert(std::pair<cppcms::string_key,
>cppcms::json::value>("test", "/home/abc"));
> a.object(o);
>
> BOOSTER_DEBUG("a") << "json - " << a.save();
> BOOSTER_DEBUG("a") << a.get<std::string>("test", "/tmp/");
>
>-->
>Apr 26 12:48:58 chgm-pc a: a: json - {"test":"/home/abc"} (main.cpp:227)
>Apr 26 12:48:58 chgm-pc a: a: /home/abc (main.cpp:228)
>
>
>-->
>
> "session" : {
> "expire" : "renew",
> "timeout" : 600,
> "keep_alive_interval" : 60,
> "location" : "server",
> "gc" : 600,
> "server": {
> "storage" : "external",
> "shared_object" :
>"/opt/tssw/libcppcms_session_memory_ext.so",
> "settings" : {
> "dir" : "/home/abc",
> },
> }
> },
>
>-->
>cppcms::json::bad_cast: error converting from object
>
>Any hints?
>
>--
>Christian Gmeiner, MSc
>
>------------------------------------------------------------------------------
>Try New Relic Now & We'll Send You this Cool Shirt
>New Relic is the only SaaS-based application performance monitoring service
>that delivers powerful full stack analytics. Optimize and monitor your
>browser, app, & servers with just a few lines of code. Try New Relic
>and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
>_______________________________________________
>Cppcms-users mailing list
>Cpp...@li...
>https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
> |
|
From: Artyom B. <art...@ya...> - 2013-04-27 07:51:16
|
In general there is no built in loadable module support of the applications, it is planned for next release: http://cppcms.com/wikipp/en/page/cppcms_1x_tasks#Provide.Plugin.Framework But many users had already implement such kind of support, there is class that allows to load modules easily http://cppcms.com/cppcms_ref/latest/classbooster_1_1shared__object.html And cppcms templates are fully pluggable, i.e. they are self registered so only thing you need to do is to link the templates to shared object that you are loading. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Saikumar Gandapodi <sai...@gm...> >To: cpp...@li... >Sent: Wednesday, April 24, 2013 4:54 PM >Subject: [Cppcms-users] Page handlers from configuration > > >Before I reinvent the wheel, I wanted to check with you first to see if there >is an easier method to accomplish this. > >Goal: I want to specify the dispatch handler method through means of a class >whose instance is created through a class factory using a service name. >Why: So that we can specify the page handlers through the configuration file and >not touch the main module for adding/updating/deleting a page. > >You can notice that the service module is created using a class factory and used >for the assign method in dispatcher. >I know the below code is wrong and will not work, but wanted to show you the >concept what I would like to accomplish. >Any ideas ? > >void CPPCMSServer::initmapping( cppcms::service &srv ) { > string page = "/login"; // Read from the configuration > // Creates an instance of LoginServiceModule > ServiceModule *sm = CreateServiceModuleFactory(page); > dispatcher().assign(page, &ServiceModule::processRequest, sm); >} > >class ServiceModule >{ >public: > virtual void processRequest(cppcms::application &app) = 0; >}; > >class LoginServiceModule : public ServiceModule { >public: > LoginServiceModule() {} > void processRequest(cppcms::application &app); >}; > >void LoginServiceModule::processRequest(cppcms::application &app) { > // Process page request for "/main/login" page. >} > > > >------------------------------------------------------------------------------ >Try New Relic Now & We'll Send You this Cool Shirt >New Relic is the only SaaS-based application performance monitoring service >that delivers powerful full stack analytics. Optimize and monitor your >browser, app, & servers with just a few lines of code. Try New Relic >and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: Christian G. <chr...@gm...> - 2013-04-26 10:22:28
|
2013/4/23 Christian Gmeiner <chr...@gm...>:
> Hi all
>
> "session" : {
> "expire" : "renew",
> "timeout" : 600,
> "keep_alive_interval" : 60,
> "location" : "server",
> "gc" : 600,
> "server": {
> "storage":"external",
> "shared_object":"/opt/libcppcms_session_memory_ext.so",
> "settings":"dir:'/session_storage/'"
> }
> },
>
> session_memory_ext_storage(cppcms::json::value const &val)
> {
> base_ = val.get<std::string>("dir", "/tmp/");
> BOOSTER_INFO("session_memory_ext") << "base folder '" << base_;
> }
>
> How must my config.js look like to get this working?
>
Soo.. i tried this snipped
cppcms::json::value a;
cppcms::json::object o;
o.insert(std::pair<cppcms::string_key,
cppcms::json::value>("test", "/home/abc"));
a.object(o);
BOOSTER_DEBUG("a") << "json - " << a.save();
BOOSTER_DEBUG("a") << a.get<std::string>("test", "/tmp/");
-->
Apr 26 12:48:58 chgm-pc a: a: json - {"test":"/home/abc"} (main.cpp:227)
Apr 26 12:48:58 chgm-pc a: a: /home/abc (main.cpp:228)
-->
"session" : {
"expire" : "renew",
"timeout" : 600,
"keep_alive_interval" : 60,
"location" : "server",
"gc" : 600,
"server": {
"storage" : "external",
"shared_object" :
"/opt/tssw/libcppcms_session_memory_ext.so",
"settings" : {
"dir" : "/home/abc",
},
}
},
-->
cppcms::json::bad_cast: error converting from object
Any hints?
--
Christian Gmeiner, MSc
|
|
From: Saikumar G. <sai...@gm...> - 2013-04-24 13:54:45
|
Before I reinvent the wheel, I wanted to check with you first to see if there
is an easier method to accomplish this.
Goal: I want to specify the dispatch handler method through means of a class
whose instance is created through a class factory using a service name.
Why: So that we can specify the page handlers through the configuration file and
not touch the main module for adding/updating/deleting a page.
You can notice that the service module is created using a class factory and used
for the assign method in dispatcher.
I know the below code is wrong and will not work, but wanted to show you the
concept what I would like to accomplish.
Any ideas ?
void CPPCMSServer::initmapping( cppcms::service &srv ) {
string page = "/login"; // Read from the configuration
// Creates an instance of LoginServiceModule
ServiceModule *sm = CreateServiceModuleFactory(page);
dispatcher().assign(page, &ServiceModule::processRequest, sm);
}
class ServiceModule
{
public:
virtual void processRequest(cppcms::application &app) = 0;
};
class LoginServiceModule : public ServiceModule {
public:
LoginServiceModule() {}
void processRequest(cppcms::application &app);
};
void LoginServiceModule::processRequest(cppcms::application &app) {
// Process page request for "/main/login" page.
}
|
|
From: Christian G. <chr...@gm...> - 2013-04-23 12:19:20
|
Hi all
"session" : {
"expire" : "renew",
"timeout" : 600,
"keep_alive_interval" : 60,
"location" : "server",
"gc" : 600,
"server": {
"storage":"external",
"shared_object":"/opt/libcppcms_session_memory_ext.so",
"settings":"dir:'/session_storage/'"
}
},
session_memory_ext_storage(cppcms::json::value const &val)
{
base_ = val.get<std::string>("dir", "/tmp/");
BOOSTER_INFO("session_memory_ext") << "base folder '" << base_;
}
How must my config.js look like to get this working?
--
Christian Gmeiner, MSc
|
|
From: Saikumar G. <sai...@gm...> - 2013-04-18 19:03:50
|
Artyom, Thanks for your moderation. Point noted. Will check the docs/list before reaching out. Excellent Framework. Great work ! Thanks. |
|
From: Artyom B. <art...@ya...> - 2013-04-18 18:43:28
|
Please guys stop... Both you are right and wrong... @Saikumar Gndapodi: please try to search for the answer next time in docs or in the list (this is a common issue) @Shiv Shankar Dayal: I would really expect that after that long time, other users would be able to answer or point to the answer for such a common question. It is not ok that I'm the only person helping others around. And finally try to be respectful to other list members even if you disagree. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Saikumar Gandapodi <sai...@gm...> >To: cpp...@li... >Sent: Thursday, April 18, 2013 9:21 PM >Subject: Re: [Cppcms-users] Dispatcher and URL Mapping > > >Its quite apparent that you didn't understand a word I said earlier and >it seems that you are in good mood to have an argument without taking >anything into your mind. >Anyway. Thanks a lot and don't bother replying by wasting your time unless >you have something to contribute to help others. > > > >------------------------------------------------------------------------------ >Precog is a next-generation analytics platform capable of advanced >analytics on semi-structured data. The platform includes APIs for building >apps and a phenomenal toolset for data science. Developers can use >our toolset for easy data analysis & visualization. Get a free account! >http://www2.precog.com/precogplatform/slashdotnewsletter >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: Saikumar G. <sai...@gm...> - 2013-04-18 18:21:30
|
Its quite apparent that you didn't understand a word I said earlier and it seems that you are in good mood to have an argument without taking anything into your mind. Anyway. Thanks a lot and don't bother replying by wasting your time unless you have something to contribute to help others. |