From ad06ae2e40db5ce588092d90e1e089f527c27f84 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Thu, 13 Nov 2003 03:42:43 +0000 Subject: [PATCH] Se arreglan algunos bugs. Ahora compila. --- Server/include/plaqui/server/controlclient.h | 5 +++-- Server/src/controlclient.cpp | 1 + Server/src/httpmessage.cpp | 7 ++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Server/include/plaqui/server/controlclient.h b/Server/include/plaqui/server/controlclient.h index 6eabc85..95682c5 100644 --- a/Server/include/plaqui/server/controlclient.h +++ b/Server/include/plaqui/server/controlclient.h @@ -28,6 +28,7 @@ #ifndef PLAQUI_CONTROLCLIENT_H #define PLAQUI_CONTROLCLIENT_H +#include "plaqui/server/command.h" #include "plaqui/server/connection.h" #include @@ -43,10 +44,10 @@ namespace Server { public: /// Tipo de señal para indicar que se recibió una respuesta OK. - typedef SigC::signal0 SignalOKReceived; + typedef SigC::Signal0 SignalOKReceived; /// Tipo de señal para indicar que se recibió un error. - typedef SigC::signal0 SignalErrorReceived; + typedef SigC::Signal0 SignalErrorReceived; // Atributos. diff --git a/Server/src/controlclient.cpp b/Server/src/controlclient.cpp index ffce9c0..afdd073 100644 --- a/Server/src/controlclient.cpp +++ b/Server/src/controlclient.cpp @@ -25,6 +25,7 @@ // $Id$ // +#include "plaqui/server/httpresponse.h" #include "plaqui/server/controlclient.h" #ifdef DEBUG # include 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. -- 2.43.0