summaryrefslogtreecommitdiff
path: root/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-07-30 18:06:01 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-07-30 18:06:01 +0300
commit966a705e634e3c934f5ac14dce1524714d2b31f0 (patch)
tree7ba5b5be239b3ff2a4ce44c2fb14e16c004800b1 /plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp
parent5850e4aa99a509df796745e358bb59d9205a37c6 (diff)
fixes #4563 (SendSS: Crash with Imgur, Image Shack & Upload Pie)
Diffstat (limited to 'plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp')
-rw-r--r--plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp b/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp
index a19d6ebc06..bd44dfd008 100644
--- a/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp
+++ b/plugins/SendScreenshotPlus/src/CSendHost_uploadpie.cpp
@@ -38,7 +38,8 @@ int CSendHost_UploadPie::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[] = {
{ "MAX_FILE_SIZE", HTTPFORM_INT(3145728) },
@@ -47,7 +48,7 @@ int CSendHost_UploadPie::Send()
{ "expire", HTTPFORM_INT(m_expire) },
};
- int error = HTTPFormCreate(&m_nlhr, kHostURL, frm, _countof(frm));
+ int error = HTTPFormCreate(m_pRequest.get(), kHostURL, frm, _countof(frm));
mir_free(tmp);
if (error)
return !m_bAsync;
@@ -65,7 +66,7 @@ void CSendHost_UploadPie::SendThread(void* obj)
{
CSendHost_UploadPie* self = (CSendHost_UploadPie*)obj;
// send DATA and wait for m_nlreply
- NLHR_PTR reply(Netlib_HttpTransaction(g_hNetlibUser, &self->m_nlhr));
+ NLHR_PTR reply(Netlib_HttpTransaction(g_hNetlibUser, self->m_pRequest.get()));
if (reply) {
if (reply->resultCode >= 200 && reply->resultCode < 300 && reply->body.GetLength()) {
char* url = reply->body.GetBuffer();