From 4a166239394cf859a36c63bdfaa5c4a6a2252739 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 8 Oct 2007 04:38:22 +0000 Subject: Modified the NFA to allow for keep-alive, that made everything seem to work much better. I'll have to check to make sure the rest of the system is still working well, but so far it looks like it. Right now it allows pipelining and general keep alive, but it doesn't check the keep-alive variable, it just always does it. While this isn't a bad thing, it does go against the RFCs SHOULDs. --- src/protocolhttp.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/protocolhttp.cpp b/src/protocolhttp.cpp index 2f57bdb..e962b7a 100644 --- a/src/protocolhttp.cpp +++ b/src/protocolhttp.cpp @@ -25,6 +25,7 @@ void Bu::ProtocolHttp::onNewConnection( Bu::Client *pClient ) iState = 0; } +//#define SDB( i ) { } #define SDB( i ) printf("state %d: %d, \"%s\"\n", i, tt, sToken.getStr() ) void Bu::ProtocolHttp::onNewData( Bu::Client *pClient ) @@ -62,7 +63,6 @@ void Bu::ProtocolHttp::onNewData( Bu::Client *pClient ) SDB( 2 ); if( strncmp( sToken.getStr(), "HTTP/", 5 ) ) { - printf("not http, disconnect.\n"); pClient->disconnect(); return; } @@ -72,7 +72,6 @@ void Bu::ProtocolHttp::onNewData( Bu::Client *pClient ) s = sToken.getStr()+5; iMajor = strtol( s, &s2, 10 ); iMinor = strtol( s2+1, NULL, 10 ); - printf("HTTP: %d.%d\n", iMajor, iMinor ); iState = 3; } break; @@ -132,7 +131,6 @@ void Bu::ProtocolHttp::onNewData( Bu::Client *pClient ) case 20: SDB( 20 ); - printf("Content!"); break; } } @@ -231,6 +229,7 @@ void Bu::ProtocolHttp::earlyResponse() if( sMethod == "GET" ) { onRequest( sMethod, sPath ); + iState = 0; } else { -- cgit v1.2.3