/***************************************************************************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#include "test.h"2425CURLcode test(char *URL)26{27CURL *eh = NULL;28CURLcode res = CURLE_OK;29struct curl_httppost *lastptr = NULL;30struct curl_httppost *m_formpost = NULL;3132global_init(CURL_GLOBAL_ALL);3334easy_init(eh);3536easy_setopt(eh, CURLOPT_URL, URL);37curl_formadd(&m_formpost, &lastptr, CURLFORM_COPYNAME, "file",38CURLFORM_FILE, "missing-file", CURLFORM_END);39curl_easy_setopt(eh, CURLOPT_HTTPPOST, m_formpost);4041(void)curl_easy_perform(eh);42(void)curl_easy_perform(eh);4344test_cleanup:4546curl_formfree(m_formpost);47curl_easy_cleanup(eh);48curl_global_cleanup();4950return res;51}525354