From 416a6242fb6d9e6676da2ff28d6b33478f84d3fe Mon Sep 17 00:00:00 2001 From: divverent Date: Sat, 15 Oct 2011 21:07:33 +0000 Subject: [PATCH] curl: change how failure/success is decided to prevent "black screen" problems if an unrelated download 404s git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11421 d7cf8633-e32d-0410-b094-e92efae38249 --- libcurl.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/libcurl.c b/libcurl.c index 1cdd18b5..7f176059 100644 --- a/libcurl.c +++ b/libcurl.c @@ -308,20 +308,22 @@ static void Curl_CheckCommandWhenDone(void) { if(!curl_dll) return; - if(numdownloads_added && (numdownloads_success == numdownloads_added) && *command_when_done) + if(numdownloads_added && ((numdownloads_success + numdownloads_fail) == numdownloads_added)) { - Con_DPrintf("cURL downloads occurred, executing %s\n", command_when_done); - Cbuf_AddText("\n"); - Cbuf_AddText(command_when_done); - Cbuf_AddText("\n"); - Curl_Clear_forthismap(); - } - else if(numdownloads_added && numdownloads_fail && *command_when_error) - { - Con_DPrintf("cURL downloads FAILED, executing %s\n", command_when_error); - Cbuf_AddText("\n"); - Cbuf_AddText(command_when_error); - Cbuf_AddText("\n"); + if(numdownloads_fail == 0) + { + Con_DPrintf("cURL downloads occurred, executing %s\n", command_when_done); + Cbuf_AddText("\n"); + Cbuf_AddText(command_when_done); + Cbuf_AddText("\n"); + } + else + { + Con_DPrintf("cURL downloads FAILED, executing %s\n", command_when_error); + Cbuf_AddText("\n"); + Cbuf_AddText(command_when_error); + Cbuf_AddText("\n"); + } Curl_Clear_forthismap(); } } -- 2.39.2