HTTPS를 통해 게시 할 때 "curle_out_of_memory"오류
문제
Libcurl을 사용하여 SOAP 요청을 보안 웹 서비스에 게시하는 응용 프로그램을 작성하려고합니다. 이 Windows 응용 프로그램은 Libcurl 버전 7.19.0에 대해 구축되어 OpenSSL-0.9.8i에 대해 구축됩니다. 관련 컬 관련 코드는 다음과 같습니다.
FILE *input_file = fopen(current->post_file_name.c_str(), "rb"); FILE *output_file = fopen(current->results_file_name.c_str(), "wb"); if(input_file && output_file) { struct curl_slist *header_opts = 0; CURLcode rcd; header_opts = curl_slist_append(header_opts, "Content-Type: application/soap+xml; charset=utf8"); curl_easy_reset(curl_handle); curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1); curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, output_file); curl_easy_setopt(curl_handle, CURLOPT_READDATA, input_file); curl_easy_setopt(curl_handle, CURLOPT_URL, fs_service_url); curl_easy_setopt(curl_handle, CURLOPT_POST, 1); curl_easy_setopt(curl_handle, CURLOPT_HTTPHEADER, header_opts); rcd = curl_easy_perform(curl_handle); if(rcd != 0) { current->curl_result = rcd; current->curl_error = curl_easy_strerror(rcd); } curl_slist_free_all(header_opts); }
URL을 실행하려고 할 때 Curl은 Curle_out_of_memory 오류를 반환하여 SSL 컨텍스트를 할당하지 않는 것과 관련된 것으로 보입니다. 전에이 문제를 겪은 다른 사람이 있습니까?
해결책 2
추가 조사 후,이 오류는 ssl_library_init ()를 호출하여 OpenSSL 라이브러리를 초기화하지 못한 것으로 나타났습니다.
다른 팁
나는 같은 문제가 있었는데, OpenSSL Export를 호출하는 대신 직접 직접 전화를 걸지 않고 플래그 curl_global_ssl을 추가하여 고칠 수 있다는 점을 추가 할 것이라고 생각했습니다. curl_global_init
제휴하지 않습니다 StackOverflow