Re: [Cppcms-users] Mounting both synchronous and asynchronous applications
Brought to you by:
artyom-beilis
From: CN <cn...@gr...> - 2011-02-01 15:29:47
|
Many thanks for the quick help! > you should provide a mount point > that would distinguish between them: > > See: > > - > http://art-blog.no-ip.info/cppcms_ref_v0_99/classcppcms_1_1applications__pool.html > > - > http://art-blog.no-ip.info/cppcms_ref_v0_99/classcppcms_1_1mount__point.html > Now I am trying to also provide mount() parameter mount_point but have trouble with the matching: //code begin class sync_app:public cppcms::application{ .... } class async_app:public cppcms::application { async_app(cppcms::service &srv) : cppcms::application(srv) { dispatcher().assign("(.*)",&async_app::catch_all,this,1); } void catch_all(std::string url) { BOOSTER_LOG(debug,"URL") << url; } } int main(int argc,char **argv) { cppcms::service s(argc,argv); s.applications_pool().mount(cppcms::applications_factory<sync_app>(),cppcms::mount_point("/s/a")); booster::intrusive_ptr<async_app> as_app=new interaction(s); //Watch the match string in the next line! s.applications_pool().mount(as_app,cppcms::mount_point("/as/a")); s.run(); } //code end Browser accesses to URL "/as/a". The match strings and logs follows: match string log --------------- /as (none) .* /as/a as (none) a (none) /a (none) /as/a (none) That being said, only provided with script ".*" will mount_point() fire application "async_app": s.applications_pool().mount(i,cppcms::mount_point(".*")); Any idea what mistake I have made? Regards, CN |