Skip to content

Commit 7ac37de

Browse files
author
Dr.Abc
committed
update httpclient
1 parent 33d52bf commit 7ac37de

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Source/Utility/httpclient.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ CHttpClientItem::CHttpClientItem(httpContext_s* ctx) : IUtilHTTPCallbacks(){
112112
m_pRequest = g_pUtilHTTPClient->CreateSyncRequest(m_hContext.url.c_str(), m_hContext.method, this);
113113
if (m_pCookieJar)
114114
m_pRequest->SetField("Set-Cookie", m_pCookieJar->Get().c_str());
115+
m_pRequest->SetAutoDestroyOnFinish(true);
115116
}
116117
CHttpClientItem* CHttpClientItem::Start(){
117118
if (!m_pRequest)
@@ -130,8 +131,8 @@ IUtilHTTPResponse* CHttpClientItem::StartSync(){
130131
if (m_pCookieJar) {
131132
char cookiebuf[MAX_COOKIE_LENGTH];
132133
memset(cookiebuf, 0, MAX_COOKIE_LENGTH);
133-
reb->GetHeader("Set-Cookie", cookiebuf, MAX_COOKIE_LENGTH);
134-
m_pCookieJar->Set(cookiebuf);
134+
if(reb->GetHeader("Set-Cookie", cookiebuf, MAX_COOKIE_LENGTH))
135+
m_pCookieJar->Set(cookiebuf);
135136
}
136137
return reb;
137138
}

0 commit comments

Comments
 (0)