summaryrefslogtreecommitdiff
path: root/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp')
-rw-r--r--plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp
index 5a2a4d8a34..6b604c33ba 100644
--- a/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp
+++ b/plugins/SendScreenshotPlus/src/CSendHost_ImageShack.cpp
@@ -76,12 +76,10 @@ void CSendHost_ImageShack::SendThread()
{
// send DATA and wait for m_nlreply
NLHR_PTR reply(Netlib_HttpTransaction(g_hNetlibUser, &m_nlhr));
- HTTPFormDestroy(&m_nlhr);
if (reply) {
- if (reply->resultCode >= 200 && reply->resultCode < 300 && reply->dataLength) {
- reply->pData[reply->dataLength - 1] = '\0'; // make sure its null terminated
+ if (reply->resultCode >= 200 && reply->resultCode < 300 && reply->body.GetLength()) {
const char* url = nullptr;
- url = GetHTMLContent(reply->pData, "<image_link>", "</image_link>");
+ url = GetHTMLContent(reply->body.GetBuffer(), "<image_link>", "</image_link>");
if (url && *url) {
m_URLthumb = m_URL = url;
@@ -95,19 +93,19 @@ void CSendHost_ImageShack::SendThread()
return;
}
- url = GetHTMLContent(reply->pData, "<error ", "</error>");
+ url = GetHTMLContent(reply->body.GetBuffer(), "<error ", "</error>");
wchar_t* err = nullptr;
if (url) err = mir_a2u(url);
if (!err || !*err) { // fallback to server response mess
mir_free(err);
- err = mir_a2u(reply->pData);
+ err = mir_a2u(reply->body);
}
Error(L"%s", err);
mir_free(err);
}
else Error(SS_ERR_RESPONSE, m_pszSendTyp, reply->resultCode);
}
- else Error(SS_ERR_NORESPONSE, m_pszSendTyp, m_nlhr.resultCode);
+ else Error(SS_ERR_NORESPONSE, m_pszSendTyp, 500);
Exit(ACKRESULT_FAILED);
}