From 632700c7828d2b9667c8dc8bc3403f910b51e158 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 13 May 2025 13:16:41 +0300 Subject: fixes #5017 (SendSS: UploadPie not working) + some code formatting --- plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp') diff --git a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp index 02edf18f38..d98a07e194 100644 --- a/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp +++ b/plugins/SendScreenshotPlus/src/CSendHost_imgur.cpp @@ -35,18 +35,18 @@ int CSendHost_Imgur::Send() Exit(ACKRESULT_FAILED); return !m_bAsync; } - + m_pRequest.reset(new MHttpRequest(REQUEST_POST)); - char* tmp; tmp = mir_u2a(m_pszFile); + T2Utf tmp(m_pszFile); HTTPFormData frm[] = { { "Authorization", HTTPFORM_HEADER("Client-ID 2a7303d78abe041") }, { "image", HTTPFORM_FILE(tmp) }, }; int error = HTTPFormCreate(m_pRequest.get(), "https://api.imgur.com/3/image", frm, _countof(frm)); - mir_free(tmp); if (error) return !m_bAsync; + // start upload thread if (m_bAsync) { mir_forkthread(&CSendHost_Imgur::SendThread, this); @@ -56,9 +56,9 @@ int CSendHost_Imgur::Send() return 1; } -void CSendHost_Imgur::SendThread(void* obj) +void CSendHost_Imgur::SendThread(void *obj) { - CSendHost_Imgur *self = (CSendHost_Imgur*)obj; + CSendHost_Imgur *self = (CSendHost_Imgur *)obj; // send DATA and wait for m_nlreply NLHR_PTR reply(Netlib_HttpTransaction(g_hNetlibUser, self->m_pRequest.get())); if (reply) { -- cgit v1.2.3