blob: 9b4ccdab46239772a1ff29784242a9afeb370ccc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
readchunk:
if(semi != 0)
{
printf("HttpComm::incoming: semi !=0\n");
QString newBody = tempString;
if(i != 0)
{
printf("HttpComm::incoming: striping header2\n");
newBody.remove(0,i);
}
newBody=newBody.remove(0, semi);
if(newBody.length() > clength)
{
newBody.truncate(clength);
nextChunk = true;
}
body += newBody;
bRead += newBody.length();
printf("HttpComm::incoming: start body chunk1\n");
printf("%s", newBody.latin1());
printf("\nHttpComm::incoming: end body chunk\n");
printf("HttpComm::incoming: bRead: %d\n", bRead);
if(nextChunk)
{
QString tmpQString = tempString;
tmpQString=tmpQString.remove(0, clength);
tempString = (char *)tmpQString.latin1();
lengthset=false;
goto topchunk;
}
}
else
{
if( (bRead + ba) > clength)
{
// int bRead2=bRead;
for(; bRead < clength; bRead++)
{
body+=tempString[j];
// bRead++;
}
}
else
{
body += tempString;
bRead += ba;
}
printf("HttpComm::incoming: start body chunk2\n");
printf("%s", tempString);
printf("\nHttpComm::incoming: end body chunk\n");
printf("HttpComm::incoming: bRead: %d\n", bRead);
}
if(bRead >= clength)
{
printf("HttpComm::incoming: end chunk\n");
lengthset=false;
}
|