diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-10-08 04:38:22 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-10-08 04:38:22 +0000 |
commit | 4a166239394cf859a36c63bdfaa5c4a6a2252739 (patch) | |
tree | 4cc789dfc86896f203166fb7e0f641408e3e39ec /src | |
parent | fe1862511da4a6d66e2f11ba633c035c3cf7b14f (diff) | |
download | libbu++-4a166239394cf859a36c63bdfaa5c4a6a2252739.tar.gz libbu++-4a166239394cf859a36c63bdfaa5c4a6a2252739.tar.bz2 libbu++-4a166239394cf859a36c63bdfaa5c4a6a2252739.tar.xz libbu++-4a166239394cf859a36c63bdfaa5c4a6a2252739.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/protocolhttp.cpp | 5 |
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 | ||
30 | void Bu::ProtocolHttp::onNewData( Bu::Client *pClient ) | 31 | void 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 | { |