/***************************************************************************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***************************************************************************/2324#include "test.h"2526#include "memdebug.h"2728CURLcode test(char *URL)29{30CURL *curl = NULL;31CURLcode res = CURLE_FAILED_INIT;32char bURL[512];33curl_msnprintf(bURL, sizeof(bURL),34"%s HTTP/1.1\r\nGET http://1529.com/1529", URL);3536if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {37curl_mfprintf(stderr, "curl_global_init() failed\n");38return TEST_ERR_MAJOR_BAD;39}4041curl = curl_easy_init();42if(!curl) {43curl_mfprintf(stderr, "curl_easy_init() failed\n");44curl_global_cleanup();45return TEST_ERR_MAJOR_BAD;46}4748test_setopt(curl, CURLOPT_URL, bURL);49test_setopt(curl, CURLOPT_PROXY, libtest_arg2);50test_setopt(curl, CURLOPT_VERBOSE, 1L);51test_setopt(curl, CURLOPT_PROXYTYPE, (long)CURLPROXY_HTTP);52test_setopt(curl, CURLOPT_HEADER, 1L);5354res = curl_easy_perform(curl);5556test_cleanup:5758curl_easy_cleanup(curl);59curl_global_cleanup();6061return res;62}636465