From bdcb8b8e9b287c3a378fd4e09979e434eb2847e3 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Mon, 5 Nov 2012 12:01:30 +0100 Subject: [PATCH] Better fix for previous commit. --- src/conn_http.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/conn_http.cpp b/src/conn_http.cpp index 312c88f2..c56daa5a 100644 --- a/src/conn_http.cpp +++ b/src/conn_http.cpp @@ -339,7 +339,7 @@ namespace Connector_HTTP{ conn->setBlocking(false);//do not block on conn.spool() when no data is available HTTP::Parser Client; while (conn->connected()){ - if (conn->Received().size() || conn->spool()){ + if (conn->spool() || conn->Received().size()){ //make sure it ends in a \n if (*(conn->Received().get().rbegin()) != '\n'){ std::string tmp = conn->Received().get(); @@ -369,9 +369,6 @@ namespace Connector_HTTP{ std::cout << "Completed request (" << conn->getSocket() << ") " << handler << " in " << (Util::getMS() - startms) << " ms" << std::endl; #endif Client.Clean(); //clean for any possible next requests - }else{ - //make sure connections get cleaned up properly when disconnected part-way into a request - conn->spool(); } }else{ usleep(10000);//sleep 10ms