X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/6bffb655ac989fe4f115763270f84175bf24e4bb..ad06ae2e40db5ce588092d90e1e089f527c27f84:/Server/src/httpmessage.cpp?ds=sidebyside diff --git a/Server/src/httpmessage.cpp b/Server/src/httpmessage.cpp index ba2b825..6aad1ef 100644 --- a/Server/src/httpmessage.cpp +++ b/Server/src/httpmessage.cpp @@ -73,7 +73,6 @@ istream& operator>>(istream& is, HTTPMessage& m) { cerr << __FILE__ << ": operator>>()" << endl; #endif // DEBUG char buf[BUFSIZ]; - bool is_header = true; while (is.getline(buf, BUFSIZ)) { String sbuf(buf); sbuf.trim(); @@ -85,16 +84,14 @@ istream& operator>>(istream& is, HTTPMessage& m) { } else { // Hay Content-Length, entonces hay body (no respeta RFC AFAIK). if (m.headers.find("Content-Length") != m.headers.end()) { - // Descarta la línea vacía para separar las cabeceras. - is.getline(buf, BUFSIZ); stringstream ss(m.headers["Content-Length"]); streamsize size; ss >> size; - char* buf2 = new char[size+1]; + char* const buf2 = new char[size+1]; if (is.readsome(buf2, size)) { m.body = buf2; } - delete buf2[]; + delete []buf2; } // Después de una línea vacía, haya obtenido el body o no, sale del // while.