cppcms-users Mailing List for CppCMS C++ Web Framework (Page 135)
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: Zheng P. <ky...@gm...> - 2010-07-24 01:33:57
|
I think swfupload is a good solution. > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > -- with kind regards |
From: Artyom <art...@ya...> - 2010-07-23 09:49:15
|
> hi, > > > i implemented some global object to track running uploads in cppcms. > after i got it running i learned that nginx buffers the _complete_ post > before sending it to the fastcgi backend. this is by design and not > alterable. Ok, its quite sad, -1 more point for Nginx for me. > - cppcms with nginx can not be used to 'stream' post data directly to > cppcms backend in fastcgi mode > - nginx always cashes post requests and sends them then completely to > the fastcgi backend (cppcms) which does not block cppcms while receiving > data from a slow connection (which could be a good thing) Ok, it is good point to remember this in future, probably even it is good to add it to the wiki at some point > though this is not really new it might help a little bit. it's fo sure > something to be mentioned in the documentation when the upload handling > is changed in RC1. It would not be "changed" but rather enhanced so users would be able to have better control over uploads that today if they want. In any case as preparation to future implementation of web-sockets API I think I'll add an asynchronous API for fetching POST data. But this is in TODO list. > as i understood this will offer the possibility to > abort a running upload; well if you have nginx in front it might not > work as expected. This is mostly web server issue, to be honest, almost every web server has its own quirks, for example only nginx reports on closed-by-peer connections lighttpd and apache don't do this at all. Regards, Artyom |
From: Frank E. <fra...@an...> - 2010-07-21 19:59:33
|
hi, after some research i found the following facts to be helpful for upload progress using nginx with cppcms backend in fastcgi mode: i implemented some global object to track running uploads in cppcms. after i got it running i learned that nginx buffers the _complete_ post before sending it to the fastcgi backend. this is by design and not alterable. i also stumbled upon a nginx module which can be used to implement upload progress indicators using java script and XHR - solved completely within nginx. so i found what i searched for (upload progress indicator), but this also means that - cppcms with nginx can not be used to 'stream' post data directly to cppcms backend in fastcgi mode - nginx always cashes post requests and sends them then completely to the fastcgi backend (cppcms) which does not block cppcms while receiving data from a slow connection (which could be a good thing) - i don't need to patch cppcms to support progress indicatorrs for post requests (which i'm glad about) though this is not really new it might help a little bit. it's fo sure something to be mentioned in the documentation when the upload handling is changed in RC1. as i understood this will offer the possibility to abort a running upload; well if you have nginx in front it might not work as expected. http://wiki.nginx.org/NginxHttpUploadProgressModule - lighthttpd also has a module like that. regards, frank Am 18.07.2010 13:34, schrieb Artyom: >> >> it should be simple and simple to use. since i now need this >> functionality i'll try to hack something in the the current library >> version, but it won't be a beautiful solution and i'd like to replace it >> as soosn as available with a version from upstream. >> >> frank >> > > > For this you may take a look on: > > - http_file.cpp, which handles incoming chunks. > - cgi_api.cpp functions: load_content and on_some_multipart_read > > Note: at this point there is no associations with an application yet, > and there is no session information loaded, so you should be very careful > with the assumptions of what you can actually do. > > Artyom > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > 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-07-18 11:34:22
|
> > it should be simple and simple to use. since i now need this > functionality i'll try to hack something in the the current library > version, but it won't be a beautiful solution and i'd like to replace it > as soosn as available with a version from upstream. > > frank > For this you may take a look on: - http_file.cpp, which handles incoming chunks. - cgi_api.cpp functions: load_content and on_some_multipart_read Note: at this point there is no associations with an application yet, and there is no session information loaded, so you should be very careful with the assumptions of what you can actually do. Artyom |
From: Frank E. <fra...@an...> - 2010-07-18 11:27:46
|
i suppose the callbacks would be a good thing. it should include - a possibility to cancel a transfer before it has even started (i guess this is what you mean with preupload validation) - an option to let the file be received by cppcms (cppcms handles storing the file just like it does now) optionally with a callback whcih tells the applicationt he amount of received bytes. - an option to pass the data while receiving directly to an application callback so the application can save the data to the target itself (no duplicate data holding since no temp files or temp memory blocks are involved in receiving the file) it should be simple and simple to use. since i now need this functionality i'll try to hack something in the the current library version, but it won't be a beautiful solution and i'd like to replace it as soosn as available with a version from upstream. frank Am 18.07.2010 11:33, schrieb Artyom: > Hello, > > Currently, all upload is done without involvement of the user application, > the user application is called only after processing all POST data. > But better upload handling should be implemented in RC1, as part of better > upload validation. > > It is in task list, see: > > > http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_tasks#Implement+Pre-Upload+file+validation+-+Mrc. > > > Generally as part of API I think it would be possible to add some upload hooks > so the > application can have better control over upload process and so it would be able > to do anything, > it wants. > > Additional option may be give to give an application full control over > processing POST data. > So in some cases, application could be "called" before actual POST data is > transferred. > > In such case would be able to handle all notification as in regular comet > application. > > But this requires work and API design. So if you can propose some suggestions > and requirements for > such API, they may be actually implemented in CppCMS :-) > > Best, > Artyom > > P.S.: Isn't java-script has an ability to do such things on client side? > > >> >> hi, >> >> i need (must have) the possibility to know how much data of an ongoing >> post to the cppcms application has been transmitted. i need to be able >> to give somekind of upload progress feedback. when i'm not mistaken this >> is not possible using cpcms - is there any workaround for that? or is it >> possible to implement something like that? >> >> maybe somekind of instance which can be queried for in progress post >> transfers using some kind of i which the js application also uses to >> transmit the file in the post and returns the number of bytes >> transmitted and if available the full size to be transmitted? >> >> any ideas? >> >> 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 >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > 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-07-18 11:27:43
|
> It is one thing to upload a simple picture, a pdf, a text file or any kind of > small file. > It is another thing entirely to upload a 100MB or 1GB file... Must such big > files be uploaded via ftp? Isn't there any practical limit with the browser or > > the HTTProtocol about such large file transfers? Why wouldn't you use HTTP? It does not have any overhead when uploading big files. There are many cases when HTTP is quite convenient, and uploading 50, 100MB or even 10GB is fine from technological point of view (for example YouSendIt) > > From CppCMS's point of view, would the file size matter for the possibly > upcoming file transfer API? Currently there is no technical limits on file size upload, but: - It is limited to 64MB by default, this can be changed by setting: security.multipart_form_data_limit to the required size in KB. - For large files it is better to use save_to() member function of http::file which would cause rather file rename then copy. |
From: augustin <aug...@ov...> - 2010-07-18 11:19:19
|
On Sunday 18 July 2010 07:12:14 pm Frank Enderle wrote: > the app needs to transfer bigger files in a multipart post if possible. > the filesize will be between 1 and 10mb. so the full post might easiliy > reach a few tens of megs. Thanks. There is indeed a limit. Yet, there must be a way that is user friendly and does not require to break the file into bits: how does youtube manage this? We can upload very large files, there. The interface is friendly enough and all is seemingly done via http with some help from javascript. Maybe we should try to figure out how they do it. 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: Frank E. <fra...@an...> - 2010-07-18 11:12:23
|
> Frank: if you need an upload progress API, I presume it's precisely > because your application needs to process some large file transfers. > Can you shed some light on this topic? the app needs to transfer bigger files in a multipart post if possible. the filesize will be between 1 and 10mb. so the full post might easiliy reach a few tens of megs. Am 18.07.2010 12:59, schrieb augustin: > On Sunday 18 July 2010 05:33:44 pm Artyom wrote: >> But this requires work and API design. So if you can propose some >> suggestions and requirements for >> such API, they may be actually implemented in CppCMS > > I piggy-back on this thread to ask a related question: > > It is one thing to upload a simple picture, a pdf, a text file or any kind of > small file. > It is another thing entirely to upload a 100MB or 1GB file... Must such big > files be uploaded via ftp? Isn't there any practical limit with the browser or > the HTTProtocol about such large file transfers? > > Frank: if you need an upload progress API, I presume it's precisely because > your application needs to process some large file transfers. Can you shed some > light on this topic? > >>From CppCMS's point of view, would the file size matter for the possibly > upcoming file transfer API? > > Thanks, > > Augustin. > > > -- 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: augustin <aug...@ov...> - 2010-07-18 11:00:51
|
On Sunday 18 July 2010 05:33:44 pm Artyom wrote: > But this requires work and API design. So if you can propose some > suggestions and requirements for > such API, they may be actually implemented in CppCMS I piggy-back on this thread to ask a related question: It is one thing to upload a simple picture, a pdf, a text file or any kind of small file. It is another thing entirely to upload a 100MB or 1GB file... Must such big files be uploaded via ftp? Isn't there any practical limit with the browser or the HTTProtocol about such large file transfers? Frank: if you need an upload progress API, I presume it's precisely because your application needs to process some large file transfers. Can you shed some light on this topic? From CppCMS's point of view, would the file size matter for the possibly upcoming file transfer API? 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-07-18 09:33:51
|
Hello, Currently, all upload is done without involvement of the user application, the user application is called only after processing all POST data. But better upload handling should be implemented in RC1, as part of better upload validation. It is in task list, see: http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_tasks#Implement+Pre-Upload+file+validation+-+Mrc. Generally as part of API I think it would be possible to add some upload hooks so the application can have better control over upload process and so it would be able to do anything, it wants. Additional option may be give to give an application full control over processing POST data. So in some cases, application could be "called" before actual POST data is transferred. In such case would be able to handle all notification as in regular comet application. But this requires work and API design. So if you can propose some suggestions and requirements for such API, they may be actually implemented in CppCMS :-) Best, Artyom P.S.: Isn't java-script has an ability to do such things on client side? > > hi, > > i need (must have) the possibility to know how much data of an ongoing > post to the cppcms application has been transmitted. i need to be able > to give somekind of upload progress feedback. when i'm not mistaken this > is not possible using cpcms - is there any workaround for that? or is it > possible to implement something like that? > > maybe somekind of instance which can be queried for in progress post > transfers using some kind of i which the js application also uses to > transmit the file in the post and returns the number of bytes > transmitted and if available the full size to be transmitted? > > any ideas? > > 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 > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Frank E. <fra...@an...> - 2010-07-18 07:50:48
|
hi, i need (must have) the possibility to know how much data of an ongoing post to the cppcms application has been transmitted. i need to be able to give somekind of upload progress feedback. when i'm not mistaken this is not possible using cpcms - is there any workaround for that? or is it possible to implement something like that? maybe somekind of instance which can be queried for in progress post transfers using some kind of i which the js application also uses to transmit the file in the post and returns the number of bytes transmitted and if available the full size to be transmitted? any ideas? 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: Artyom <art...@ya...> - 2010-07-15 09:10:28
|
BTW: You can submit patches via bug tracking system: https://sourceforge.net/tracker/?group_id=209965&atid=1011835 Commited to svn, Thanks Artyom P.S.: > I'm not sure if there is any specific reason why you didn't > commit it... Time :-) |
From: augustin <aug...@ov...> - 2010-07-15 08:08:31
|
Hello Artyom, Here is a first patch for you. First, there is the fix for the ICU version 4.0 bug, which is the first thing you helped me with. I'm not sure if there is any specific reason why you didn't commit it... Second, while testing... and breaking things, I experienced a segfault and noticed a bad string, fixed in this patch. yours, 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: augustin <aug...@ov...> - 2010-07-15 05:21:52
|
Hi Daniel, On Thursday 15 July 2010 08:59:05 am Daniel Vallejos wrote: > I recommend > > http://www.network-theory.co.uk/docs/gccintro/index.html > > Specially the sections: > > 2.7 Linking with external libraries > 11 How the compiler works. Woah! That's exactly what I was missing. :) I've already spent the last few hours reading it (slowly) starting from the very beginning. I'll study it throughout carefully. > Also note that -L flag is for directories that contains statics > libraries (.a) or dynamic libraries (.so "shared object"). Not for > headers files (-L/usr/local/include/dbixx/dbixx.h). I had the feeling I was doing something wrong... Thanks for correcting me. > When you fully understand how the preprocessor, the compiler and linker > works, the next step is learning to use a build system such as cmake. > This save a lot of time. Yep. That's one of the first things on my TODO list. I've made a small start already. > And finally, the next step is use a IDE. I > strongly recommend kdevelop 4. All these years, I've been using vim to code in PHP. I liked it enough. Someone recently recommended Eclipse Helios (on the Drupal devel list). I tried it a bit but found it too heavy. I remember having tried kdevelop 3, a few years ago, but it was not stable then and back then I was not yet committed to any serious C++ project. I think I'll follow your advice and give kdevelop 4 another try as soon as I am more familiar with the basics of C++ programming. I am a fan of KDE in general (using Kubuntu), so kdevelop should be a natural choice, now. Thanks again for your most useful pointers. Blessings, 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: Daniel V. <chi...@gm...> - 2010-07-15 00:59:17
|
You are welcome. I recommend http://www.network-theory.co.uk/docs/gccintro/index.html Specially the sections: 2.7 Linking with external libraries 11 How the compiler works. Also note that -L flag is for directories that contains statics libraries (.a) or dynamic libraries (.so "shared object"). Not for headers files (-L/usr/local/include/dbixx/dbixx.h). Also note, LD_LIBRARY_PATH is for runtime linking, not for compile time linking. When you fully understand how the preprocessor, the compiler and linker works, the next step is learning to use a build system such as cmake. This save a lot of time. And finally, the next step is use a IDE. I strongly recommend kdevelop 4. Regards. On Thu, 2010-07-15 at 05:23 +0800, augustin wrote: > On Thursday 15 July 2010 12:35:24 am Daniel Vallejos wrote: > > The problem is that you are not linking the dbixx library. > > > > The command is (for gcc) > > > > c++ ../sql_test.cpp -o SQL -L/path/to/dbixx_library -ldbixx > > > > You should read more about linking libraries. > > > > Thanks a lot Daniel. > > It now works using the mysql backend: > > overshoot@Augustin:~/git/cppcms/build$ c++ ../sql_test.cpp -o SQL -L > /usr/local/include/dbixx/dbixx.h -ldbixx > overshoot@Augustin:~/git/cppcms/build$ ./SQL > Moshe > There are 2 users > 1 Moshe > 2 Yossi > > I appreciate a lot the pointer about linked libraries. As I said earlier, I am > new with C++ and there are some concepts I do not fully grasp yet (the > compiling aspect is barely covered at all in all the tutorials and manuals I > have read so far. All focus on the C++ language itself). > > I have been perusing such sites as: > http://en.wikibooks.org/wiki/C++_Programming > http://www.cplusplus.com/ > and others. > (You're welcome to share your favourite C++ reference web site). > > And now that I know what to look for, I am about to study this: > http://linuxmafia.com/faq/Admin/ld-lib-path.html (They say: don't use > LD_LIBRARY_PATH) > http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html > http://www.cplusplus.com/query/search.cgi?q=linking+libraries > > :) > > Thanks again, > > Augustin. > > > |
From: augustin <aug...@ov...> - 2010-07-14 21:25:20
|
On Thursday 15 July 2010 12:35:24 am Daniel Vallejos wrote: > The problem is that you are not linking the dbixx library. > > The command is (for gcc) > > c++ ../sql_test.cpp -o SQL -L/path/to/dbixx_library -ldbixx > > You should read more about linking libraries. > Thanks a lot Daniel. It now works using the mysql backend: overshoot@Augustin:~/git/cppcms/build$ c++ ../sql_test.cpp -o SQL -L /usr/local/include/dbixx/dbixx.h -ldbixx overshoot@Augustin:~/git/cppcms/build$ ./SQL Moshe There are 2 users 1 Moshe 2 Yossi I appreciate a lot the pointer about linked libraries. As I said earlier, I am new with C++ and there are some concepts I do not fully grasp yet (the compiling aspect is barely covered at all in all the tutorials and manuals I have read so far. All focus on the C++ language itself). I have been perusing such sites as: http://en.wikibooks.org/wiki/C++_Programming http://www.cplusplus.com/ and others. (You're welcome to share your favourite C++ reference web site). And now that I know what to look for, I am about to study this: http://linuxmafia.com/faq/Admin/ld-lib-path.html (They say: don't use LD_LIBRARY_PATH) http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html http://www.cplusplus.com/query/search.cgi?q=linking+libraries :) Thanks again, 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: Daniel V. <chi...@gm...> - 2010-07-14 16:35:46
|
Hello, The problem is that you are not linking the dbixx library. The command is (for gcc) c++ ../sql_test.cpp -o SQL -L/path/to/dbixx_library -ldbixx You should read more about linking libraries. Good luck! On Wed, 2010-07-14 at 19:42 +0800, augustin wrote: > Hello, > > Is the DbiXX documentation up to date? > http://art-blog.no-ip.info/wikipp/en/page/tut_into_dbixx > I see that the last edit dates back to 2008. > > I followed the instructions to install the DbiXX libs and I think I installed > it properly. > But I cannot compile the exact same example as given at the top of the > tutorial above. See the compiler output at the bottom. > > I thought it was again a library path problem and tried various combination of > the advice you gave me previously ( export LD_LIBRARY_PATH=/usr/local/lib > etc.) but to no avail. > > Since the compiling method seems different, I'm not too sure how to proceed. > > > $ c++ ../sql_test.cpp -o SQL > /tmp/ccAkCTv1.o: In function `main': > sql_test.cpp:(.text+0x41): undefined reference to > `dbixx::session::session(std::basic_string<char, std::char_traits<char>, > std::allocator<char> > const&)' > sql_test.cpp:(.text+0xab): undefined reference to `dbixx::session::~session()' > sql_test.cpp:(.text+0x10a): undefined reference to > `dbixx::session::param(std::basic_string<char, std::char_traits<char>, > std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, > std::allocator<char> > const&)' > sql_test.cpp:(.text+0x201): undefined reference to > `dbixx::session::param(std::basic_string<char, std::char_traits<char>, > std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, > std::allocator<char> > const&)' > sql_test.cpp:(.text+0x28d): undefined reference to `dbixx::session::connect()' > sql_test.cpp:(.text+0x324): undefined reference to `dbixx::session::exec()' > sql_test.cpp:(.text+0x3c7): undefined reference to `dbixx::session::exec()' > sql_test.cpp:(.text+0x60a): undefined reference to > `dbixx::session::single(dbixx::row&)' > sql_test.cpp:(.text+0x76c): undefined reference to > `dbixx::session::fetch(dbixx::result&)' > sql_test.cpp:(.text+0x799): undefined reference to `dbixx::result::rows()' > sql_test.cpp:(.text+0x880): undefined reference to > `dbixx::result::next(dbixx::row&)' > sql_test.cpp:(.text+0x897): undefined reference to `dbixx::result::~result()' > sql_test.cpp:(.text+0x8ad): undefined reference to `dbixx::result::~result()' > sql_test.cpp:(.text+0x8c4): undefined reference to `dbixx::row::~row()' > sql_test.cpp:(.text+0x8da): undefined reference to `dbixx::row::~row()' > sql_test.cpp:(.text+0x8f1): undefined reference to `dbixx::session::~session()' > sql_test.cpp:(.text+0x907): undefined reference to `dbixx::session::~session()' > /tmp/ccAkCTv1.o: In function `dbixx::session::bind(int const&, bool)': > sql_test.cpp:(.text._ZN5dbixx7session4bindERKib[dbixx::session::bind(int > const&, bool)]+0x34): undefined reference to `dbixx::session::bind(long long > const&, bool)' > /tmp/ccAkCTv1.o: In function > `dbixx::session::operator<<(std::basic_string<char, std::char_traits<char>, > std::allocator<char> > const&)': > sql_test.cpp: > (.text._ZN5dbixx7sessionlsERKSs[dbixx::session::operator<<(std::basic_string<char, > std::char_traits<char>, std::allocator<char> > const&)]+0x1f): undefined > reference to `dbixx::session::query(std::basic_string<char, > std::char_traits<char>, std::allocator<char> > const&)' > /tmp/ccAkCTv1.o: In function `dbixx::session::operator,(dbixx::exec const&)': > sql_test.cpp:(.text._ZN5dbixx7sessioncmERKNS_4execE[dbixx::session::operator, > (dbixx::exec const&)]+0x18): undefined reference to `dbixx::session::exec()' > /tmp/ccAkCTv1.o: In function `dbixx::session& dbixx::session::operator,<char > const*>(char const*)': > sql_test.cpp:(.text._ZN5dbixx7sessioncmIPKcEERS0_T_[dbixx::session& > dbixx::session::operator,<char const*>(char const*)]+0x4a): undefined reference > to `dbixx::session::bind(std::basic_string<char, std::char_traits<char>, > std::allocator<char> > const&, bool)' > /tmp/ccAkCTv1.o: In function `dbixx::row& > dbixx::row::operator>><std::basic_string<char, std::char_traits<char>, > std::allocator<char> > >(std::basic_string<char, std::char_traits<char>, > std::allocator<char> >&)': > sql_test.cpp:(.text._ZN5dbixx3rowrsISsEERS0_RT_[dbixx::row& > dbixx::row::operator>><std::basic_string<char, std::char_traits<char>, > std::allocator<char> > >(std::basic_string<char, std::char_traits<char>, > std::allocator<char> >&)]+0x36): undefined reference to `dbixx::row::fetch(int, > std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)' > /tmp/ccAkCTv1.o: In function `dbixx::row& dbixx::row::operator>><int>(int&)': > sql_test.cpp:(.text._ZN5dbixx3rowrsIiEERS0_RT_[dbixx::row& > dbixx::row::operator>><int>(int&)]+0x36): undefined reference to > `dbixx::row::fetch(int, int&)' > collect2: ld returned 1 exit status > > > > |
From: augustin <aug...@ov...> - 2010-07-14 11:43:40
|
Hello, Is the DbiXX documentation up to date? http://art-blog.no-ip.info/wikipp/en/page/tut_into_dbixx I see that the last edit dates back to 2008. I followed the instructions to install the DbiXX libs and I think I installed it properly. But I cannot compile the exact same example as given at the top of the tutorial above. See the compiler output at the bottom. I thought it was again a library path problem and tried various combination of the advice you gave me previously ( export LD_LIBRARY_PATH=/usr/local/lib etc.) but to no avail. Since the compiling method seems different, I'm not too sure how to proceed. $ c++ ../sql_test.cpp -o SQL /tmp/ccAkCTv1.o: In function `main': sql_test.cpp:(.text+0x41): undefined reference to `dbixx::session::session(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' sql_test.cpp:(.text+0xab): undefined reference to `dbixx::session::~session()' sql_test.cpp:(.text+0x10a): undefined reference to `dbixx::session::param(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' sql_test.cpp:(.text+0x201): undefined reference to `dbixx::session::param(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' sql_test.cpp:(.text+0x28d): undefined reference to `dbixx::session::connect()' sql_test.cpp:(.text+0x324): undefined reference to `dbixx::session::exec()' sql_test.cpp:(.text+0x3c7): undefined reference to `dbixx::session::exec()' sql_test.cpp:(.text+0x60a): undefined reference to `dbixx::session::single(dbixx::row&)' sql_test.cpp:(.text+0x76c): undefined reference to `dbixx::session::fetch(dbixx::result&)' sql_test.cpp:(.text+0x799): undefined reference to `dbixx::result::rows()' sql_test.cpp:(.text+0x880): undefined reference to `dbixx::result::next(dbixx::row&)' sql_test.cpp:(.text+0x897): undefined reference to `dbixx::result::~result()' sql_test.cpp:(.text+0x8ad): undefined reference to `dbixx::result::~result()' sql_test.cpp:(.text+0x8c4): undefined reference to `dbixx::row::~row()' sql_test.cpp:(.text+0x8da): undefined reference to `dbixx::row::~row()' sql_test.cpp:(.text+0x8f1): undefined reference to `dbixx::session::~session()' sql_test.cpp:(.text+0x907): undefined reference to `dbixx::session::~session()' /tmp/ccAkCTv1.o: In function `dbixx::session::bind(int const&, bool)': sql_test.cpp:(.text._ZN5dbixx7session4bindERKib[dbixx::session::bind(int const&, bool)]+0x34): undefined reference to `dbixx::session::bind(long long const&, bool)' /tmp/ccAkCTv1.o: In function `dbixx::session::operator<<(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': sql_test.cpp: (.text._ZN5dbixx7sessionlsERKSs[dbixx::session::operator<<(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x1f): undefined reference to `dbixx::session::query(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /tmp/ccAkCTv1.o: In function `dbixx::session::operator,(dbixx::exec const&)': sql_test.cpp:(.text._ZN5dbixx7sessioncmERKNS_4execE[dbixx::session::operator, (dbixx::exec const&)]+0x18): undefined reference to `dbixx::session::exec()' /tmp/ccAkCTv1.o: In function `dbixx::session& dbixx::session::operator,<char const*>(char const*)': sql_test.cpp:(.text._ZN5dbixx7sessioncmIPKcEERS0_T_[dbixx::session& dbixx::session::operator,<char const*>(char const*)]+0x4a): undefined reference to `dbixx::session::bind(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)' /tmp/ccAkCTv1.o: In function `dbixx::row& dbixx::row::operator>><std::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)': sql_test.cpp:(.text._ZN5dbixx3rowrsISsEERS0_RT_[dbixx::row& dbixx::row::operator>><std::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)]+0x36): undefined reference to `dbixx::row::fetch(int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)' /tmp/ccAkCTv1.o: In function `dbixx::row& dbixx::row::operator>><int>(int&)': sql_test.cpp:(.text._ZN5dbixx3rowrsIiEERS0_RT_[dbixx::row& dbixx::row::operator>><int>(int&)]+0x36): undefined reference to `dbixx::row::fetch(int, int&)' collect2: ld returned 1 exit status -- 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-07-14 10:42:25
|
> > if you don't mind i'd like to ask one further question. the > target of > the project i'm working on is to work with many, many > longpoll > connections so i'm wondering why i need to nginx in front > of cppcms. > wouldn't it be more efficient to have cppcms handle the > http > communication itself? Probably > what are the advantages using a > webserver in front > of cppcms (besides that it could deliver static content, > etc..) > It would require implementation of highly secure HTTP connector for CppCMS which is rather not simple as it would require access from outside world. HTTP servers very common targets for attacks so, it is better to have a good server in front of you rather then developing your own. So HTTP server gives you solid well debugged front end that hides you from intruders. Also CppCMS's HTTP server is very simple and developed for debugging purposes only, also you may deploy it behind proxy if it sanitises the input well. Regards, Artyom |
From: Frank E. <fra...@an...> - 2010-07-14 10:13:44
|
ok - then i'll switch over to fastcgi. thanks for investigating this. the SCRIPT_NAME and PATH_INFO issue gave me also a lot of headache, but i emulate them by using rewrite rules within nginx: location ~ ^/.* { set $script $uri; set $path_info ""; if ($uri ~ "^/([^/]+)(/?.*)$") { set $script $1; set $path_info $2; } scgi_pass 127.0.0.1:8080; include scgi_params; scgi_param SCRIPT_NAME $script; scgi_param PATH_INFO $path_info; } if you don't mind i'd like to ask one further question. the target of the project i'm working on is to work with many, many longpoll connections so i'm wondering why i need to nginx in front of cppcms. wouldn't it be more efficient to have cppcms handle the http communication itself? what are the advantages using a webserver in front of cppcms (besides that it could deliver static content, etc..) thanks, frank Am 14.07.2010 12:07, schrieb Artyom: > Hello, > > Looks like Nginx's SCGI backend does not confirm to CGI/SCGI standard > See: http://wiki.nginx.org/NginxNgxSCGIModule bugs section. > > So I would suggest using FastCGI with nginx or use other web server like > lighttpd or apache that has confirming implementations. > > Regards, > Artyom > > > P.S.: Also I see that according to documentation of Nginx's SCGI: > "In the current version SCRIPT_NAME and PATH_INFO are not defined. > they are very important for CppCMS applications correct dispatching. > > > >> >> thanks for pointing this out. it now works (yippie) but if i omit >> setting the status explicit to 200 i still get no response headers. from >> your mail i think it should default to 200 - shouldn't it? or is this a >> flaw in the nginx's scgi implementation.. >> >> thanks again, >> >> frank. >> > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > 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-07-14 10:07:56
|
Hello, Looks like Nginx's SCGI backend does not confirm to CGI/SCGI standard See: http://wiki.nginx.org/NginxNgxSCGIModule bugs section. So I would suggest using FastCGI with nginx or use other web server like lighttpd or apache that has confirming implementations. Regards, Artyom P.S.: Also I see that according to documentation of Nginx's SCGI: "In the current version SCRIPT_NAME and PATH_INFO are not defined. they are very important for CppCMS applications correct dispatching. > > thanks for pointing this out. it now works (yippie) but if i omit > setting the status explicit to 200 i still get no response headers. from > your mail i think it should default to 200 - shouldn't it? or is this a > flaw in the nginx's scgi implementation.. > > thanks again, > > frank. > |
From: Frank E. <fra...@an...> - 2010-07-14 09:24:58
|
thanks for pointing this out. it now works (yippie) but if i omit setting the status explicit to 200 i still get no response headers. from your mail i think it should default to 200 - shouldn't it? or is this a flaw in the nginx's scgi implementation.. thanks again, frank. Am 14.07.2010 10:41, schrieb Artyom: > Ok, after quick look on our code the problem is obvious: > > You can't change response headers **after** writing data to output stream > as in *CGI protocol all headers must be written before the response body. > > See: > http://art-blog.no-ip.info/cppcms_ref_v0_99_1/classcppcms_1_1http_1_1response.html#39e48c676a3f2c79b26d60b8d455658c > > > > So you must do all changed in headers before writing to output stream. > > So instead of: > > release_context()->async_complete_response(); > > You need: > > > response().set_content_header("text/plain"); > response().status(200); > response().out() << "test"; > release_context()->async_complete_response(); > > Notes: > > - Status is assumed be default in CGI protocols as 200, so you don't > need to set it explicitly, one status like 404, 400 or 301 > require explicit CGI header Status: > - You may use response().set_plain_text_header() instead of writing: > response().set_content_header("text/plain"); (which does the same). > > So in short you may write this as: > > response().set_plain_text_header(); > response().out() << "test"; > release_context()->async_complete_response(); > > Note, set_content_header(std::string) still adds charset by default, > > See: > http://art-blog.no-ip.info/cppcms_ref_v0_99_1/classcppcms_1_1http_1_1response.html#50ae55ff605bc655f5b19021f0f4f71d > > > So if you want to set raw header use set_header(name,value) function. > > > >> what remains is the header issue. my test application still sends only >> the content without headers. i attached capture from wireshark of the >> http conversation between server and browser and the scgi conversation >> between nginx and the application. while in the http conversation no >> response headers are shown the scgi dump shows that at least >> content-type and x-powered had been sent. nginx obviously filtered them >> out due to the missing standard headers. the test application has been >> compiled against svn-1317. >> >> i also attached the application again since i did the changes you >> suggested. i also tried to set the status code explicitly without success. >> > > Artyom > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > 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-07-14 08:41:20
|
Ok, after quick look on our code the problem is obvious: You can't change response headers **after** writing data to output stream as in *CGI protocol all headers must be written before the response body. See: http://art-blog.no-ip.info/cppcms_ref_v0_99_1/classcppcms_1_1http_1_1response.html#39e48c676a3f2c79b26d60b8d455658c So you must do all changed in headers before writing to output stream. So instead of: release_context()->async_complete_response(); You need: response().set_content_header("text/plain"); response().status(200); response().out() << "test"; release_context()->async_complete_response(); Notes: - Status is assumed be default in CGI protocols as 200, so you don't need to set it explicitly, one status like 404, 400 or 301 require explicit CGI header Status: - You may use response().set_plain_text_header() instead of writing: response().set_content_header("text/plain"); (which does the same). So in short you may write this as: response().set_plain_text_header(); response().out() << "test"; release_context()->async_complete_response(); Note, set_content_header(std::string) still adds charset by default, See: http://art-blog.no-ip.info/cppcms_ref_v0_99_1/classcppcms_1_1http_1_1response.html#50ae55ff605bc655f5b19021f0f4f71d So if you want to set raw header use set_header(name,value) function. > what remains is the header issue. my test application still sends only > the content without headers. i attached capture from wireshark of the > http conversation between server and browser and the scgi conversation > between nginx and the application. while in the http conversation no > response headers are shown the scgi dump shows that at least > content-type and x-powered had been sent. nginx obviously filtered them > out due to the missing standard headers. the test application has been > compiled against svn-1317. > > i also attached the application again since i did the changes you > suggested. i also tried to set the status code explicitly without success. > Artyom |
From: Frank E. <fra...@an...> - 2010-07-14 06:18:53
|
hi artyom, the 404 issue is now fixed. making response().finalize() going away is also much more intuitive; the cleanup after main if the application didn't do so also. what remains is the header issue. my test application still sends only the content without headers. i attached capture from wireshark of the http conversation between server and browser and the scgi conversation between nginx and the application. while in the http conversation no response headers are shown the scgi dump shows that at least content-type and x-powered had been sent. nginx obviously filtered them out due to the missing standard headers. the test application has been compiled against svn-1317. i also attached the application again since i did the changes you suggested. i also tried to set the status code explicitly without success. maybe you can have a look at this again - maybe i just made some mistake in the application.. frank.. Am 13.07.2010 23:29, schrieb Artyom: > Hello, > > > >> >> hey, >> >> i switched to the beta. however the problem with the missing response >> headers persist. so please notify me when you commit changes that should >> address this. meanwhile i try to live without response headers. > > > Ok. I cleaup the synchronous and asynchronous request handling added test cases > for both, > now it looks fine, including sending 404 in case of unmapped url. > > Hopefully no more surprises are expected. > > One important change in behavior had added: > > - if the application do not releases asynchronous request before exiting main > function, it is automatically > finalized and closed, so if you want to postpone response, don't forget to > call release_context(). > - it is no more required to call response().finalized() function as > async_complete_response() does all job. > > > Thanks for the issue report, > > Artyom > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > 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: augustin <aug...@ov...> - 2010-07-14 04:44:40
|
On Wednesday 14 July 2010 12:08:32 pm Artyom wrote: > This is not really correct, each user should decide where to install > libraries, he may even want to install them to /opt/cppcms so he can > easily remove them afterwards. Only packagers generally install to `/usr`. > > So I rolled back changed and added this to troubleshooting page with > description of the issue so user can fix it even if library is installed > into hist home directory. Ok, that's great this way, too :) 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/ . |