Re: [Cppcms-users] Problem with cppcms::application::add() method
Brought to you by:
artyom-beilis
From: Artyom <art...@ya...> - 2010-11-12 06:49:45
|
Ok, now I've got it. I just totally misunderstand what you mean, and almost all I had written before is... wrong (except the 3rd problem that this is intentional). > >First problem: > >void application::add(application &app,std::string regex,int part) >>{ >> add(app); >> url_dispatcher().mount(regex,app,part); >>} >> > The code above has an error, the correct code is: > dispatcher().mount(regex,app,part); > Fixed. in trunk, changeset 1517 > Second problem: > > When I attach or add an application B to an application A, the method "void > B::main(std::string url)" is never called on url dispatch stage. > > This behaviour causes problems when adding cppcms::rpc::json_rpc_server > application because the parsing of the request is made in json_rpc_server::main > > method. > The result is that the application does not work. You are right! Fixed in trunk changeset 1517 > Third problem: > > in cppcms::rpc::json_rpc_server application: URL mapping with > dispatcher().assign() method does not work because main method overwriting. This is by design, As you actually want to dispatch by RPC function calls rather then by URL pattern. Thank you very much for this report and description and Fix you proposed. This is bad idea to answer on mails in 23:00 :-) Artyom |