From 50038a7d26628973c2bd8b47e4efe8e7039c8040 Mon Sep 17 00:00:00 2001 From: Pan7 Date: Sun, 26 Oct 2014 17:10:41 +0100 Subject: [PATCH] qcurl_multi_add_handle error check --- code/client/cl_curl.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/client/cl_curl.c b/code/client/cl_curl.c index 901ef999..9f186aed 100644 --- a/code/client/cl_curl.c +++ b/code/client/cl_curl.c @@ -211,6 +211,8 @@ static size_t CL_cURL_CallbackWrite(void *buffer, size_t size, size_t nmemb, void CL_cURL_BeginDownload( const char *localName, const char *remoteURL ) { + CURLMcode result; + clc.cURLUsed = qtrue; Com_Printf("URL: %s\n", remoteURL); Com_DPrintf("***** CL_cURL_BeginDownload *****\n" @@ -271,7 +273,11 @@ void CL_cURL_BeginDownload( const char *localName, const char *remoteURL ) "failed"); return; } - qcurl_multi_add_handle(clc.downloadCURLM, clc.downloadCURL); + result = qcurl_multi_add_handle(clc.downloadCURLM, clc.downloadCURL); + if(result != CURLM_OK) { + Com_Error(ERR_DROP,"CL_cURL_BeginDownload: qcurl_multi_add_handle() failed: %s", qcurl_multi_strerror(result)); + return; + } if(!(clc.sv_allowDownload & DLF_NO_DISCONNECT) && !clc.cURLDisconnected) {