aboutsummaryrefslogtreecommitdiff
path: root/src/protocolhttp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocolhttp.cpp')
-rw-r--r--src/protocolhttp.cpp5
1 files changed, 2 insertions, 3 deletions
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 )
25 iState = 0; 25 iState = 0;
26} 26}
27 27
28//#define SDB( i ) { }
28#define SDB( i ) printf("state %d: %d, \"%s\"\n", i, tt, sToken.getStr() ) 29#define SDB( i ) printf("state %d: %d, \"%s\"\n", i, tt, sToken.getStr() )
29 30
30void Bu::ProtocolHttp::onNewData( Bu::Client *pClient ) 31void Bu::ProtocolHttp::onNewData( Bu::Client *pClient )
@@ -62,7 +63,6 @@ void Bu::ProtocolHttp::onNewData( Bu::Client *pClient )
62 SDB( 2 ); 63 SDB( 2 );
63 if( strncmp( sToken.getStr(), "HTTP/", 5 ) ) 64 if( strncmp( sToken.getStr(), "HTTP/", 5 ) )
64 { 65 {
65 printf("not http, disconnect.\n");
66 pClient->disconnect(); 66 pClient->disconnect();
67 return; 67 return;
68 } 68 }
@@ -72,7 +72,6 @@ void Bu::ProtocolHttp::onNewData( Bu::Client *pClient )
72 s = sToken.getStr()+5; 72 s = sToken.getStr()+5;
73 iMajor = strtol( s, &s2, 10 ); 73 iMajor = strtol( s, &s2, 10 );
74 iMinor = strtol( s2+1, NULL, 10 ); 74 iMinor = strtol( s2+1, NULL, 10 );
75 printf("HTTP: %d.%d\n", iMajor, iMinor );
76 iState = 3; 75 iState = 3;
77 } 76 }
78 break; 77 break;
@@ -132,7 +131,6 @@ void Bu::ProtocolHttp::onNewData( Bu::Client *pClient )
132 131
133 case 20: 132 case 20:
134 SDB( 20 ); 133 SDB( 20 );
135 printf("Content!");
136 break; 134 break;
137 } 135 }
138 } 136 }
@@ -231,6 +229,7 @@ void Bu::ProtocolHttp::earlyResponse()
231 if( sMethod == "GET" ) 229 if( sMethod == "GET" )
232 { 230 {
233 onRequest( sMethod, sPath ); 231 onRequest( sMethod, sPath );
232 iState = 0;
234 } 233 }
235 else 234 else
236 { 235 {