X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/1855f998e5c0e51e2c1958724ac84cc13a87d84c..d61490999af17b602d7208ada92840cddc4eff6a:/Server/src/httpmessage.cpp diff --git a/Server/src/httpmessage.cpp b/Server/src/httpmessage.cpp index 260fe80..b9d0d28 100644 --- a/Server/src/httpmessage.cpp +++ b/Server/src/httpmessage.cpp @@ -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; }