From 2ebab53fc564fac6fbe3b8ffadca7c6ef4085529 Mon Sep 17 00:00:00 2001 From: pancake Date: Tue, 3 Mar 2015 00:45:13 +0100 Subject: [PATCH] Add 5 seconds read timeout to RSocket.http_get() --- libr/socket/http.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libr/socket/http.c b/libr/socket/http.c index ca76452c0d..06459bc4fa 100644 --- a/libr/socket/http.c +++ b/libr/socket/http.c @@ -8,6 +8,7 @@ static char *r_socket_http_answer (RSocket *s, int *code, int *rlen) { int ret, olen, len = 0, bufsz = 32768, delta = 0; char *dn, *res, *buf = malloc (bufsz); // XXX: use r_buffer here + r_socket_block_time (s, 1, 5); res = NULL; olen = r_socket_read_block (s, (unsigned char*) buf, bufsz); if (olen < 1) goto fail;