From 23b152e71a5b9824612a6e513d7c8118a51240c8 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 9 May 2016 18:31:40 -0400 Subject: [PATCH] Disable connection persistence and enable a 5 second connect timeout --- libgamestream/http.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libgamestream/http.c b/libgamestream/http.c index aa8f8d2..4a8e8ac 100644 --- a/libgamestream/http.c +++ b/libgamestream/http.c @@ -76,6 +76,12 @@ int http_request(char* url, PHTTP_DATA data) { curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, _write_curl); curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L); curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, *sslctx_function); + curl_easy_setopt(curl, CURLOPT_SSL_SESSIONID_CACHE, 0L); + curl_easy_setopt(curl, CURLOPT_MAXCONNECTS, 0L); + curl_easy_setopt(curl, CURLOPT_FRESH_CONNECT, 1L); + curl_easy_setopt(curl, CURLOPT_FORBID_REUSE, 1L); + curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 5L); + curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L); curl_easy_setopt(curl, CURLOPT_WRITEDATA, data); curl_easy_setopt(curl, CURLOPT_URL, url);