소스 검색

Add support for HTTP 1.0

master
JustAnotherArchivist 1 년 전
부모
커밋
af25c108ba
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. +2
    -2
      http-response-bodies.c

+ 2
- 2
http-response-bodies.c 파일 보기

@@ -63,7 +63,7 @@ checkstate:
}
// Handle optional URL + Length line
url = NULL;
if (memcmp(bufp, "HTTP/1.1 ", 9) != 0) {
if (memcmp(bufp, "HTTP/1.1 ", 9) != 0 && memcmp(bufp, "HTTP/1.0 ", 9) != 0) {
DEBUG_PRINTF("No HTTP header, looking for URL line\n");
m0 = memmem(bufp, n, "\n", 1);
if (!m0 || m0 == bufp) {
@@ -109,7 +109,7 @@ checkstate:
fprintf(stderr, "Error: too little data before HTTP headers\n");
return 1;
}
if (memcmp(bufp, "HTTP/1.1 ", 9) == 0) {
if (memcmp(bufp, "HTTP/1.1 ", 9) == 0 || memcmp(bufp, "HTTP/1.0 ", 9) == 0) {
// Got some headers; find transfer encoding, content length, and end of headers
eoh = memmem(bufp, n, "\r\n\r\n", 4);
if (!eoh) {


불러오는 중...
취소
저장