瀏覽代碼

Fix extra LF between chunks

master
JustAnotherArchivist 9 月之前
父節點
當前提交
8d48785caf
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. +4
    -1
      http-response-bodies.c

+ 4
- 1
http-response-bodies.c 查看文件

@@ -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;


Loading…
取消
儲存