Author: wyoung
Date: Fri Jul 6 23:00:50 2007
New Revision: 1649
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1649&view=rev
Log:
More conservative handling of BLOB data in cgi_jpeg. Previous version
probably only worked accidentally, because it still did the erroneous
conversion from ColData via cchar that we ran into in 2.2 and earlier.
Explicitly converting the BLOB to a std::string as an intermediate to
avoid this.
Modified:
trunk/examples/cgi_jpeg.cpp
Modified: trunk/examples/cgi_jpeg.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/cgi_jpeg.cpp?rev=1649&r1=1648&r2=1649&view=diff
==============================================================================
--- trunk/examples/cgi_jpeg.cpp (original)
+++ trunk/examples/cgi_jpeg.cpp Fri Jul 6 23:00:50 2007
@@ -83,9 +83,10 @@
ResUse res = query.use();
if (res) {
images img = res.fetch_row();
+ string img_data(img.data, img.data.length());
cout << "Content-type: image/jpeg" << endl;
- cout << "Content-length: " << img.data.length() <<
"\n\n";
- cout << img.data;
+ cout << "Content-length: " << img_data.length() <<
"\n\n";
+ cout << img_data;
}
else {
cout << "Content-type: text/plain" << endl << endl;
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits