summaryrefslogtreecommitdiff
authorspiralman <spiralman>2002-08-02 21:09:06 (UTC)
committer spiralman <spiralman>2002-08-02 21:09:06 (UTC)
commitb228f8134306f469ec78ae8ab00ea5fdc0853538 (patch) (unidiff)
treeefaedf7f15eb661665a71b678f6a07ce22a25c95
parentd3a54af5288cd30fc1a4f2dafc9f848b245046d6 (diff)
downloadopie-b228f8134306f469ec78ae8ab00ea5fdc0853538.zip
opie-b228f8134306f469ec78ae8ab00ea5fdc0853538.tar.gz
opie-b228f8134306f469ec78ae8ab00ea5fdc0853538.tar.bz2
fixed some bugs in chunked encoding stuff, but it still doesnt work. feels very close though...
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/ubrowser/httpcomm.cpp33
1 files changed, 26 insertions, 7 deletions
diff --git a/noncore/net/ubrowser/httpcomm.cpp b/noncore/net/ubrowser/httpcomm.cpp
index b086b58..3c14053 100644
--- a/noncore/net/ubrowser/httpcomm.cpp
+++ b/noncore/net/ubrowser/httpcomm.cpp
@@ -150,6 +150,7 @@ void HttpComm::incoming()
150 sclength.truncate(j); 150 sclength.truncate(j);
151 clength = sclength.toUInt(0, 16); 151 clength = sclength.toUInt(0, 16);
152 printf("HttpComm::Incoming: chunk length: %d\n", clength); 152 printf("HttpComm::Incoming: chunk length: %d\n", clength);
153 printf("HttpComm::Incoming: chunk length string: %s\n", sclength.latin1());
153 //end of data 154 //end of data
154 if(clength==0) 155 if(clength==0)
155 { 156 {
@@ -160,7 +161,7 @@ void HttpComm::incoming()
160 //still more, but it hasnt been recieved yet 161 //still more, but it hasnt been recieved yet
161 if(ba <= j) 162 if(ba <= j)
162 { 163 {
163 status=1; 164 status=2;
164 done=true; 165 done=true;
165 break; 166 break;
166 } 167 }
@@ -187,15 +188,24 @@ void HttpComm::incoming()
187 printf("%s", newTQstring.latin1() ); 188 printf("%s", newTQstring.latin1() );
188 printf("HttpComm::incoming: end new body piece 1.\n"); 189 printf("HttpComm::incoming: end new body piece 1.\n");
189 status=0; 190 status=0;
190 j=clength-bRead; 191 tempQString = tempQString.remove(0, clength);
191 done=false; 192 done=false;
192 // break; 193 // break;
193 } 194 }
194 //the chunk extends beyond the current data; 195 //the chunk extends beyond the current data;
195 else 196 else
196 { 197 {
197 body+=tempQString; 198 if(tempQString.length() <= ba)
198 bRead+=tempQString.length(); 199 {
200 body+=tempQString;
201 bRead+=tempQString.length();
202 }
203 else
204 {
205 tempQString.truncate(ba);
206 body+=tempQString;
207 bRead+=tempQString.length();
208 }
199 printf("HttpComm::incoming: start new body piece 2: \n"); 209 printf("HttpComm::incoming: start new body piece 2: \n");
200 printf("%s", tempQString.latin1() ); 210 printf("%s", tempQString.latin1() );
201 printf("HttpComm::incoming: end new body piece 2.\n"); 211 printf("HttpComm::incoming: end new body piece 2.\n");
@@ -217,15 +227,24 @@ void HttpComm::incoming()
217 printf("%s", newTQstring.latin1() ); 227 printf("%s", newTQstring.latin1() );
218 printf("HttpComm::incoming: end new body piece 3.\n"); 228 printf("HttpComm::incoming: end new body piece 3.\n");
219 status=0; 229 status=0;
220 j=clength-bRead; 230 tempQString = tempQString.remove(0, clength);
221 done=false; 231 done=false;
222 // break; 232 // break;
223 } 233 }
224 //the chunk extends beyond the current data; 234 //the chunk extends beyond the current data;
225 else 235 else
226 { 236 {
227 body+=tempQString; 237 if(tempQString.length() <= ba)
228 bRead+=tempQString.length(); 238 {
239 body+=tempQString;
240 bRead+=tempQString.length();
241 }
242 else
243 {
244 tempQString.truncate(ba);
245 body+=tempQString;
246 bRead+=tempQString.length();
247 }
229 printf("HttpComm::incoming: start new body piece 4: \n"); 248 printf("HttpComm::incoming: start new body piece 4: \n");
230 printf("%s", tempQString.latin1() ); 249 printf("%s", tempQString.latin1() );
231 printf("HttpComm::incoming: end new body piece 4.\n"); 250 printf("HttpComm::incoming: end new body piece 4.\n");