3 * Copyright (c) 2000-2012 Samsung Electronics Co., Ltd. All Rights Reserved.
5 * This file is part of msg-service.
7 * Contact: Jaeyun Jeong <jyjeong@samsung.com>
8 * Sangkoo Kim <sangkoo.kim@samsung.com>
9 * Seunghwan Lee <sh.cat.lee@samsung.com>
10 * SoonMin Jung <sm0415.jung@samsung.com>
11 * Jae-Young Lee <jy4710.lee@samsung.com>
12 * KeeBum Kim <keebum.kim@samsung.com>
14 * PROPRIETARY/CONFIDENTIAL
16 * This software is the confidential and proprietary information of
17 * SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
18 * disclose such Confidential Information and shall use it only in
19 * accordance with the terms of the license agreement you entered
20 * into with SAMSUNG ELECTRONICS.
22 * SAMSUNG make no representations or warranties about the suitability
23 * of the software, either express or implied, including but not limited
24 * to the implied warranties of merchantability, fitness for a particular
25 * purpose, or non-infringement. SAMSUNG shall not be liable for any
26 * damages suffered by licensee as a result of using, modifying or
27 * distributing this software or its derivatives.
31 #include "MmsPluginHttp.h"
32 #include "MmsPluginUserAgent.h"
35 #include "MmsPluginConnManWrapper.h"
39 void httpGetHostFromUrl(char *pUrl, char *pHost)
45 if (strstr(pUrl, "HTTP://") == NULL) {
46 tail = strstr(pUrl, "/");
50 tailLen = strlen(tail);
52 hostLen = strlen(pUrl) - tailLen;
53 memcpy(pHost, pUrl, hostLen);
54 pHost[hostLen] = '\0';
56 tail = strstr(&pUrl[7], "/");
60 tailLen = strlen(tail);
62 hostLen = strlen(pUrl) - tailLen - 7;
63 memcpy(pHost, &pUrl[7], hostLen);
64 pHost[hostLen] = '\0';
68 void HttpHeaderInfo(curl_slist **responseHeaders, char *szUrl, int ulContentLen)
70 char szBuffer[1025] = {0, };
71 char pcheader[HTTP_REQUEST_LEN] = {0, };
73 bool nResult = MsgMmsGetCustomHTTPHeader(MMS_HH_CONTENT_TYPE, szBuffer);
75 strcat(pcheader,"Content-Type: ");
76 strcat(pcheader, szBuffer);
77 MSG_DEBUG("%s", pcheader);
78 *responseHeaders = curl_slist_append(*responseHeaders, pcheader);
81 memset(szBuffer, 0, 1025);
82 memset(pcheader, 0, HTTP_REQUEST_LEN);
83 snprintf(szBuffer, 1024, "%d", ulContentLen);
85 strcat(pcheader, "Content-Length: ");
86 strcat(pcheader, szBuffer);
87 MSG_DEBUG("%s", pcheader);
88 *responseHeaders = curl_slist_append(*responseHeaders, pcheader);
91 memset(szBuffer, 0, 1025);
92 memset(pcheader, 0, HTTP_REQUEST_LEN);
93 nResult = MsgMmsGetCustomHTTPHeader(MMS_HH_HOST, szBuffer);
95 strcat(pcheader, "HOST: ");
96 strcat(pcheader, szBuffer);
97 MSG_DEBUG("%s", pcheader);
98 *responseHeaders = curl_slist_append(*responseHeaders, pcheader);
101 memset(szBuffer, 0, 1025);
102 memset(pcheader, 0, HTTP_REQUEST_LEN);
103 nResult = MsgMmsGetCustomHTTPHeader(MMS_HH_ACCEPT, szBuffer);
105 strcat(pcheader, "Accept: ");
106 strcat(pcheader, szBuffer);
107 MSG_DEBUG("%s", pcheader);
108 *responseHeaders = curl_slist_append(*responseHeaders, pcheader);
111 memset(szBuffer, 0, 1025);
112 memset(pcheader, 0, HTTP_REQUEST_LEN);
113 nResult = MsgMmsGetCustomHTTPHeader(MMS_HH_ACCEPT_CHARSET, szBuffer);
115 strcat(pcheader, "Accept-Charset: ");
116 strcat(pcheader, szBuffer);
117 MSG_DEBUG("%s", pcheader);
118 *responseHeaders = curl_slist_append(*responseHeaders, pcheader);
121 memset(szBuffer, 0, 1025);
122 memset(pcheader, 0, HTTP_REQUEST_LEN);
123 nResult = MsgMmsGetCustomHTTPHeader(MMS_HH_ACCEPT_LANGUAGE, szBuffer);
125 strcat(pcheader, "Accept-Language: ");
126 strcat(pcheader, szBuffer);
127 MSG_DEBUG("%s", pcheader);
128 *responseHeaders = curl_slist_append(*responseHeaders, pcheader);
131 memset(szBuffer, 0, 1025);
132 memset(pcheader, 0, HTTP_REQUEST_LEN);
133 nResult = MsgMmsGetCustomHTTPHeader(MMS_HH_ACCEPT_ENCODING, szBuffer);
135 strcat(pcheader, "Accept-Encoding: ");
136 strcat(pcheader, szBuffer);
137 MSG_DEBUG("%s", pcheader);
138 *responseHeaders = curl_slist_append(*responseHeaders, pcheader);
141 memset(szBuffer, 0, 1025);
142 memset(pcheader, 0, HTTP_REQUEST_LEN);
143 nResult = MsgMmsGetCustomHTTPHeader(MMS_HH_USER_AGENT, szBuffer);
145 strcat(pcheader, "User-Agent: ");
146 strcat(pcheader, szBuffer);
147 MSG_DEBUG("%s", pcheader);
148 *responseHeaders = curl_slist_append(*responseHeaders, pcheader);
151 memset(szBuffer, 0, 1025);
152 memset(pcheader, 0, HTTP_REQUEST_LEN);
153 nResult = MsgMmsGetCustomHTTPHeader(MMS_HH_WAP_PROFILE, szBuffer);
155 strcat(pcheader, "X-wap-profile: ");
156 strcat(pcheader, szBuffer);
157 MSG_DEBUG("%s", pcheader);
158 *responseHeaders = curl_slist_append(*responseHeaders, pcheader);
162 bool MsgMmsGetCustomHTTPHeader(MMS_HTTP_HEADER_FIELD_T httpHeaderItem, char *szHeaderBuffer)
167 if (szHeaderBuffer != NULL) {
168 switch (httpHeaderItem) {
169 case MMS_HH_CONTENT_TYPE:
170 snprintf((char *)szHeaderBuffer, 1024, "%s", MSG_MMS_HH_CONTENT_TYPE);
175 MsgMmsGetHost(szHeaderBuffer, 1024);
176 if (strlen(szHeaderBuffer) > 0)
183 snprintf((char *)szHeaderBuffer, 1024, "%s", MSG_MMS_HH_ACCEPT);
187 case MMS_HH_ACCEPT_CHARSET:
188 snprintf((char *)szHeaderBuffer, 1024, "%s", MSG_MMS_HH_CHARSET);
192 case MMS_HH_ACCEPT_LANGUAGE:
193 snprintf((char *)szHeaderBuffer, 1024, "%s", MSG_MMS_HH_LANGUAGE);
197 case MMS_HH_ACCEPT_ENCODING:
198 snprintf((char *)szHeaderBuffer, 1024, "%s", MSG_MMS_HH_ENCODING);
202 case MMS_HH_USER_AGENT:
204 char szUserAgent[1024 + 1] = {0,};
206 memset(szUserAgent, 0x00, (sizeof(char) * (1024 + 1) ));
207 snprintf(szUserAgent, 1024, "%s", MSG_MMS_HH_USER_AGENT);
209 snprintf((char *)szHeaderBuffer, 1024, "%s", szUserAgent);
214 case MMS_HH_WAP_PROFILE:
216 char szUAProfile[1024 + 1] = {0,};
218 memset(szUAProfile, 0x00, (sizeof(char)*(1024+1) ));
219 snprintf(szUAProfile, 1024, "%s", MSG_MMS_WAP_PROFILE);
221 snprintf((char *)szHeaderBuffer, 1024, "%s", szUAProfile);
227 MSG_DEBUG("invalid param");
235 void MsgMmsGetHost(char *szHost, int nBufferLen)
237 MmsPluginHttpAgent *pHttpAgent = MmsPluginHttpAgent::instance();
238 MMS_PLUGIN_HTTP_DATA_S *httpConfigData = pHttpAgent->getHttpConfigData();
240 const char *prefixString = "http://";
241 const char *delim = ":/\\=@";
243 int prefixLength = strlen(prefixString);
245 char *startPtr = &httpConfigData->mmscConfig.mmscUrl[0];
246 char *movePtr = NULL;
248 MSG_DEBUG("startPtr(%s)", startPtr);
250 if (strncasecmp(startPtr, prefixString, prefixLength) == 0) {
251 MSG_DEBUG("(%s) exist", prefixString);
252 startPtr += prefixLength;
254 movePtr = strpbrk(movePtr, delim);
255 MSG_DEBUG("strpbrk --> movePtr(%s)", movePtr);
256 if (movePtr == NULL) {
257 strncpy(szHost, startPtr, nBufferLen);
258 MSG_DEBUG("szHost(%s)", szHost);
260 int nCopyLen = movePtr - startPtr;
261 strncpy(szHost, startPtr, nCopyLen);
262 MSG_DEBUG("szHost(%s)", szHost);
265 MSG_DEBUG("(%s) not exist", prefixString);
267 movePtr = strpbrk(movePtr, delim);
268 MSG_DEBUG("strpbrk --> movePtr(%s)", movePtr);
269 if (movePtr == NULL) {
270 strncpy(szHost, startPtr, nBufferLen);
271 MSG_DEBUG("szHost(%s)", szHost);
273 int nCopyLen = movePtr - startPtr;
274 strncpy(szHost, startPtr, nCopyLen);
275 MSG_DEBUG("szHost(%s)", szHost);
281 MMS_NET_ERROR_T MmsHttpReadData(void *ptr, size_t size, size_t nmemb, void *userdata)
283 MMS_NET_ERROR_T httpRet = eMMS_UNKNOWN;
285 MmsPluginHttpAgent *pHttpAgent = MmsPluginHttpAgent::instance();
286 MMS_PLUGIN_HTTP_CONTEXT_S *pMmsPlgCd = pHttpAgent->getMmsPldCd();
287 long length_received = size * nmemb;
289 if (length_received) {
290 //Save the received buffer in a safe place.
291 if (pMmsPlgCd->final_content_buf == NULL) {
292 MSG_DEBUG("Body Lenghth Read = %d", length_received);
293 pMmsPlgCd->final_content_buf = (unsigned char *)malloc((length_received + 1) * sizeof(unsigned char));
294 memset(pMmsPlgCd->final_content_buf,0x0,((length_received + 1) * sizeof(unsigned char)));
295 MSG_DEBUG(" Global g_final_content_buf=%0x", pMmsPlgCd->final_content_buf);
297 //realloc pHttpEvent->bodyLen extra and memset
298 pMmsPlgCd->final_content_buf = (unsigned char *)realloc(pMmsPlgCd->final_content_buf,
299 (pMmsPlgCd->bufOffset + length_received + 1) * sizeof(unsigned char));
300 MSG_DEBUG("Body Lenghth Read = %d Content Length = %d", length_received, pMmsPlgCd->bufOffset);
301 memset((pMmsPlgCd->final_content_buf +pMmsPlgCd->bufOffset), 0x0,
302 ((length_received + 1) * sizeof(unsigned char)));
303 MSG_DEBUG(" Global g_final_content_buf=%0x", pMmsPlgCd->final_content_buf);
307 if (pMmsPlgCd->final_content_buf != NULL) {
308 memcpy( pMmsPlgCd->final_content_buf + pMmsPlgCd->bufOffset, ptr, length_received);
309 MSG_DEBUG("Current g_bufOffset =%d", pMmsPlgCd->bufOffset);
310 /* Content Received */
311 MSG_DEBUG("Total Content received PTR =%0X, Content Size =%d", pMmsPlgCd->final_content_buf,
312 pMmsPlgCd->bufOffset);
313 pMmsPlgCd->bufOffset = pMmsPlgCd->bufOffset + length_received;
314 httpRet = eMMS_UNKNOWN;
317 MSG_DEBUG("End of Data transfer");
318 MSG_DEBUG("MmsHttpReadData Buffer Size = %d", pMmsPlgCd->bufOffset);
319 MSG_DEBUG("MmsHttpReadData Buffer = %s", pMmsPlgCd->final_content_buf);
321 if (pMmsPlgCd->bufOffset == 0) {
322 /* This is applicable when - M-ReadRec.inf,M-Ack.ind, M-NotifyResp.ind posted */
323 MSG_DEBUG(" Content Size is Zero");
325 if (pMmsPlgCd->final_content_buf != NULL) {
326 free(pMmsPlgCd->final_content_buf );
327 pMmsPlgCd->final_content_buf = NULL;
330 httpRet = eMMS_HTTP_EVENT_SENT_ACK_COMPLETED;
331 } else if (pMmsPlgCd->final_content_buf != NULL && pMmsPlgCd->bufOffset != 0) {
333 MSG_DEBUG(" Send Received Data to UA");
334 httpRet = eMMS_HTTP_RECV_DATA; // eMMS_HTTP_RECV_DATA;
336 httpRet = eMMS_UNKNOWN; // check later
346 size_t MmsHttpPostTransactionCB(void *ptr, size_t size, size_t nmemb, void *userdata)
348 MSG_DEBUG(" ====== HTTP_EVENT_SENT ========");
349 long length_received = size * nmemb;
350 MmsHttpReadData(ptr, size, nmemb, userdata);
352 return length_received;
355 size_t MmsHttpGetTransactionCB(void *ptr, size_t size, size_t nmemb, void *userdata)
357 MSG_DEBUG(" ====== HTTP_EVENT_RECEIVED ========");
358 long length_received = size * nmemb;
359 MmsHttpReadData(ptr, size, nmemb, userdata);
361 return length_received;
364 int httpCmdInitSession(MMS_PLUGIN_HTTP_DATA_S *httpConfig)
366 MSG_DEBUG("HttpCmd Init Session");
368 char proxyAddr[MAX_IPV4_LENGTH + 1] = {0};
370 snprintf(proxyAddr, MAX_IPV4_LENGTH + 1, "%s:%d", httpConfig->mmscConfig.httpProxyIpAddr, httpConfig->mmscConfig.proxyPortNo);
371 MSG_DEBUG("profileId [%d], proxyAddr [%s]", httpConfig->currentProfileId, proxyAddr);
373 CURL *curl_session = curl_easy_init();
374 if (NULL == curl_session) {
375 MSG_DEBUG("curl_easy_init() failed");
376 return eMMS_HTTP_SESSION_OPEN_FAILED;
379 int curl_status = curl_easy_setopt(curl_session, CURLOPT_PROXY, proxyAddr);
380 if (curl_status != CURLM_OK) {
381 MSG_DEBUG("curl_easy_setopt(): CURLOPT_PROXY failed");
382 curl_easy_cleanup(curl_session);
383 return eMMS_HTTP_SESSION_OPEN_FAILED;
386 httpConfig->session = curl_session;
388 return eMMS_HTTP_SESSION_INIT;
392 int httpCmdPostTransaction(MMS_PLUGIN_HTTP_DATA_S *httpConfig)
396 MSG_DEBUG("HttpCmd Post Transaction");
397 MSG_DEBUG(" === HTTP Agent Thread : Signal ==> eMMS_HTTP_SIGNAL_POST_TRANSACTION");
399 char deviceName[1024] = {0,};
401 MmsPluginCmAgent::instance()->getDeviceName(deviceName);
403 MSG_DEBUG("deviceName: [%s]", deviceName);
404 int curl_status = curl_easy_setopt(httpConfig->session, CURLOPT_INTERFACE, deviceName);
406 if (curl_status != CURLM_OK) {
407 MSG_DEBUG("curl_easy_setopt(): CURLOPT_INTERFACE failed");
409 return eMMS_EXCEPTIONAL_ERROR;
412 MSG_PROFILE_BEGIN(libcurl);
414 CURLcode rc = curl_easy_perform(httpConfig->session);
416 MSG_PROFILE_END(libcurl);
418 MmsPluginHttpAgent* httpAgent = MmsPluginHttpAgent::instance();
419 MMS_PLUGIN_HTTP_DATA_S *httpConfigData = httpAgent->getHttpConfigData();
420 if (httpConfigData->sessionHeader) {
421 curl_slist_free_all((curl_slist *)httpConfigData->sessionHeader);
422 httpConfigData->sessionHeader = NULL;
425 if (CURLE_OK != rc) {
426 MSG_DEBUG("curl_easy_perform return error rc[%d]", rc);
428 return eMMS_HTTP_ERROR_NETWORK;
431 MSG_DEBUG("## End Transaction ##");
432 MSG_DEBUG("############ trID = %d ###########", trId);
434 srandom((unsigned int) time(NULL));
435 trId = random() % 1000000000 + 1;
437 httpConfig->transactionId = trId;
439 return eMMS_HTTP_SENT_SUCCESS;
442 int httpCmdGetTransaction(MMS_PLUGIN_HTTP_DATA_S *httpConfig)
446 MSG_DEBUG("HttpCmd Get Transaction");
447 MSG_DEBUG(" === HTTP Agent Thread : Signal ==> eMMS_HTTP_SIGNAL_GET_TRANSACTION");
449 char deviceName[1024] = {0,};
450 MmsPluginCmAgent::instance()->getDeviceName(deviceName);
451 MSG_DEBUG("deviceName: [%s]", deviceName);
453 int curl_status = curl_easy_setopt(httpConfig->session, CURLOPT_INTERFACE, deviceName);
454 if (curl_status != CURLM_OK) {
455 MSG_DEBUG("curl_easy_setopt(): CURLOPT_INTERFACE failed");
457 return eMMS_EXCEPTIONAL_ERROR;
460 CURLcode rc = curl_easy_perform(httpConfig->session);
462 MmsPluginHttpAgent* httpAgent = MmsPluginHttpAgent::instance();
463 MMS_PLUGIN_HTTP_DATA_S *httpConfigData = httpAgent->getHttpConfigData();
464 if (httpConfigData->sessionHeader) {
465 curl_slist_free_all((curl_slist *)httpConfigData->sessionHeader);
466 httpConfigData->sessionHeader = NULL;
469 if (CURLE_OK != rc) {
470 MSG_DEBUG("curl_easy_perform return error = %d", rc);
472 return eMMS_HTTP_ERROR_NETWORK;
475 MSG_DEBUG("## End Transaction ##");
476 MSG_DEBUG("############ trID = %d ###########", trId);
477 srandom((unsigned int) time(NULL));
478 trId = random() % 1000000000 + 1;
479 httpConfig->transactionId = trId;
481 return eMMS_HTTP_SENT_SUCCESS;
484 MmsPluginHttpAgent *MmsPluginHttpAgent::pInstance = NULL;
485 MmsPluginHttpAgent *MmsPluginHttpAgent::instance()
488 pInstance = new MmsPluginHttpAgent();
494 MmsPluginHttpAgent::MmsPluginHttpAgent()
496 MSG_DEBUG("MmsPluginHttpAgent()");
498 bzero(&httpConfigData, sizeof(httpConfigData));
499 bzero(&mmsPlgCd, sizeof(mmsPlgCd));
501 httpCmdHandler.clear();
505 httpCmdHandler[eHTTP_CMD_INIT_SESSION] = &httpCmdInitSession;
506 httpCmdHandler[eHTTP_CMD_POST_TRANSACTION] = &httpCmdPostTransaction;
507 httpCmdHandler[eHTTP_CMD_GET_TRANSACTION] = &httpCmdGetTransaction;
510 MmsPluginHttpAgent::~MmsPluginHttpAgent()
515 void MmsPluginHttpAgent::SetMMSProfile()
519 MMSC_CONFIG_DATA_S *mmscConfig = &(httpConfigData.mmscConfig);
521 MmsPluginCmAgent::instance()->getHomeURL(mmscConfig->mmscUrl);
522 if (strlen(mmscConfig->mmscUrl) < 1) {
523 strcpy(mmscConfig->mmscUrl, DEFAULT_MMSC_URL);
526 MmsPluginCmAgent::instance()->getProxyAddr(mmscConfig->httpProxyIpAddr);
527 mmscConfig->proxyPortNo = MmsPluginCmAgent::instance()->getProxyPort();
532 int MmsPluginHttpAgent::cmdRequest(MMS_HTTP_CMD_TYPE_T cmdType)
534 MSG_DEBUG("cmdRequest:%x", cmdType);
538 ret = httpCmdHandler[cmdType](&httpConfigData);
543 MMS_PLUGIN_HTTP_CONTEXT_S* MmsPluginHttpAgent::getMmsPldCd()
548 MMS_PLUGIN_HTTP_DATA_S *MmsPluginHttpAgent::getHttpConfigData()
550 return &httpConfigData;
553 void MmsPluginHttpAgent::setHttpWaitingFlag(bool val)
558 bool MmsPluginHttpAgent::getHttpWaitingFlag()
564 int MmsPluginHttpAgent::setSession(mmsTranQEntity *qEntity)
566 MSG_DEBUG("%s %d", qEntity->pPostData, qEntity->postDataLen);
568 if (qEntity->eHttpCmdType == eHTTP_CMD_POST_TRANSACTION) {
569 MSG_DEBUG("HttpCmd Post Transaction");
570 MSG_DEBUG(" === HTTP Agent Thread : Signal ==> eMMS_HTTP_SIGNAL_POST_TRANSACTION");
572 curl_slist *responseHeaders = NULL;
574 HttpHeaderInfo(&responseHeaders, NULL, qEntity->postDataLen);
575 responseHeaders = curl_slist_append(responseHeaders, "Pragma: ");
576 responseHeaders = curl_slist_append(responseHeaders, "Proxy-Connection: ");
577 responseHeaders = curl_slist_append(responseHeaders, "Expect: ");
578 MSG_DEBUG(" === MMSCURI = %s === ", httpConfigData.mmscConfig.mmscUrl);
580 httpConfigData.sessionHeader = (void *)responseHeaders;
582 MSG_DEBUG("## Start Transaction : Post ##");
583 curl_easy_setopt(httpConfigData.session, CURLOPT_VERBOSE, true);
584 curl_easy_setopt(httpConfigData.session, CURLOPT_POST, true);
585 curl_easy_setopt(httpConfigData.session, CURLOPT_URL, httpConfigData.mmscConfig.mmscUrl);
586 curl_easy_setopt(httpConfigData.session, CURLOPT_NOPROGRESS, true);
587 curl_easy_setopt(httpConfigData.session, CURLOPT_HTTPHEADER, responseHeaders);
588 curl_easy_setopt(httpConfigData.session, CURLOPT_POSTFIELDS, qEntity->pPostData);
589 curl_easy_setopt(httpConfigData.session, CURLOPT_POSTFIELDSIZE, qEntity->postDataLen);
590 curl_easy_setopt(httpConfigData.session, CURLOPT_WRITEFUNCTION, MmsHttpPostTransactionCB);
592 curl_easy_setopt(httpConfigData.session, CURLOPT_TCP_NODELAY, 1);
593 } else if (qEntity->eHttpCmdType == eHTTP_CMD_GET_TRANSACTION) {
594 MSG_DEBUG("MmsHttpInitTransactionGet %d pGetData (%s)", qEntity->getDataLen, qEntity->pGetData);
595 MSG_DEBUG("MmsHttpInitTransactionGet mmscURL (%s) ", httpConfigData.mmscConfig.mmscUrl);
597 char szUrl[MAX_MMSC_URL_LEN] = {0, };
599 memcpy(szUrl, qEntity->pGetData, qEntity->getDataLen);
601 MSG_DEBUG("MmsHttpInitTransactionGet szURL (%s)", szUrl);
603 curl_slist *responseHeaders = NULL;
605 HttpHeaderInfo(&responseHeaders, szUrl, 0);
606 responseHeaders = curl_slist_append(responseHeaders, "Pragma: ");
607 responseHeaders = curl_slist_append(responseHeaders, "Proxy-Connection: ");
609 httpConfigData.sessionHeader = (void *)responseHeaders;
611 MSG_DEBUG("## Start Transaction : Get ##");
612 curl_easy_setopt(httpConfigData.session, CURLOPT_VERBOSE, true);
613 curl_easy_setopt(httpConfigData.session, CURLOPT_URL, szUrl);
614 curl_easy_setopt(httpConfigData.session, CURLOPT_NOPROGRESS, true);
615 curl_easy_setopt(httpConfigData.session, CURLOPT_HTTPHEADER, responseHeaders);
616 curl_easy_setopt(httpConfigData.session, CURLOPT_WRITEFUNCTION, MmsHttpGetTransactionCB);
618 MSG_DEBUG("Unknown eHttpCmdType [%d]", qEntity->eHttpCmdType);
626 void MmsPluginHttpAgent::clearSession()
630 if (httpConfigData.sessionHeader) {
631 curl_slist_free_all((curl_slist *)httpConfigData.sessionHeader);
632 httpConfigData.sessionHeader = NULL;
635 if (httpConfigData.session == NULL) {
636 MSG_DEBUG("[Error]httpConfigData.session is NULL");
640 curl_easy_cleanup(httpConfigData.session);
642 httpConfigData.session = NULL;