network.c, url.c: disable keep-alive and close http socket after downloading
With default Connection: keep-alive and without closing read socket after downloading stage2 propagator hangs until socket not closed on server side.
This commit is contained in:
parent
0d3ff4dabd
commit
111d828c45
@ -1034,7 +1034,9 @@ enum return_type http_prepare(void)
|
||||
|
||||
log_message("HTTP: size of download %d bytes", size);
|
||||
|
||||
if (load_ramdisk_fd(fd, size) != RETURN_OK)
|
||||
results = load_ramdisk_fd(fd, size);
|
||||
close(fd);
|
||||
if (results != RETURN_OK)
|
||||
return RETURN_ERROR;
|
||||
|
||||
method_name = strdup("http");
|
||||
|
4
url.c
4
url.c
@ -424,8 +424,8 @@ int http_download_file(char * hostname, char * remotename, int * size)
|
||||
return FTPERR_FAILED_CONNECT;
|
||||
}
|
||||
|
||||
buf = alloca(strlen(remotename) + strlen(hostname) + 20);
|
||||
sprintf(buf, "GET %s HTTP/1.1\r\nHost: %s\r\n\r\n", remotename, hostname);
|
||||
buf = alloca(strlen(remotename) + strlen(hostname) + 48);
|
||||
sprintf(buf, "GET %s HTTP/1.1\r\nHost: %s\r\nConnection: close\r\n\r\n", remotename, hostname);
|
||||
rc = write(sock, buf, strlen(buf));
|
||||
|
||||
/* This is fun; read the response a character at a time until we:
|
||||
|
Loading…
Reference in New Issue
Block a user