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;
}