|
Re: How to copy data from a pointer into a char not another pointer July 23, 2009 06:54PM | Registered: 17 years ago Posts: 405 |
HTTP/1.1 200 OK Cache-Control: private, max-age=0 Date: Wed, 22 Jul 2009 18:14:11 GMT Expires: -1 Content-Type: text/html; charset=ISO-8859-1 Set-Cookie: PREF=ID=4620d9e95c8c2ef6:TM=1248286451:LM=1248286451:S=gjw09cMxpIa8uxrZ; expires=Fri, 22-Jul-2011 18:14:11 GMT; path=/; domain=.google.co.uk 1248286451 Server: gws Transfer-Encoding: chunked
|
Re: How to copy data from a pointer into a char not another pointer July 23, 2009 07:58PM | Registered: 17 years ago Posts: 405 |
if(*line == "Transfer-Encoding: chunked")
|
Re: How to copy data from a pointer into a char not another pointer July 23, 2009 08:33PM | Registered: 17 years ago Posts: 703 |
|
Re: How to copy data from a pointer into a char not another pointer July 23, 2009 09:45PM | Registered: 17 years ago Posts: 265 |
|
Re: How to copy data from a pointer into a char not another pointer July 24, 2009 11:31AM | Registered: 17 years ago Posts: 405 |
|
Re: How to copy data from a pointer into a char not another pointer July 24, 2009 12:29PM | Registered: 17 years ago Posts: 1,012 |
|
Re: How to copy data from a pointer into a char not another pointer July 24, 2009 01:29PM | Registered: 17 years ago Posts: 405 |
[chunk 1 size] [chunk 1 data] [chunk 2 size] [chunk 2 data] ...
if(chunk)
{
char *line = tcp_readln (s, 0xff, gettime(), HTTP_TIMEOUT);
int i = 0;
for(i=0;i<32;i++)
{
Debugs(line);
}
}|
Re: How to copy data from a pointer into a char not another pointer July 24, 2009 08:29PM | Registered: 17 years ago Posts: 405 |
|
Re: How to copy data from a pointer into a char not another pointer July 25, 2009 12:14AM | Registered: 16 years ago Posts: 379 |
|
Re: How to copy data from a pointer into a char not another pointer July 25, 2009 12:20PM | Registered: 17 years ago Posts: 405 |
length := 0
read chunk-size, chunk-extension (if any) and CRLF \\assuming i just read the next line
while (chunk-size > 0) { \\if 0 responses ends
read chunk-data and CRLF \\assuming i read next line
append chunk-data to entity-body \\quite obvious
length := length + chunk-size \\to check validity
read chunk-size and CRLF \\next line
}
read entity-header \\chunk encoding includes footers which are like headers but at the end, read next line
while (entity-header not empty) { \\if empty, end
append entity-header to existing header fields \\duh...
read entity-header \\next line
}
Content-Length := length \\ummm... cant think of a comment for this one
Remove "chunked" from Transfer-Encoding \\not sure about this|
Re: How to copy data from a pointer into a char not another pointer July 25, 2009 02:21PM | Registered: 17 years ago Posts: 405 |
if(chunk)
{
char *html;
int length = 0;
char *line = tcp_readln (s, 0xff, gettime(), HTTP_TIMEOUT);
unsigned int *result = 0;
if(!xtoi(line, result))
{
while(result > 0)
{
length = length + *result;
char *line = tcp_readln (s, 0xff, gettime(), HTTP_TIMEOUT);
strcat ( html, line);
free(line);
line = tcp_readln (s, 0xff, gettime(), HTTP_TIMEOUT);
xtoi(line, result);
}
content_length = length;
}
}
|
Re: How to copy data from a pointer into a char not another pointer July 26, 2009 12:50PM | Registered: 17 years ago Posts: 405 |