diff options
author | George Hazan <george.hazan@gmail.com> | 2024-07-30 18:06:01 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-07-30 18:06:01 +0300 |
commit | 966a705e634e3c934f5ac14dce1524714d2b31f0 (patch) | |
tree | 7ba5b5be239b3ff2a4ce44c2fb14e16c004800b1 /plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp | |
parent | 5850e4aa99a509df796745e358bb59d9205a37c6 (diff) |
fixes #4563 (SendSS: Crash with Imgur, Image Shack & Upload Pie)
Diffstat (limited to 'plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp')
-rw-r--r-- | plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp index 981c18f399..ec4c9203f1 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp @@ -50,7 +50,8 @@ int CSendHost_ImageShack::Send() Exit(ACKRESULT_FAILED);
return !m_bAsync;
}
- memset(&m_nlhr, 0, sizeof(m_nlhr));
+
+ m_pRequest.reset(new MHttpRequest(REQUEST_POST));
char* tmp; tmp = mir_u2a(m_pszFile);
HTTPFormData frm[] = {
// { "Referer", HTTPFORM_HEADER("http://www.imageshack.us/upload_api.php") },
@@ -59,7 +60,7 @@ int CSendHost_ImageShack::Send() { "public", "no" },
{ "key", HTTPFORM_8BIT(DEVKEY_IMAGESHACK) },
};
- int error = HTTPFormCreate(&m_nlhr, "http://imageshack.us/upload_api.php", frm, sizeof(frm) / sizeof(HTTPFormData));
+ int error = HTTPFormCreate(m_pRequest.get(), "http://imageshack.us/upload_api.php", frm, sizeof(frm) / sizeof(HTTPFormData));
mir_free(tmp);
if (error)
return !m_bAsync;
@@ -75,7 +76,7 @@ int CSendHost_ImageShack::Send() void CSendHost_ImageShack::SendThread()
{
// send DATA and wait for m_nlreply
- NLHR_PTR reply(Netlib_HttpTransaction(g_hNetlibUser, &m_nlhr));
+ NLHR_PTR reply(Netlib_HttpTransaction(g_hNetlibUser, m_pRequest.get()));
if (reply) {
if (reply->resultCode >= 200 && reply->resultCode < 300 && reply->body.GetLength()) {
const char* url = nullptr;
|