X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/7e74b790d290cd7d776349503bb361c47933c01f..c5c8d16a2d8c4a0ec1a8d3e83104f73512c91001:/Server/src/httpmessage.cpp diff --git a/Server/src/httpmessage.cpp b/Server/src/httpmessage.cpp index 260fe80..cda5064 100644 --- a/Server/src/httpmessage.cpp +++ b/Server/src/httpmessage.cpp @@ -85,9 +85,11 @@ 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); + } // TODO else dar error? delete []buf2; } // Después de una línea vacía, haya obtenido el body o no, sale del