cppcms-users Mailing List for CppCMS C++ Web Framework (Page 124)
Brought to you by:
artyom-beilis
You can subscribe to this list here.
2009 |
Jan
|
Feb
(22) |
Mar
|
Apr
(3) |
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
(16) |
Dec
(13) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(4) |
Feb
|
Mar
(8) |
Apr
(8) |
May
(8) |
Jun
(36) |
Jul
(63) |
Aug
(126) |
Sep
(47) |
Oct
(66) |
Nov
(46) |
Dec
(42) |
2011 |
Jan
(87) |
Feb
(24) |
Mar
(54) |
Apr
(21) |
May
(22) |
Jun
(18) |
Jul
(22) |
Aug
(101) |
Sep
(57) |
Oct
(33) |
Nov
(34) |
Dec
(66) |
2012 |
Jan
(64) |
Feb
(76) |
Mar
(73) |
Apr
(105) |
May
(93) |
Jun
(83) |
Jul
(84) |
Aug
(88) |
Sep
(57) |
Oct
(59) |
Nov
(35) |
Dec
(49) |
2013 |
Jan
(67) |
Feb
(17) |
Mar
(49) |
Apr
(64) |
May
(87) |
Jun
(64) |
Jul
(93) |
Aug
(23) |
Sep
(15) |
Oct
(16) |
Nov
(62) |
Dec
(73) |
2014 |
Jan
(5) |
Feb
(23) |
Mar
(21) |
Apr
(11) |
May
(1) |
Jun
(19) |
Jul
(27) |
Aug
(16) |
Sep
(5) |
Oct
(37) |
Nov
(12) |
Dec
(9) |
2015 |
Jan
(7) |
Feb
(7) |
Mar
(44) |
Apr
(28) |
May
(5) |
Jun
(12) |
Jul
(8) |
Aug
|
Sep
(39) |
Oct
(34) |
Nov
(30) |
Dec
(34) |
2016 |
Jan
(66) |
Feb
(23) |
Mar
(33) |
Apr
(15) |
May
(11) |
Jun
(15) |
Jul
(26) |
Aug
(4) |
Sep
(1) |
Oct
(30) |
Nov
(10) |
Dec
|
2017 |
Jan
(52) |
Feb
(9) |
Mar
(24) |
Apr
(16) |
May
(9) |
Jun
(12) |
Jul
(33) |
Aug
(8) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
(6) |
2018 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
(14) |
Jun
(1) |
Jul
(9) |
Aug
(1) |
Sep
(13) |
Oct
(8) |
Nov
(2) |
Dec
(2) |
2019 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2020 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(9) |
Jul
(6) |
Aug
(25) |
Sep
(10) |
Oct
(10) |
Nov
(6) |
Dec
|
2021 |
Jan
|
Feb
|
Mar
(7) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(9) |
Oct
(1) |
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: CN <cn...@gr...> - 2010-11-22 13:20:07
|
Hi! I notice that example code "chat" does not always call cppcms::http::response::finalize() before it calls async_complete_response(). Will it cause memory leak if cppcms::http::response::finalize() is not called before async_complete_response() is called by asynchronous applications? If it will, I propose some warnings of its misuse be written to the documentation. Regards, CN |
From: CN <cn...@gr...> - 2010-11-22 13:00:44
|
On Wed, 20 Oct 2010 04:51:18 +0800, Artyom <art...@ya...> wrote: > Daemonization is implemented in trunk. Together with: > > - Switching to unprivileged user and group > - Chrooting to specific directry for extra paranoic users. Would it be even better to also add options "user" and "group" under "service.socket" so we can specify something like the following? service: socket { "path": "/tmp/cppcms.socket", "user":"www-data", "group":"www-data" } Regards, CN |
From: Artyom <art...@ya...> - 2010-11-16 15:05:54
|
I don't see any reason why would CppCMS not work for you. Go with it. About Wt... I have my opinion on this project - I don't think that entire concept of Wt is correct. You can see my opinion there: http://stackoverflow.com/questions/4157895/web-framework-api/4158839#4158839 That is why I created CppCMS while Wt was around. If you ask at Wt lists they think they do "the right thing" while I think that CppCMS does "the right thing" So... Its up to you :-) Regards, Artyom > Hi > > I'm thinking of writing a pastebin with Wt. > > A couple of questions before I begin; > > • Would you recommend using CppCMS for creating pastebins? > • Are there any examples of pastebins created with CppCMS? > > Please tell me your thoughts on this project... > > Thanks > |
From: Alec T. <ale...@gm...> - 2010-11-16 12:43:02
|
Apologies fellow CppCMS member, I forgot to change the title and 3rd Line. Basically, I'm doing research for the C++ web toolkit which will be suit my needs. Please reply On Tue, Nov 16, 2010 at 11:37 PM, Alec Taylor <ale...@gm...> wrote: > Hi > > I'm thinking of writing a pastebin with Wt. > > A couple of questions before I begin; > > • Would you recommend using CppCMS for creating pastebins? > • Are there any examples of pastebins created with CppCMS? > > Please tell me your thoughts on this project... > > Thanks > > BTW: I'll be creating one capable of compiling code, akin to codepad > and IDEone, only with support for multiple files, uploading of files > and downloading of compiled/outputted files. There will be a complete > authentication system, however registration will be optional. > |
From: Alec T. <ale...@gm...> - 2010-11-16 12:38:03
|
Hi I'm thinking of writing a pastebin with Wt. A couple of questions before I begin; • Would you recommend using CppCMS for creating pastebins? • Are there any examples of pastebins created with CppCMS? Please tell me your thoughts on this project... Thanks BTW: I'll be creating one capable of compiling code, akin to codepad and IDEone, only with support for multiple files, uploading of files and downloading of compiled/outputted files. There will be a complete authentication system, however registration will be optional. |
From: Artyom <art...@ya...> - 2010-11-16 11:21:20
|
> > Hello Artyom! > > May be it's not so significant, but i think it's necessary to discuss. > > At http://cppcms.sourceforge.net/wikipp/en/page/cppcms_1x_coding_standards you >wrote that "Always prefer std::vector to std::list - it has better performance >because it is cache friendly." > But imho, doing so can lead to performance troubles in some cases: for >example, if you try to remove an item from the middle of multimillion >std::vector - unlike std::list. > > --- > Regards, kpeo Of course not in case you want to do something like that. The coding standard is advice, not "always use it" so for example if I do need to insert items and remove items from list randomly I use std::list, for example cache where std::list is used for LRU handling. Artyom |
From: <sla...@ya...> - 2010-11-16 10:45:55
|
Hello Artyom! May be it's not so significant, but i think it's necessary to discuss. At http://cppcms.sourceforge.net/wikipp/en/page/cppcms_1x_coding_standards you wrote that "Always prefer std::vector to std::list - it has better performance because it is cache friendly." But imho, doing so can lead to performance troubles in some cases: for example, if you try to remove an item from the middle of multimillion std::vector - unlike std::list. --- Regards, kpeo |
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 |
From: Daniel V. <chi...@gm...> - 2010-11-12 00:03:52
|
Hello. I use the latest cppcms revision. I answer between the lines below. Thanks. On Thu, 2010-11-11 at 12:39 -0800, Artyom wrote: > > > >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); > > You write "url_dispatcher()" in the above method definition. As you know url_dispatcher() makes an anonymous instance of cppcms::url_dispatcher class. I suspect that your intentions are to call dispatcher() method instead. > > add or attach member functions do only one thing - they share the http::context > class between all connected applications. > > Otherwise you'll just have an exception trying to access anything like request() > > or response() of any class that wasn't added. > > On the other hand url_dispatching is just a simple way to "split" your main > function according to requests between its own member function and other sub > applications. > > There are different tasks and they both required (unless you wan't to do > something on > your own in main rather then standard URL-dispatching) They are diferent task, I understand, but the method add(application &app,std::string regex,int part) makes these two tasks. > > > 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. > > When you mount a sub application you just extract sub expression and > pass it to mounted application. I.e. > > add(users_app) > add(uploads) > urd_dispatched().mount("/users(/.*)",users_app,1); > urd_dispatched().mount("/uploads(/.*)",uploads,1); I can't use that interface because the mount() method is private. The code add(users_app); dispatcher().mount("/users(/.*)",u,1); raise the error cppcms/url_dispatcher.h:160: error: ‘void cppcms::url_dispatcher::mount(std::string, cppcms::application&, int)’ is private main.cpp:30: error: within this context For that reason I use the shortcut method add(application &app,std::string regex,int part). > And then in constructor of users you mount > > url_dispatcher().attach("/login",&users_class::login,this); > > when you hit /users/login > > /users/login is matched against "/users(/.*)" regex and passed to > users_app.main() > with parameter "/login" > > then it matched by users_app's url_disptacher against "/login" regex and passed > to login > member function of users_app instance. > > So you need both steps and understand how they work. > > > 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. > > adding application has nothing to do with URL dispatching, url_disptaching just > allows > you to forward request to other app's main function. I wrote an small example that reproduces the issue: #include <cppcms/application.h> #include <cppcms/service.h> #include <cppcms/applications_pool.h> #include <cppcms/url_dispatcher.h> #include <cppcms/http_response.h> #include <iostream> class users : public cppcms::application { public: users(cppcms::service& srv): application(srv) { dispatcher().assign("/login$", &users::login, this); } void main(std::string url) { response().out() << "into users::main(\""<< url <<"\")\n"; cppcms::application::main(url); } void login() { response().out() << "into users::login()\n"; } }; class main_app : public cppcms::application { public: main_app(cppcms::service& srv) : application(srv), u(srv) { add(u,"/users(/.*)",1); //add(u); //dispatcher().mount("/users(/.*)",u,1); } void main(std::string url) { response().out() << "into main_app::main(\""<< url <<"\")\n"; cppcms::application::main(url); } private: users u; }; int main(int argc, char **argv) { try { cppcms::service srv(argc, argv); srv.applications_pool().mount( cppcms::applications_factory<main_app>()); srv.run(); } catch(std::exception const &e) { std::cerr << e.what() << std::endl; return 1; } return 0; } Test cases: A - Test url: .../users/login result: "into users::login()" That's ok. B - Test url: .../users/foo result: "into main_app::main("/users/foo")" That's no ok, because the espected result is "into users::main("/foo")". The users::main() method is never called. Am I wrong? If you don't change "url_dispatcher()" to "dispatcher()" in add(application &app,std::string regex,int part) definition then the A test also fails. > > in cppcms::rpc::json_rpc_server application: URL mapping with > > dispatcher().assign() method does not work because main method overwriting. > > When you develop json_rpc server you suppose to rather bind member function > by remote procedure functions (i.e. RPC service function = member function) > rather then using URL-dispatching method suitable for ordinary web applications. > > So it is done by design. > > Artyom > > > > > > ------------------------------------------------------------------------------ > Centralized Desktop Delivery: Dell and VMware Reference Architecture > Simplifying enterprise desktop deployment and management using > Dell EqualLogic storage and VMware View: A highly scalable, end-to-end > client virtualization framework. Read more! > http://p.sf.net/sfu/dell-eql-dev2dev > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users |
From: Artyom <art...@ya...> - 2010-11-11 20:39:30
|
> >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); > add or attach member functions do only one thing - they share the http::context class between all connected applications. Otherwise you'll just have an exception trying to access anything like request() or response() of any class that wasn't added. On the other hand url_dispatching is just a simple way to "split" your main function according to requests between its own member function and other sub applications. There are different tasks and they both required (unless you wan't to do something on your own in main rather then standard URL-dispatching) > 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. When you mount a sub application you just extract sub expression and pass it to mounted application. I.e. add(users_app) add(uploads) urd_dispatched().mount("/users(/.*)",users_app,1); urd_dispatched().mount("/uploads(/.*)",uploads,1); And then in constructor of users you mount url_dispatcher().attach("/login",&users_class::login,this); when you hit /users/login /users/login is matched against "/users(/.*)" regex and passed to users_app.main() with parameter "/login" then it matched by users_app's url_disptacher against "/login" regex and passed to login member function of users_app instance. So you need both steps and understand how they work. > 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. adding application has nothing to do with URL dispatching, url_disptaching just allows you to forward request to other app's main function. > in cppcms::rpc::json_rpc_server application: URL mapping with > dispatcher().assign() method does not work because main method overwriting. When you develop json_rpc server you suppose to rather bind member function by remote procedure functions (i.e. RPC service function = member function) rather then using URL-dispatching method suitable for ordinary web applications. So it is done by design. Artyom |
From: Daniel V. <chi...@gm...> - 2010-11-10 22:14:53
|
Hello. I found problems with cppcms::application::add() and cppcms::application::attach() methods 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); 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. Third problem: in cppcms::rpc::json_rpc_server application: URL mapping with dispatcher().assign() method does not work because main method overwriting. Thank you. |
From: Artyom <art...@ya...> - 2010-11-10 20:04:07
|
Thanks for the report, Fixed, take the version from trunk or just pick a changeset 1513 from SVN. Artyom ----- Original Message ---- > From: Julian Pietron <ju...@wh...> > To: cpp...@li... > Sent: Wed, November 10, 2010 3:04:25 PM > Subject: [Cppcms-users] Segfaults in libcppcms in asynchronous application > > Hallo, > > in an asynchronous application, a segfault is reproducible if a connection > of a released context is aborted by browser. > gdb backtrace is attached. If you need further information, don't hesitate > to ask. > > Thanks for your help, > Julian > |
From: Artyom <art...@ya...> - 2010-11-10 15:29:43
|
Thanks, Please open a bug, I'll try to solve it ASAP Artyom ----- Original Message ---- > From: Julian Pietron <ju...@wh...> > To: cpp...@li... > Sent: Wed, November 10, 2010 3:04:25 PM > Subject: [Cppcms-users] Segfaults in libcppcms in asynchronous application > > Hallo, > > in an asynchronous application, a segfault is reproducible if a connection > of a released context is aborted by browser. > gdb backtrace is attached. If you need further information, don't hesitate > to ask. > > Thanks for your help, > Julian > |
From: Julian P. <ju...@wh...> - 2010-11-10 13:10:55
|
I forgot to add that I'm using current beta (0.99.4) of libcppcms. |
From: Julian P. <ju...@wh...> - 2010-11-10 13:04:35
|
Hallo, in an asynchronous application, a segfault is reproducible if a connection of a released context is aborted by browser. gdb backtrace is attached. If you need further information, don't hesitate to ask. Thanks for your help, Julian |
From: Aris S. <ari...@gm...> - 2010-11-07 02:45:14
|
another solution in the client side is using YUI 3 uploader, an swfuploader, which have BDS license. The YUI Uploader leverages Flash to provide file upload functionality beyond the native browser-based methods. Specifically, the Uploader allows for: 1. Multiple file selection in a single "Open File" dialog. 2. File extension filters to facilitate the user's selection. 3. Progress tracking for file uploads. 4. A range of available file metadata: filename, size, date created, date modified, and author. 5. A set of events dispatched on various aspects of the file upload process: file selection, upload progress, upload completion, data return, and upload errors. 6. Inclusion of additional data in the file upload POST request. 7. Faster file upload on broadband connections (due to the modified SEND buffer size). for a complete description, read on http://developer.yahoo.com/yui/3/uploader/ for single file upload example, read on http://developer.yahoo.com/yui/3/examples/uploader/uploader-simple.html# for multiple file, read on http://developer.yahoo.com/yui/3/examples/uploader/uploader-multiple.html another feature of YUI oploader is that "the file upload can be aborted" with calling "void cancel(fileID)" method, read on http://www.yuiblog.com/blog/2009/02/26/flickr-uploadr/ for the complete api, read on http://developer.yahoo.com/yui/3/api/Uploader.html |
From: pavel k. <un...@fu...> - 2010-11-07 00:10:21
|
Zheng Ping <kytexzy@...> writes: > > > I think swfupload is a good solution. maybe plupload is better long term solution. did anybody tried to use it with cppcms? or anything else to handle multiple files upload (with chunking)? |
From: Artyom <art...@ya...> - 2010-11-02 12:33:04
|
Hello All, As far as I can see there are some issues and questions about DbiXX, I updated DbiXX library with different fixes and improvements: - Fixed time shift when fetching local time during daylight time savings - Correct overloading for all integer types - Access to dbi data (dbixx::result) - Support of single connection string instead of passing multiple parameters - Support of getting driver name - Doxygen generated documentation - Some code cleanup - to make it locale safe Please take a look on these updates in svn-trunk if you are interested . Artyom |
From: Artyom <art...@ya...> - 2010-11-02 07:46:38
|
> Subject: [Cppcms-users] dbixx::result && dbixx::row > > Hello, is it possible to make dbixx:: result and row serializable? It would >let > us to store db queries results in cache. > > This is bad place to do serialization. As dbixx::result are tied to specific DB connection and not generally useful outside this scope. You need to fetch an object from the database you need using "row" and then serialize the object rather then serializing the row itself. See for example: Wikipp's options class: http://cppcms.svn.sourceforge.net/viewvc/cppcms/wikipp/branches/for_cppcms_v100/options.cpp?revision=1255&view=markup Function voidoptions::load(), lines 73-90 Artyom |
From: Artyom <art...@ya...> - 2010-11-02 07:42:44
|
> > Can't dbixx::session::escaped_query be made public? > That would be useful both for bebugging and query logging purposes? > > Maybe it would be safer to simply implement a getEscaped_query() function, but > > how could I use my own function to modify the query in other ways (e.g. > automatically add a prefix to table names)? Probably I can add get_escaped_query() member function. And no, I can't make it public, as it private variable used internally. > Even if I make a class derived from dbixx::session, I still wouldn't be able > to read AND modify the query as long as escaped_query is private, right? > dbixx::session is not intended to be derived from. Artyom |
From: Artyom <art...@ya...> - 2010-11-02 07:40:54
|
Mistake. Actually these members are for low level access to libdbi for functions missing in dbixx. And generally should not be used. Artyom ----- Original Message ---- > Hello, > > Why dbixx::result doesn't have "dbi_result get_dbi_result() member > function ? > > Jean-Michel > > > |
From: Abramov A. <he...@gm...> - 2010-11-02 00:10:20
|
Hello, is it possible to make dbixx:: result and row serializable? It would let us to store db queries results in cache. |
From: augustin <aug...@ov...> - 2010-11-01 12:48:45
|
On Monday 01 November 2010 03:29:39 pm Artyom wrote: > What is md5 function? Is it cppcms::util::md5 or something else? Because > of so it creates 16 characters binary string and you probably > need cppcms::util::md5hex > for 32 hexadecimal characters. It was something else that I found elsewhere on the web. I forgot you already provided the equivalent within the utils. I now use cppcms::util::md5hex and it works equally well. Thanks. > BTW I suggest to salt passwords to prevent using rainbow tables. Yes, I will. > You can add debug printing in line 310 of session.cpp in function > session::single > Before line: > > dbi_result res=dbi_conn_query(conn,escaped_query.c_str()); > > Add: > > std::cerr << "[" << escaped_query <<"]" << std::endl; > > Also if exception is thrown > you can request query() parameter of dbixx_error. Can't dbixx::session::escaped_query be made public? That would be useful both for bebugging and query logging purposes? Maybe it would be safer to simply implement a getEscaped_query() function, but how could I use my own function to modify the query in other ways (e.g. automatically add a prefix to table names)? Even if I make a class derived from dbixx::session, I still wouldn't be able to read AND modify the query as long as escaped_query is private, right? augustin. -- Friends: http://www.reuniting.info/ http://activistsolutions.org/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |
From: Jean-Michel C. <jea...@la...> - 2010-11-01 07:46:37
|
Hello, Why dbixx::result doesn't have "dbi_result get_dbi_result() member function ? Jean-Michel |
From: Artyom <art...@ya...> - 2010-11-01 07:29:46
|
> I get a username and a password from a user and hash the password using md5(): > std::string pass_md5 = md5(password); > memset (password, '*', 100); // Erase the password from memory. > cout << "The md5 is: " << pass_md5 << endl; What is md5 function? Is it cppcms::util::md5 or something else? Because of so it creates 16 characters binary string and you probably need cppcms::util::md5hex for 32 hexadecimal characters. BTW I suggest to salt passwords to prevent using rainbow tables. > sql << "SELECT * FROM users WHERE name = ? AND pass = ?", username, > pass_md5; > if (sql.single(r)) { /* Login successful...*/ } > > The (critical) problem is that the login is never successful because in the > above query, the pass_md5 is truncated. The md5 hash is 32 characters long, > but only the 20 first characters are kept in the query. > ??? I tested this code works fine. > > Is this a bug in the API, or am I doing wrong? > > > Also, for debugging purposes, how can I access the actual query sent to the > sql server? > If you still have issues You can add debug printing in line 310 of session.cpp in function session::single Before line: dbi_result res=dbi_conn_query(conn,escaped_query.c_str()); Add: std::cerr << "[" << escaped_query <<"]" << std::endl; Also if exception is thrown you can request query() parameter of dbixx_error. Artyom |