]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Server/src/httpmessage.cpp
Se corrige el bug al parsear el xml.
[z.facultad/75.42/plaqui.git] / Server / src / httpmessage.cpp
index 260fe80fcc8b76b56e6f1bc0fbe015400bfe50d8..b9d0d28cdb845171ae6541719413ed3896fe0f8c 100644 (file)
@@ -85,8 +85,17 @@ istream& operator>>(istream& is, HTTPMessage& m) {
                                streamsize size;
                                to(m.headers["Content-Length"], size);
                                char* const buf2 = new char[size+1];
-                               if (is.readsome(buf2, size)) {
-                                       m.body = buf2;
+                               if (is.readsome(buf2, size) == size) {
+                                       // Agrego fin de string porque el readsome no lo hace.
+                                       buf2[size] = '\0';
+                                       m.set_body(buf2);
+#ifdef DEBUG
+                               } else {
+                               // TODO dar error?
+                                       cerr << __FILE__ << "(" << __LINE__ << ")"
+                                               << ": operator>>() ERROR!!! Caracteres extraidos: "
+                                               << n << endl;
+#endif // DEBUG
                                }
                                delete []buf2;
                        }