Open aerospeace opened 1 year ago
Hi,
Thank you for reporting this. Can you share which version of curl you are using?
Hi,
Thanks for you response. I am using curl 7.87.0.
Exact details:
curl 7.87.0 (x86_64-pc-linux-gnu) libcurl/7.87.0 OpenSSL/3.0.7 zlib/1.2.13 brotli/1.0.9 zstd/1.5.2 libidn2/2.3.4 libpsl/0.21.2 (+libidn2/2.3.4) libssh2/1.10.0 nghttp2/1.51.0 Release-Date: 2022-12-21 Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd
@aerospeace you can try with this patch, my curl version is 7.88.1.
diff --git a/AVSCommon/Utils/include/AVSCommon/Utils/LibcurlUtils/CurlEasyHandleWrapper.h b/AVSCommon/Utils/include/AVSCommon/Utils/LibcurlUtils/CurlEasyHandleWrapper.h
index 69976e2..94b60a8 100644
--- a/AVSCommon/Utils/include/AVSCommon/Utils/LibcurlUtils/CurlEasyHandleWrapper.h
+++ b/AVSCommon/Utils/include/AVSCommon/Utils/LibcurlUtils/CurlEasyHandleWrapper.h
@@ -353,9 +353,9 @@ private:
/// A list of headers needed to be added to a POST action
curl_slist* m_postHeaders;
/// The associated multipart post
- curl_httppost* m_post;
+ curl_mime* m_post;
/// The last post used in curl_formadd
- curl_httppost* m_lastPost;
+ curl_mime* m_lastPost;
/// Name for this handle.
std::string m_id;
/// Synchronizes access to the @c m_interfaceName
diff --git a/AVSCommon/Utils/src/LibcurlUtils/CurlEasyHandleWrapper.cpp b/AVSCommon/Utils/src/LibcurlUtils/CurlEasyHandleWrapper.cpp
index b508f8e..cb2bca2 100644
--- a/AVSCommon/Utils/src/LibcurlUtils/CurlEasyHandleWrapper.cpp
+++ b/AVSCommon/Utils/src/LibcurlUtils/CurlEasyHandleWrapper.cpp
@@ -244,7 +244,7 @@ bool CurlEasyHandleWrapper::setTransferType(TransferType type) {
ret = setopt(CURLOPT_HTTPGET, 1L);
break;
case TransferType::kPOST:
- ret = setopt(CURLOPT_HTTPPOST, m_post);
+ ret = setopt(CURLOPT_MIMEPOST, m_post);
break;
case TransferType::kPUT:
ret = setopt(CURLOPT_UPLOAD, 1L);
@@ -299,7 +299,7 @@ void CurlEasyHandleWrapper::cleanupResources() {
}
if (m_post) {
- curl_formfree(m_post);
+ curl_mime_free(m_post);
m_post = nullptr;
m_lastPost = nullptr;
}
I had the same problem, tried your patch and it works.. it removes the deprecated calls...
IMPORTANT: Before you create an issue, please take a look at our Issue Reporting Guide.
Briefly summarize your issue:
When building the SDK Sample App, the build fails due to the fact that ‘CURLOPT_HTTPPOST’ is deprecated.
What is the expected behavior?
Compilation successful
What behavior are you observing?
Compilation fails with the following:
Provide the steps to reproduce the issue, if applicable:
Follow the exact documentation in https://developer.amazon.com/en-US/docs/alexa/avs-device-sdk/ubuntu.html
Tell us about your environment:
What version of the AVS Device SDK are you using?
3.0
Tell us what hardware you're using:
Tell us about your OS (Type & version):