|
|
@@ -296,7 +296,9 @@ checkstate: |
|
|
|
DEBUG_PRINTF("Full body\n"); |
|
|
|
DEBUG_PRINTF("Copying %zu bytes to stdout\n", length - bytes_read); |
|
|
|
fwrite(bufp, 1, length - bytes_read, stdout); |
|
|
|
fprintf(stdout, "\n"); |
|
|
|
if (state == STATE_BODY) { |
|
|
|
fprintf(stdout, "\n"); |
|
|
|
} |
|
|
|
if (state == STATE_CHUNK_CONTENTS && *(bufp + length - bytes_read) == '\r') { |
|
|
|
// Stupid hack to enforce the CRLF |
|
|
|
++length; |
|
|
@@ -363,6 +365,7 @@ checkstate: |
|
|
|
fprintf(stderr, "Error: end of HTTP body not found\n"); |
|
|
|
return 1; |
|
|
|
} |
|
|
|
fprintf(stdout, "\n"); |
|
|
|
n -= 3; |
|
|
|
bufp += 3; |
|
|
|
state = STATE_HEADERS; |
|
|
|