From 100fa78952ea83d7ff3ffe1682ab6455fdf10854 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Mon, 23 Oct 2017 07:52:32 +0200 Subject: [PATCH] CLuaInstCurl: Fix CurlDownload() to send POST data - Set Lua api version to 1.77 --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_curl.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 6f932f261..7d33c9c18 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 76 +#define LUA_API_VERSION_MINOR 77 diff --git a/src/gui/lua/lua_curl.cpp b/src/gui/lua/lua_curl.cpp index b5163677e..1407d4eb2 100644 --- a/src/gui/lua/lua_curl.cpp +++ b/src/gui/lua/lua_curl.cpp @@ -271,8 +271,10 @@ Example: if (!userAgent.empty()) curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, userAgent.c_str()); - if (!postfields.empty()) + if (!postfields.empty()) { + curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDSIZE, static_cast(postfields.length())); curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDS, postfields.c_str()); + } if (ipv4 && ipv6) curl_easy_setopt(curl_handle, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_WHATEVER);