cppcms-users Mailing List for CppCMS C++ Web Framework (Page 123)
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: Artyom <art...@ya...> - 2010-12-13 14:29:18
|
Ok I see thanks. Can you please do following: In file booster/lib/locale/test/test_std_formatting.cpp add between lines 339 and 340 ss << boost::locale::as::number << 12345.45; TEST(ss.str() == "12 345,45"); The command: std::cerr << "[" << ss.str() << "]" << std::endl. So it would look like ss << boost::locale::as::number << 12345.45; std::cerr << "[" << ss.str() << "]" << std::endl. TEST(ss.str() == "12 345,45"); In build directory run make and then: ./test_std_formatting >report.txt And send me this file (report.txt)? Thanks. It is important to have entire file and not copy-paste from screen as I need to check if it generates invalid UTF-8 encoding or not. Artyom |
From: Aris S. <ari...@gm...> - 2010-12-13 13:33:43
|
On Mon, Dec 13, 2010 at 3:15 PM, Artyom <art...@ya...> wrote: > Can you please give me the content of the > > Testing/Temporary/LastTest.log > > In your build directory, > > Also I need: > > - the version of the compiler you use, I use gcc version 4.1.2 20080704 (Red Hat 4.1.2-44) > - Linux distribution (or other OS name) from command "cat /proc/version", here is the output: Linux version 2.6.18-164.15.1.el5.028stab068.9PAE (root@rhel5-build-x32) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Tue Mar 30 19:26:53 MSD 2010 and from command "cat /etc/*-release", here is the output: CentOS release 5 (Final) > - output of locale -a I attach it > - output of locale I attach it > - version of CppCMS you use (trunk or the 0.99.4) from the trunk |
From: Artyom <art...@ya...> - 2010-12-13 13:13:04
|
> > Hello, > > I have found that libdbi is quite slow (at least using MySQL) and I have > evidence that compared with a native implementation (libmysqlclient) where > libdbi is up to 4 times slower in returning the results of a series of querys. Make sure that everything is compiled in "release" mode - i.e. take a look if during compilation "-O2" or "-O3" flag is given for both libdbi and and dbixx (if you are using the last one). AFAIK libdbi uses mysql client and AFAIK does it quite well. I did once comparisons: http://art-blog.no-ip.info/cppcms/blog/post/12 and it was fine. However there still may be some corner cases that are not handled well. > > I wonder if this is the reason you have decided to implement cppdb, > Yes and not. Several reasons: 1. I wanted to work with prepared statements by default (wich have performance impact) 2. I want to have an ability to cache them (and also have connection pool) 3. I need some better API (for example libdbi date-time support is quite bad)/ > and whether > you are going to implement these using the native APIs (ex: libmysqlclient in > the case of MySQL) and what other databases are supported or plan to support? First of all I had already implemented :-) Second I support natively: - mysql via libmysqlclient) - sqlite3 via native sqlite3 library) - postgresql via official libpq - odbc for any other databases (tested with the three above and MS SQL Server)/ > Thanks and regards. > > Mario Best, Artyom P.S: If you are going to test cppdb performance via libmysql client do not forget the cppdb uses prepared statements by default and they do not use queries cache as non-prepared statements (some mysql "feature"), so sometimes it is better to use non-prepared statements with mysql backend. |
From: Mario P. <mp...@us...> - 2010-12-13 12:44:51
|
2010-12-13 10:30, Artyom wrote: [...] > > I'd suggest to take a look on cppdb - this is a new project > drop in replacement of dbixx, unlike dbixx it does not depend on > libdbi library but rather implements all by its own. Its API > is different from dbixx but conversion is mostly mechanical. > [...] Hello, I have found that libdbi is quite slow (at least using MySQL) and I have evidence that compared with a native implementation (libmysqlclient) where libdbi is up to 4 times slower in returning the results of a series of querys. I wonder if this is the reason you have decided to implement cppdb, and whether you are going to implement these using the native APIs (ex: libmysqlclient in the case of MySQL) and what other databases are supported or plan to support? Thanks and regards. Mario |
From: Artyom <art...@ya...> - 2010-12-13 09:30:58
|
> > Hello, > > > http://art-blog.no-ip.info/wikipp/en/page/ref_dbixx_row > It's not too clear from the documentation above if the data in dbixx::row is > available from an associative array. > > dbixx::result res; > sql<<"SELECT name,age,birthday " > "FROM person ", res; > > dbixx::row myRow; > while (res.next(myRow)) { > // Can we do something like the following? > std::string name = myRow["name"]; > // ... > } No you can't. The reason is simple - what type should operator[] should return? Today operator[] overloaded to check if the variable is null. > > My problem is that I want to pass the row data into my classes' constructors. > > Currently, I must declare temporary variables on the stack, extract the row > data into those variables, and pass them to my object constructors: > > > dbixx::row myRow; > while (res.next(myRow)) { > std::string tmp_name; > int tmp_age, tmp_birthday; > myRow >> tmp_name >> tmp_age >> tmp_birthday; > // Call my class constructor: > myClass person = myClass(tmp_name, tmp_age, tmp_birthday); > } > > I'd be neater if we could do something like this: > > > > dbixx::row myRow; > while (res.next(myRow)) { > // Call my class constructor: > myClass person = myClass(myRow["name"], myRow["age"], myRow["birthday"]); > } > > I know there is the method fetch(): > bool fetch(int idx,int &value); > but again, it requires temporary variables to be created, adding to code bloat > > and overheads... :-/ > > > Or how do you handle such things? > > Thanks, > > Augustin. > I've added an option to fetch a value by column index (not name) as r.get<std::string>(1), take a look on the version in trunk. However... I'd suggest to take a look on cppdb - this is a new project drop in replacement of dbixx, unlike dbixx it does not depend on libdbi library but rather implements all by its own. Its API is different from dbixx but conversion is mostly mechanical. There you can do: cppdb::result r = sql << "SELECT name,age,birthday FROM users"; while(r.next()) { myClass person = myClass(r.get<std::string>("name"), r.get<int>("age"), r.get<std::tm>("birthday")); } You may check the beta version at: https://cppcms.svn.sourceforge.net/svnroot/cppcms/cppdb/trunk The documentation is avalible via Doxygen. So after checkout run doxygen and take a look on the file html/index.html for docs. i.e.: svn co https://cppcms.svn.sourceforge.net/svnroot/cppcms/cppdb/trunk cppdb cd cppdb doxygen cd html firefox index.html It will be officially released withing a week (only some last toches on documentation should be done) Regards, Artyom |
From: augustin <aug...@ov...> - 2010-12-13 08:43:35
|
Hello, http://art-blog.no-ip.info/wikipp/en/page/ref_dbixx_row It's not too clear from the documentation above if the data in dbixx::row is available from an associative array. dbixx::result res; sql<<"SELECT name,age,birthday " "FROM person ", res; dbixx::row myRow; while (res.next(myRow)) { // Can we do something like the following? std::string name = myRow["name"]; // ... } My problem is that I want to pass the row data into my classes' constructors. Currently, I must declare temporary variables on the stack, extract the row data into those variables, and pass them to my object constructors: dbixx::row myRow; while (res.next(myRow)) { std::string tmp_name; int tmp_age, tmp_birthday; myRow >> tmp_name >> tmp_age >> tmp_birthday; // Call my class constructor: myClass person = myClass(tmp_name, tmp_age, tmp_birthday); } I'd be neater if we could do something like this: dbixx::row myRow; while (res.next(myRow)) { // Call my class constructor: myClass person = myClass(myRow["name"], myRow["age"], myRow["birthday"]); } I know there is the method fetch(): bool fetch(int idx,int &value); but again, it requires temporary variables to be created, adding to code bloat and overheads... :-/ Or how do you handle such things? Thanks, 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: Artyom <art...@ya...> - 2010-12-13 08:16:06
|
> > 1. error in >checkout. Error 'https://cppcms.svn.sourceforge.net/svnroot/cppcms/templates_compiler/trunk/share' at > > revision 1571 doesn't exist. Completed At revision: 1571 You don't need templates_compiler is it dead project that was removed from svn. It was used for CppCMS 0.0.x before its first beta was even released. It was removed from svn. > 2. warning in "make". I get some warning in ".../aio/src/endpoint.cpp", >which > >told me that in some member functions, a control reaches end of non-void >function. This is fine - it is compiler's false alarm. The "end of non-void" is done via function that always throws. > 3. failed in "make test". 62 - test_locale_std_formatting (Failed) Can you please give me the content of the Testing/Temporary/LastTest.log In your build directory, Also I need: - the version of the compiler you use, - Linux distribution (or other OS name) - output of locale -a - output of locale - version of CppCMS you use (trunk or the 0.99.4) > What is the > consequences of failed test above? which modules are that can't be used? Most likely it is the bug in the test itself as it is quite hard to handle all corner cases on every OS and installation and installed locales. But in general the "std" localization backend may be less usable (but it really depends on what exactly failed) Not something to worry about. Artyom |
From: Aris S. <ari...@gm...> - 2010-12-13 01:21:05
|
Hi, After I got my new vps, I start re-checkout all sources from cppcms repository. But I got the followings: 1. error in checkout. Error ' https://cppcms.svn.sourceforge.net/svnroot/cppcms/templates_compiler/trunk/share' at revision 1571 doesn't exist. Completed At revision: 1571 2. warning in "make". I get some warning in ".../aio/src/endpoint.cpp", which told me that in some member functions, a control reaches end of non-void function. 3. failed in "make test". 62 - test_locale_std_formatting (Failed) What is the consequences of failed test above? which modules are that can't be used? thanks -aris |
From: Frank E. <fra...@an...> - 2010-11-29 09:40:14
|
Hi, thanks for pointing this out. Since the headers are not present in the environment I'll take a deeper look into nginx for filtering such headers. Frank Am 28.11.2010 18:46, schrieb Artyom: > Hello, > > I think I answered this question ones. But anyway > > CppCMS uses CGI based API, in order to read some > header like X-Foo-Bar you need to read environment > variable HTTP_X_FOO_BAR (See [1]) However > some web servers do not pass all headers for example > nginx passes only headres defined explicitly in fastcgi > configuration, so the behavior may vary between the servers. > > Cppcms has API for it cppcs::http::request::getenv() > see [2]. So basically all you need is to call getenv() > for CGI variable. > > [1] RFC3875 Common Gateway Interface v 1.1 Protocol-Specific > Meta-Variables at http://www.ietf.org/rfc/rfc3875 > > [2] > http://art-blog.no-ip.info/cppcms_ref_v0_99/classcppcms_1_1http_1_1request.html#e1027cdea2ba8a41a041269df8092ae3 > > and > http://art-blog.no-ip.info/cppcms_ref_v0_99/classcppcms_1_1http_1_1request.html#92bc86f75e4e1f9480967ce3fd1e4f65 > > > Artyom > > > >> hi, >> >> the cppcms::http::request class only provides access to predefined >> headers. now i try to implement CORS (http://www.w3.org/TR/cors/) in >> which case the browser sends 'Access-Control-Request-Method' and >> 'Access-Control-Request-Headers' headers whcih i cannot access using the >> existing methods (or am i mistaken?). >> >> would it be possible to make a method available which returns a map of >> all headers as sent by the browser? (something like >> std::map<std::string,std::string> cppcms::http::request::http_headers()) >> >> thanks >> >> frank > > > > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! > Tap into the largest installed PC base & get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users -- Dipl.-Ing. (FH) Frank Enderle anamica UG (haftungsbeschränkt) Beinsteinerstr. 6 71334 Waiblingen Telefon: +49 151 14981091 Telefax: +49 7151 1335770 E-Mail: fra...@an... Internet: www.anamica.de Handelsregister: AG Stuttgart HRB 732357 Geschäftsführer: Yvonne Holzwarth, Frank Enderle |
From: Artyom <art...@ya...> - 2010-11-28 17:46:16
|
Hello, I think I answered this question ones. But anyway CppCMS uses CGI based API, in order to read some header like X-Foo-Bar you need to read environment variable HTTP_X_FOO_BAR (See [1]) However some web servers do not pass all headers for example nginx passes only headres defined explicitly in fastcgi configuration, so the behavior may vary between the servers. Cppcms has API for it cppcs::http::request::getenv() see [2]. So basically all you need is to call getenv() for CGI variable. [1] RFC3875 Common Gateway Interface v 1.1 Protocol-Specific Meta-Variables at http://www.ietf.org/rfc/rfc3875 [2] http://art-blog.no-ip.info/cppcms_ref_v0_99/classcppcms_1_1http_1_1request.html#e1027cdea2ba8a41a041269df8092ae3 and http://art-blog.no-ip.info/cppcms_ref_v0_99/classcppcms_1_1http_1_1request.html#92bc86f75e4e1f9480967ce3fd1e4f65 Artyom > hi, > > the cppcms::http::request class only provides access to predefined > headers. now i try to implement CORS (http://www.w3.org/TR/cors/) in > which case the browser sends 'Access-Control-Request-Method' and > 'Access-Control-Request-Headers' headers whcih i cannot access using the > existing methods (or am i mistaken?). > > would it be possible to make a method available which returns a map of > all headers as sent by the browser? (something like > std::map<std::string,std::string> cppcms::http::request::http_headers()) > > thanks > > frank |
From: Frank E. <fra...@an...> - 2010-11-28 15:37:04
|
hi, the cppcms::http::request class only provides access to predefined headers. now i try to implement CORS (http://www.w3.org/TR/cors/) in which case the browser sends 'Access-Control-Request-Method' and 'Access-Control-Request-Headers' headers whcih i cannot access using the existing methods (or am i mistaken?). would it be possible to make a method available which returns a map of all headers as sent by the browser? (something like std::map<std::string,std::string> cppcms::http::request::http_headers()) thanks frank -- Dipl.-Ing. (FH) Frank Enderle anamica UG (haftungsbeschränkt) Beinsteinerstr. 6 71334 Waiblingen Telefon: +49 151 14981091 Telefax: +49 7151 1335770 E-Mail: fra...@an... Internet: www.anamica.de Handelsregister: AG Stuttgart HRB 732357 Geschäftsführer: Yvonne Holzwarth, Frank Enderle |
From: Julian P. <ju...@wh...> - 2010-11-27 20:39:42
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > > Yes, this is good to have bugs in trunking system (when they get fixed :-) ) > Bug report: https://sourceforge.net/tracker/?func=detail&aid=3120842&group_id=209965&atid=1011835 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJM8WzMAAoJENidYKvYQHlQhsYP/iXh2wMagaaqxGWHHuYvPgog 2BBISzFv5sKJTLWe3nUJI9TPI1u6zUgSaYXIyRBs4qodYUTbOhqeiv12y8ya9P92 2RqRTNEahWKIK52oYR3vZCqCoBOxZ72ne5VXiKzivA6I8e4HV2jhiEgfcCO2hXB+ 6mG46tK3Tq3Ty+9q2sg/YhIqPaeEsjVKESgF7ApDQU4DiIllVo0PdswtnKu0+Xn7 +jF3DaD2piF8Zqji7QfXXii4ha2Omro0plvliux9NDh1dX4kDybd/0NZ6Naw79Ey 4wV8GciS3b4MpfvX3lisoWTGnj0TyjCDfJQbyxXCgPxOItHJtYzsvI0bHvSZlFG+ LLCloElree8TkZ5WvZUnQ+12kx0sUjBu8MMkeFkvN4Qdv6d6DDmG3sTTrs3pK7Cs pRl4TLWshKMbMJDWwEoSNX2LWQLfDDPVFgxo3L/x8xInZLv9KuICas9isAiSQ1P5 VYapIba/ms9adKK/Xass6ltDPZTQDmqbEAXU6iDQqWR7rT8IM120Nem5qV8KPV01 Cugsu7MU2dnJiW5Cw2Lz10GefkEqYvHxYDKjhRUTOYa9zjVqOMfhyJ6UhVgF3vCc J2C7dFpuQQ+/NmvTLKCyeRl9uXqX1O8BcOHuo8G1HvC49onNeXXUVlqnRBuiPE5H PNZlNpckUOtMFmMLTHF7 =8kXt -----END PGP SIGNATURE----- |
From: Artyom <art...@ya...> - 2010-11-26 21:17:56
|
> Subject: [Cppcms-users] Segfaults in async_complete_response() > > Hallo, > > I just caught another segfault in asynchronous application handling. > Backtrace is attached. - Is this version from trunk or 0.99.4? - Do you have any specific scenario when this happens, the way to recreate it would be very helpful. - Can you see in debugger what is the exact object got destroyed in cppcms/booster/booster/refcounted.h:68 What is its type. (i.e. what is the problematic object that is derived from refcounted fails in the dtor? It seems that something fails in destructor or memory corruption. > May I open a bug for it? Yes, this is good to have bugs in trunking system (when they get fixed :-) ) > > Thanks, > Julian Artyom |
From: Julian P. <ju...@wh...> - 2010-11-26 17:15:48
|
Hallo, I just caught another segfault in asynchronous application handling. Backtrace is attached. May I open a bug for it? Thanks, Julian |
From: Julian P. <ju...@wh...> - 2010-11-24 20:37:17
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 24.11.2010 21:14, schrieb Artyom: > request().script_name() and request().path_info() is the answer > if I understand it right. The problem is, that the request is not dispatched to my application, see below. > > You can provide quite complex and flexible mount point > for CppCMS application. See cppcms::mount_point class docs. I know that and in other servers I use it quite extensively ;). > If you have any dougbts about what happens create a simple > class that "mounts" to everithing (default) and print in it's main > script_name and path_info. > That was the problem: I mounted the application without mount point and added a main implementation to the application, which did never get called. It was called, however, as soon as I used ^(.*)$ as mount point, which, at least as I see it, means exactly the same: mount on everything. So I'd need a way to print the URL that is used for dispatch if no application is mounted and cppcms therefore returns a 404. > > I know I just hand found it too cryptic and not well documented > in comparison to other confugration files designed for human > being. > I had just a short look into it after I configured a cherokee server to perform further tests with my services, and while it is not that beautifully structured (no line breaks etc.), it's very logical indeed. If you're interested in adding cherokee to the cppcms_run utility, I'd suggest you do a basic setup by web GUI and then look in the configuration file to see what you'd have to change within your script. Because it's written by a machine entirely, its structure is quite logical, though. Regards, Julian -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJM7XevAAoJENidYKvYQHlQiUgQAMyhpTHmgJeVhj5mS6SfvGD1 AL+70F7mIkdevPRxZAyx/V8grcV5cDB4dwx3M4xP2Gu6PwDZeuVfO3TxaCIDSJFn oboaXRYgPgcB6r6cFUixmKi8l4G3tOMWlzAeVgegd+UcS3+ehtaugfZLYbU26oIZ Udn49N0k55auRgzDJzFmw84SImhSHS4KROHEm2szG+8cCDWRk3fL8gQEXT10/2nt 0lBzdtgPt8+6Zb/KKNsKUC4lqfWD0+OPKuGQULZ5sGyogyGwEId65Fay6nfigGWX AqfxO5hEd7gu8NdM2Nf13ImAVGTZMHkfP4jkcLmWqeLz1Hm7sgGc+O0a8wy93wWy RVFcFCJs2Klsc1UTfyX8Etb2GFFZsOj4uUIPHvxQMbEWmkwdEQhvcOWxGpFo0c86 w6tyjs+IitywQ2g6/KEDKqG/25QZRG0CLx8P4BPgBdn98ZsZX50Yd8dn9YdoJIuf 4rqrKqq3U+UNoXFpJ89dUMeol2EVLenKZkYVBzHifZmrW54DKCAjrEekKKMSSI42 cUeDBz33keesRaU5zRKq9+XHbZRwQS/A+LZqXCvlIXVMZK5bqpiHTDslqjX4QW6n CXV2V2BbXV7Tqlu1T21kTiWTGGjTPpcbjPf8lEW3fZCa/xtu6F/Ksu2p5eqToY9L N8v266B+YXM8bVR3rKPJ =OhGP -----END PGP SIGNATURE----- |
From: Artyom <art...@ya...> - 2010-11-24 20:14:19
|
> I had only little problems so far (using scgi), because > cherokee seems > to set another SCRIPT_NAME or PATH_INFO than lighttpd does > (URL rewrite > works in a quite different way). Is there a way to see in > cppcms which > SCRIPT_NAME/PATH_INFO is sent? request().script_name() and request().path_info() is the answer if I understand it right. > So that I could adjust the > paths > properly? I could sove the problem temporarily by mounting > my > application with the mount path ^(.*)$ and passing the > first match to > the application. To me, it doesn't seem to make any > difference, but > mounting the application without any mount path results in > 404 errors by > cppcms. You can provide quite complex and flexible mount point for CppCMS application. See cppcms::mount_point class docs. http://art-blog.no-ip.info/cppcms_ref_v0_99/classcppcms_1_1mount__point.html http://art-blog.no-ip.info/cppcms_ref_v0_99/classcppcms_1_1applications__pool.html If you have any dougbts about what happens create a simple class that "mounts" to everithing (default) and print in it's main script_name and path_info. > you > may edit the > cherokee.conf directly. There are guides on their project > site > http://www.cherokee-project.com how to do this. I know I just hand found it too cryptic and not well documented in comparison to other confugration files designed for human being. Artyom |
From: Julian P. <ju...@wh...> - 2010-11-24 19:45:17
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 24.11.2010 19:57, schrieb Artyom: > Ok this is very good. I'd just recommend you to make some > basic tests with cherokee - especially HTTP redirections > and HTTP status. > I had only little problems so far (using scgi), because cherokee seems to set another SCRIPT_NAME or PATH_INFO than lighttpd does (URL rewrite works in a quite different way). Is there a way to see in cppcms which SCRIPT_NAME/PATH_INFO is sent? So that I could adjust the paths properly? I could sove the problem temporarily by mounting my application with the mount path ^(.*)$ and passing the first match to the application. To me, it doesn't seem to make any difference, but mounting the application without any mount path results in 404 errors by cppcms. Besides of this one no problems occurred so far, but I didn't test it extensively yet. > I must admit I hand't tested CppCMS with Cherooke > (who makes Web server GUI configured??? It makes it very hard to test > it with cppcms_run script) The configuration GUI is very good indeed, Cherokee has a very sophisticated way of chaining virtual servers and handlers which can be configured much better by web interface/GUI than by configuration file IMHO. However, especially for script based approaches, you may edit the cherokee.conf directly. There are guides on their project site http://www.cherokee-project.com how to do this. Regards, Julian -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJM7Wt/AAoJENidYKvYQHlQQI0P/RgraH2x7YKj762CvQCQE2GP GowT6ke6WVLEQ4kv0rL8eCQ6Volq1tyGmU77CVDHEvj0u0PWOaOswO3z4GbD6k9T oLJNc+pbXjGCUviOjCZu1CaqkpkAidKVe2b2AsZO5bHPuDXHYLICpuixfDTkzCew oa/dOuNiSXjP4EsbZnDoQR1in8WAG+rr53kf3cGP2JQdfunT9ISaA3S/Rl2jPAau NBFnTfu/+jSrsOs+Ulkr/TSZJag+oyj3tYHFFmkyAN7SGWBVlyr4HDWENq62Ur5y EN0etJcuoqqrYDbJOJi7djo+Yhx9fT37ZdUELGz/ejJERYniymXJ/U9+nwQgQA6/ Awl9poVDABvXb9UMFGIHeyfKBGSQ2+h0MFwPfR7RjheDDRcYmVfBTxZx6ebsPAqY ATVgIN3N/dg2US3mhVe4ci6vqOxHY+W4pJK8QHJwTl0ae9UnYk9KhCmVL1tQTMmc FB8y3MCNSYibnVeR11J7lGwv+MRX1C7j+ECt6y55cjE/kQzyJ6YOGfsz9+gLorYD lkC4IS/P/MmjzPC5AkaLQ8Ikx/5dDAkfEjxeNR/XgKbtxtumWNzva9uA9LF/o3p7 /gd9wMMoeDytAcxso0/RAMVltJE0ph8PAB0SCVDv+sFTCoIJj9by1+AQLT5G4ZBH Ws2MV7WQmrHxZpompakX =xjk3 -----END PGP SIGNATURE----- |
From: Artyom <art...@ya...> - 2010-11-24 18:57:49
|
> > Just to inform you: According to the guys from the cherokee > mailing > list, cherokee does NO caching but passes the received POST > data > immediately to the scgi backend. > > Julian Ok this is very good. I'd just recommend you to make some basic tests with cherokee - especially HTTP redirections and HTTP status. because some SCGI web servers implementations do not handle it right (Nginx and IIS's plugin). I must admit I hand't tested CppCMS with Cherooke (who makes Web server GUI configured??? It makes it very hard to test it with cppcms_run script) but don't expect problems as it works with Apache, Lighttpd and Nginx well. Regards, Artyom |
From: Artyom <art...@ya...> - 2010-11-24 18:53:40
|
> I wrote an own implementation of a static file server as > cppcms > application, which should be secure enough (does realpath > expansion and > checks it with a configured web-root to make sure that > users don't > access any files they shouldn't, only thing is it doesn't > check for > symlinks, but as I need them anyway, it would not make > sense to check > for them). Actually CppCMS has quite good file server that does all you mentioned, but under linux I use canonicalize_file_name that does the same as realpath but allocates memory, as there some cases where realpath can be used to exploit buffers overflow (but it is generally very hard to do). BTW realpath and canonicalize_file_name do symlinks expantion. As I told you I wouldn't expose CppCMS HTTP server to wild internet, but is not so bad. :-) > Are my calculations concerning the disk usage correct? Looks right, but do not forget using cppcms::http::file::save_to function as it moves temporary file rather then copy it if it is placed on same device. Regards, Artyom |
From: Julian P. <ju...@wh...> - 2010-11-23 22:24:16
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Just to inform you: According to the guys from the cherokee mailing list, cherokee does NO caching but passes the received POST data immediately to the scgi backend. Julian -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJM7D8+AAoJENidYKvYQHlQXPkQAJ/53i90GVq+Y2mj5cX/IgSF op6a+jt/sVKkSYbbRGEMWrgm5SGluKEWOhbqDmxeWlK7xUb5o2pdXn4BAo/QqtSC hed4XwIrRYISOpSIWs75nu0XRkb4XzNzwAg8YemesmdqZDmgXqoNV3PbOT4/co1Z t6CCMArnFeJYmqn2Fj71kLb73H77h6PN2MNiurbDBNybwyoFNUK2YCCYsX8YiiDW NwSc7hG2Da/wxFNgfXQBO2uwWpuKlzjZl+wEjnDZBtaD9kXiuTYHbO64hkA1QCba t5gwAodCHG5gonr7gmeVFKs15JxXbDIsuMiDOUU4Eiup951iFHjBdV2wOw9v6Cn9 1kyeCVABLRK8WDLe+4EqTZefT9AoF4EWBkGKmm7wVaLspU6FO1B6Nz5IzHSlyPmq ZjeJsN5Ed3hhzVVXHJMkWecVgwYYr0x9jKqw4FfdQTC4OX1cSY055QKhBUEaEJo1 Cr3s2YAQnbLhGN6gXvywXsr/6gykjAgMIfcGTLEe1uYDoxPaMLbgj/XgBLl0Qhdt d4Z7+glh1h/vAo5BZLwaZ8chjrmoOgNiM4zXYp4kFGvFld7kY8caB8jqZT69MUZD tLV8+DmVmK2+0patHLhTXwVjjXNdnFLgFP+UrNd5Vc3tmSDvo7rqHdov3uk2SCzf j5xOQ1D/MjXoA9u7Yyg4 =9sub -----END PGP SIGNATURE----- |
From: Julian P. <ju...@wh...> - 2010-11-23 19:46:23
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ok, thanks for your very detailed reply. The environment the HTTP server will be available in is to be considered a trusted environment, so this would be OK. I wrote an own implementation of a static file server as cppcms application, which should be secure enough (does realpath expansion and checks it with a configured web-root to make sure that users don't access any files they shouldn't, only thing is it doesn't check for symlinks, but as I need them anyway, it would not make sense to check for them). The missing SSL support is a pity, but as it's a trusted environment this is ok for now. I wrote to the Cherokee mailing list to ask them whether uploads are buffered because it's nowhere in their documentation and hasn't been on topic on the mailing list so far, but I expect a positive response, because Cherokee is implemented asynchronously as lighttpd and nginx are, and there seems to be the need to do that buffering to anticipate event loop locks. Are my calculations concerning the disk usage correct? I think lighttpd stores the uploads in chunks of a certain size (afaik 1M as default, but you can change it), so the question would be whether it deletes the files one by one after having send them to the backend application or whether it deletes all of them after the transmission to backend application has been completed. In the first case, I could use lighttpd, because I could spare a few Megabytes for intermediate caching. Only I don't know how well this behaviour is going to be beared by the flash memory which has a limited number of write cycles for each of his blocks, so I see problems in too frequent (and in this case, unneccessary) file I/O on it, as every firmware would have to be written two times to flash. In fact, because of the lack of time and any alternative, I used the HTTP api of cppcms up to now, but wanted to switch to a proper webserver because of the remarks in your configuration file overview. After having read your second email, I think I will stay with cppcms HTTP for now, and HTTP/1.1 is not needed, because I won't use keep-alive anyway, while SSL support would be nice, even if it's not desperately needed now. Thanks, Julian -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJM7Bo9AAoJENidYKvYQHlQvWQQAJjVgBT4pg0zmlJek2yNwDTs z0i4w54E2vyFrz+07ulE/yYWD2xxDZjkPWW5a5vU3eNrRTJfWyAD32RgN74g7rbM ycjZ6Qyqp3o6sJwuUVYDxYvM97CEG1dSdMVow7FZb5z9yZPI5XA8mjxoAfagqMxH w6/rAWMj9sDKBjSV/0apQ77lXW3Ih8kjdy/6CX5ec2UvwnqBvzfbTz7vgkCogg2X nhzqQeo71lu1YHPck44K8UVA3VsF36ly1OWImZRArnilruPWnRKg/0MkSz8YHwg6 5p02nKQiI9KDd5YMhdMZhj+bHv6o+6gZKkMlOHOT0TpdpW7eVmFHY21aQ+K2xj+F 2wx9BFa72oZmu/a4ABYNjq89Smy7SieK8a5+oyuSbc5kC7U5aRnAjj9ThX33QA9n ZivqJCB8SM1VtNfc64ZMbqOWOtV+72AiT8l+gXRkbQIbbpiQqlK4r8Di64nNDatv /Mw/Te1ybO5xySEp9ICMHMTENFlBXphxlc2aEON/8YFGVP8ajyocR1dlejANXKpv 5z7IAHDwz38P833swX5+KIpqLFq26tlhp0+lV1U6QTf2qRDYnX3HNCy1si+k7oSQ zSP2qYCgOAr2Q+S6K/SkpCJjdzuIXbvtMRBcBs1IvsmiPRaahrWWnwBCPplZGGR+ bnCJMJm8wN4zs3lDac4p =RUeP -----END PGP SIGNATURE----- |
From: Artyom <art...@ya...> - 2010-11-23 19:02:15
|
> > Do you know of any lightweight webserver that will allow to passthrough > the body to cppcms without buffering? > Have you tried Cherookey or Apache? (I don't know if they do this or not) > Or is the only solution to run cppcms in standalone mode as its own webserver? > Where'd be the risks to do so? If your proxy sanitizes the HTML input and handles timeouts it is fine. To be honest, even if it handles timeouts I think there shouldn't be any problems. Generally I don't think there should be any security holes in internal HTTP server with exception of: 1. It does not handle timeouts - so it is very vulnerable against DoS attacks. 2. It supports only basic HTTP/1.0 and I'm not sure that its internal file server has good enough security checks. 3. It lacks SSL/HTTPs support. So generally if: 1. If you run it behind proxy that handles DoS and timeouts for you. 2. If you **do not** serve files (i.e. use internal file server) 3. Do not require SSL, HTTP Authentication or any other advanced feature 4. You do not require strict handling of various HTTP headers (i.e. composing several same-type headers to one as required by HTTP specification) Then it should be fine as I don't think that other web servers do much more checks on protocol itself then I do. However I hadn't done any stress testing for HTTP server and it is not a server that tested by wide audience for security etc. Bottom line: 1. If you use HTTP protocol in **trusted** environment it is Ok. I mean, if your user has physical access to the device, I'm not sure how much protection can you provide at all, especially when you **do** upload code that would run on the device. 2. If you use it behind HTTP proxy that fully sanitizes the input and you don't serve file from internal file server it is Ok. 3. If you use it behind proxy with great care (make sure that timeouts handled properly and you don't serve files) then it should be fine as well. And finally, if you really paranoid about security, define chroot to some directory that you know user can't do too much harm (CppCMS supports chrooting, but on the other hand - you upload firware - the code that would run... so it meaning-less). Additional notice: ------------------ I do plan in some future to make the HTTP server much more secure and introduce HTTP/1.1, better file serving and probably even SSL (mostly as part of creation of Web-Sockets support that can't be used with current FastCGI or SCGI protocols) But it is lots of work I have no time to do at this point. Generally there is not a lots of work to make it production safe, but this is mostly requires support study of what is required to be implemented in HTTP web server to make it secure - i.e. what and how to handle. Artyom |
From: Julian P. <ju...@wh...> - 2010-11-23 18:00:30
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hallo, I want to use a cppcms application in a productional setting. As it's discouraged to use cppcms's http API directly, I need a fast/scgi-capable, lightweight webserver that will handle the HTTP-Requests, serve static files and forward the requests to cppcms. The problem that occured is, that two of the most prominent webservers, lighttpd and nginx, need to buffer POST uploads completly before they are passed to the fastcgi backend, and both projects don't want to implement a direct passthrough for the POST bodies. For me this is a problem, because the named cppcms application is a firmware upload server, which has to process the firmware file during upload because the flash memory on the device this server runs on is very limited, and if I understand it right, an upload would take at least 2x the size of the firmware file being uploaded, because lighttpd/nginx will store it, then pass it to the cppcms fastcgi backend where cppcms stores it to a temporary file again. So for a file of e.g. 120M we would need at least 240M, but the drive has only the 120M for one copy of the firmware file. Do you know of any lightweight webserver that will allow to passthrough the body to cppcms without buffering? Or is the only solution to run cppcms in standalone mode as its own webserver? Where'd be the risks to do so? Thanks for your answers, Julian -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJM7AFpAAoJENidYKvYQHlQS2wP/Azz+qbylcYIlHdJXv/UvjGl PIhG+CA7wkybhPC9ZgOuTmt8ft41RrkPlL38SZ2TBK354nr01nWvpUoD6VYyRYtX zf9hd6c1HSoy6qfucyHHF8YWtFHHTpLJYVSnHqRP0JKVi3m2xgMEOikhGjphbvPN dSTQKgUqupzcDb81XV8TUI37hm0A4/rhbyyh0JlcZDTiLuS/3LeA7GqwmtwFKvd8 N/vMB96Ddgrp4eKdTQWIk8PGgtuQAnFgMRFjcMGiVvDLJ8utiTsqlgFXcgPUx9jF 1WF/l3kRngYPh3qYp8cFDOLf/C8o2oOKDiC5TzKKfJJTbEyl42nB5EGMUt1y7Uy/ tojBcG+agnrrhXknnAr8DwvFcsP9qYJlbEgmwq8aO+HwFrsNFG0tVIKsaaB5cto7 Krq4ZwazUjO/uIPhEpke7uqm/1Giv6vuU7dQtXOFXzRkQCJV9S4Z9BX7uofvgLAT ZPgT58/RmzXrv74zuoiyIhvyqBCUmp5JMYiVOYumxCIikimCU4z3eMea15Gctxho dICG1BsrSfhf4dkcq6m/o5q4gIG+hAQjcuBIY5SJDxmxobXdfJy9+uMj0QEEvLRh Pf/OjynrSzapWFwCpMSid0+rnZme1dXaoyexA9clVYuL9dslREJclfw6uzaccENj /W2FSA9q3Nb6weDJdndj =di79 -----END PGP SIGNATURE----- |
From: Artyom <art...@ya...> - 2010-11-22 17:30:32
|
> 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. In the latest version of this example finalize is not called at all. It is always called when you call async_complete_response(), all it does it closes all filters you may use and makes sure all data is saved properly when for example when you use cache (this is called automatically as well) Other then that you don't need this function - at some point it probably should be declared is internal or private API. Regards, Artyom |
From: Artyom <art...@ya...> - 2010-11-22 17:25:15
|
> > 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" > } User and group are properties of the process and you can change them only using forking that is generally done when you daemonize process, so they have nothing to do with socket. Also note that TCP sockets (and Unix ones as well) binded before switching user to allow for example to listen on port 80 that only super-user can do. So putting it to "socket" section would be misleading. Artyom |