]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Server/src/controlserver.cpp
Se arreglan detalles, ya compila pero se cuelga cuando se conecta un cliente.
[z.facultad/75.42/plaqui.git] / Server / src / controlserver.cpp
index 348d77265c1ea4b177765328c6e7fc232aa7a2b9..144d236e2b967140c28aa4b05ad0da38b63909af 100644 (file)
@@ -56,7 +56,7 @@ void ControlServer::real_run(void) {
 #ifdef DEBUG
        cerr << __FILE__ << ": real_run()" << endl;
 #endif // DEBUG
-       char buf[BUFSIZ];
+       //char buf[BUFSIZ];
        while (!stop) {
                HTTPRequest request;
                socket >> request;
@@ -99,11 +99,11 @@ void ControlServer::real_run(void) {
                // Command command = parse_command(request.uri);
                //signal_command_received().emit(command);
 #ifdef DEBUG
-               cerr << "Request: " << endl;
-               for (Request::const_iterator i = request.begin(); i != request.end();
-                               i++) {
-                       cerr << "   " << i->first << ": " << i->second << endl;
-               }
+               cerr << "Request: " << request << endl;
+               //for (HTTPRequest::const_iterator i = request.begin();
+               //              i != request.end(); i++) {
+               //      cerr << "   " << i->first << ": " << i->second << endl;
+               //}
 #endif // DEBUG
                // FIXME - hacer respuesta XML.
                // La respuesta hay que mandarla asincrónicamente porque no puedo
@@ -127,8 +127,8 @@ Accept-Ranges: bytes
                response_xml << "        <p>versión 0.2</p>" << endl;
                response_xml << "        <h2>Pedido HTTP</h2>" << endl;
                response_xml << "        <ul>" << endl;
-               for (Request::const_iterator i = request.begin(); i != request.end();
-                               i++) {
+               for (HTTPHeaders::const_iterator i = request.headers.begin();
+                               i != request.headers.end(); i++) {
                        response_xml << "           <li><b>" << i->first << ":</b> "
                                << i->second << endl;
                }