/***************************************************************************1* _ _ ____ _2* Project ___| | | | _ \| |3* / __| | | | |_) | |4* | (__| |_| | _ <| |___5* \___|\___/|_| \_\_____|6*7* Copyright (C) Daniel Stenberg, <[email protected]>, et al.8*9* This software is licensed as described in the file COPYING, which10* you should have received as part of this distribution. The terms11* are also available at https://curl.se/docs/copyright.html.12*13* You may opt to use, copy, modify, merge, publish, distribute and/or sell14* copies of the Software, and permit persons to whom the Software is15* furnished to do so, under the terms of the COPYING file.16*17* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY18* KIND, either express or implied.19*20* SPDX-License-Identifier: curl21*22***************************************************************************/23/*24* Test case converted from bug report #1318 by Petr Novak.25*26* Before the fix, this test program returned 52 (CURLE_GOT_NOTHING) instead27* of 42 (CURLE_ABORTED_BY_CALLBACK).28*/2930#include "test.h"3132#include "memdebug.h"3334static int progressKiller(void *arg,35double dltotal,36double dlnow,37double ultotal,38double ulnow)39{40(void)arg;41(void)dltotal;42(void)dlnow;43(void)ultotal;44(void)ulnow;45curl_mprintf("PROGRESSFUNCTION called\n");46return 1;47}4849CURLcode test(char *URL)50{51CURL *curl;52CURLcode res = CURLE_OK;5354global_init(CURL_GLOBAL_ALL);5556easy_init(curl);5758easy_setopt(curl, CURLOPT_URL, URL);59easy_setopt(curl, CURLOPT_TIMEOUT, (long)7);60easy_setopt(curl, CURLOPT_NOSIGNAL, (long)1);61easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progressKiller);62easy_setopt(curl, CURLOPT_PROGRESSDATA, NULL);63easy_setopt(curl, CURLOPT_NOPROGRESS, (long)0);6465res = curl_easy_perform(curl);6667test_cleanup:6869/* undocumented cleanup sequence - type UA */7071curl_easy_cleanup(curl);72curl_global_cleanup();7374return res;75}767778