#include "stdafx.h" #include "helper.h" CWnd* g_pMainWnd; CListBox* g_pInfoList; info_msg* info_msg::Construct(CONNID dwConnID, LPCTSTR lpszEvent, int iContentLength, LPCTSTR lpszContent, LPCTSTR lpszName) { return new info_msg(dwConnID, lpszEvent, iContentLength, lpszContent, lpszName); } void info_msg::Destruct(info_msg* pMsg) { delete pMsg; } info_msg::info_msg(CONNID dwConnID, LPCTSTR lpszEvent, int iContentLength, LPCTSTR lpszContent, LPCTSTR lpszName) : connID(dwConnID), evt(lpszEvent), contentLength(iContentLength), content(lpszContent), name(nullptr) { if(lpszName) { int len = lstrlen(lpszName); if(len > 0) { name = new TCHAR[len + 1]; memcpy((LPSTR)name, lpszName, (len + 1) * sizeof(TCHAR)); } } } info_msg::~info_msg() { if(name) delete[] name; if(contentLength > 0) delete[] content; } void SetMainWnd(CWnd* pWnd) { g_pMainWnd = pWnd; } void SetInfoList(CListBox* pInfoList) { g_pInfoList = pInfoList; } inline CString SafeString(LPCTSTR lpszName) { CString str(lpszName); if(lpszName) str.AppendChar(' '); return str; } inline CString SafeString2(LPCTSTR lpszName) { CString str(lpszName); if(lpszName) str.Append(_T(" #")); return str; } void LogServerStart(LPCTSTR lpszAddress, USHORT port, LPCTSTR lpszName) { CString msg; msg.Format(_T("$ %sServer Start OK --> (%s : %d)"), SafeString(lpszName), lpszAddress, port); LogMsg(msg); } void LogServerStartFail(DWORD code, LPCTSTR lpszDesc, LPCTSTR lpszName) { CString msg; msg.Format(_T("$ %sServer Start Fail --> %s (%d)"), SafeString(lpszName), lpszDesc, code); LogMsg(msg); } void LogServerStop(LPCTSTR lpszName) { CString msg; msg.Format(_T("$ %sServer Stop"), SafeString(lpszName)); LogMsg(msg); } void LogServerStopFail(DWORD code, LPCTSTR lpszDesc, LPCTSTR lpszName) { CString msg; msg.Format(_T("$ %sServer Stop Fail --> %s (%d)"), SafeString(lpszName), lpszDesc, code); LogMsg(msg); } void LogClientStart(LPCTSTR lpszAddress, USHORT port, LPCTSTR lpszName) { CString msg; msg.Format(_T("$ %sClient Start OK --> (%s : %d)"), SafeString(lpszName), lpszAddress, port); LogMsg(msg); } void LogClientStarting(LPCTSTR lpszAddress, USHORT port, LPCTSTR lpszName) { CString msg; msg.Format(_T("$ %sClient Starting ... --> (%s : %d)"), SafeString(lpszName), lpszAddress, port); LogMsg(msg); } void LogClientStartFail(DWORD code, LPCTSTR lpszDesc, LPCTSTR lpszName) { CString msg; msg.Format(_T("$ %sClient Start Fail --> %s (%d)"), SafeString(lpszName), lpszDesc, code); LogMsg(msg); } void LogClientStopping(CONNID dwConnID, LPCTSTR lpszName) { CString msg; msg.Format(_T("$ %sClient Stopping ... --> (%Iu)"), SafeString(lpszName), dwConnID); LogMsg(msg); } void LogClientStopFail(DWORD code, LPCTSTR lpszDesc, LPCTSTR lpszName) { CString msg; msg.Format(_T("$ %sClient Stop Fail --> %s (%d)"), SafeString(lpszName), lpszDesc, code); LogMsg(msg); } void LogClientSendFail(int iSequence, int iSocketIndex, DWORD code, LPCTSTR lpszDesc, LPCTSTR lpszName) { CString msg; msg.Format(_T("$ %sClient Send Fail [SOCK: %d, SEQ: %d] --> %s (%d)"), SafeString(lpszName), iSocketIndex, iSequence, lpszDesc, code); LogMsg(msg); } void LogSend(CONNID dwConnID, LPCTSTR lpszContent, LPCTSTR lpszName) { CString msg; msg.Format(_T("$ %s(%Iu) Send OK --> %s"), SafeString2(lpszName), dwConnID, lpszContent); LogMsg(msg); } void LogSendFail(CONNID dwConnID, DWORD code, LPCTSTR lpszDesc, LPCTSTR lpszName) { CString msg; msg.Format(_T("$ %s(%Iu) Send Fail --> %s (%d)"), SafeString2(lpszName), dwConnID, lpszDesc, code, lpszName); LogMsg(msg); } void LogDisconnect(CONNID dwConnID, LPCTSTR lpszName) { CString msg; msg.Format(_T("$ %s(%Iu) Disconnect OK"), SafeString2(lpszName), dwConnID); LogMsg(msg); } void LogDisconnectFail(CONNID dwConnID, LPCTSTR lpszName) { CString msg; msg.Format(_T("$ %s(%Iu) Disconnect Fail"), SafeString2(lpszName), dwConnID, lpszName); LogMsg(msg); } void LogRelease(CONNID dwConnID, LPCTSTR lpszName) { CString msg; msg.Format(_T("$ %s(%Iu) Release OK"), SafeString2(lpszName), dwConnID); LogMsg(msg); } void LogReleaseFail(CONNID dwConnID, LPCTSTR lpszName) { CString msg; msg.Format(_T("$ %s(%Iu) Release Fail"), SafeString2(lpszName), dwConnID); LogMsg(msg); } void LogDetect(CONNID dwConnID, LPCTSTR lpszName) { CString msg; msg.Format(_T("$ %s(%Iu) Detect Connection OK"), SafeString2(lpszName), dwConnID); LogMsg(msg); } void LogDetectFail(CONNID dwConnID, LPCTSTR lpszName) { CString msg; msg.Format(_T("$ %s(%Iu) Detect Connection Fail"), SafeString2(lpszName), dwConnID); LogMsg(msg); } void LogOnConnect(CONNID dwConnID, const CString& strAddress, USHORT usPort, LPCTSTR lpszName) { LPTSTR lpszContent = new TCHAR[100]; wsprintf(lpszContent, _T("local address: %s:%d"), strAddress, usPort); int content_len = lstrlen(lpszContent); info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_CONNECT, content_len, lpszContent, lpszName); LogInfoMsg(msg); } void LogOnConnect2(CONNID dwConnID, LPCTSTR lpszName) { CString msg; msg.Format(_T(" > [ %s%Iu, %s ]"), SafeString2(lpszName), dwConnID, EVT_ON_CONNECT); LogMsg(msg); } void LogOnHandShake2(CONNID dwConnID, LPCTSTR lpszName) { CString msg; msg.Format(_T(" > [ %s%Iu, %s ]"), SafeString2(lpszName), dwConnID, EVT_ON_HAND_SHAKE); LogMsg(msg); } void PostOnSend(CONNID dwConnID, const BYTE* pData, int iLength, LPCTSTR lpszName) { LPTSTR lpszContent = new TCHAR[20]; wsprintf(lpszContent, _T("(%d bytes)"), iLength); int content_len = lstrlen(lpszContent); info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_SEND, content_len, lpszContent, lpszName); PostInfoMsg(msg); } void PostOnReceive(CONNID dwConnID, const BYTE* pData, int iLength, LPCTSTR lpszName) { LPTSTR lpszContent = new TCHAR[20]; wsprintf(lpszContent, _T("(%d bytes)"), iLength); int content_len = lstrlen(lpszContent); info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_RECEIVE, content_len, lpszContent, lpszName); PostInfoMsg(msg); } void PostOnReceiveCast(CONNID dwConnID, LPCTSTR lpszAddress, USHORT usPort, const BYTE* pData, int iLength, LPCTSTR lpszName) { LPTSTR lpszContent = new TCHAR[100]; wsprintf(lpszContent, _T("<%s:%d> (%d bytes)"), lpszAddress, usPort, iLength); int content_len = lstrlen(lpszContent); info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_RECEIVE, content_len, lpszContent, lpszName); PostInfoMsg(msg); } void PostOnClose(CONNID dwConnID, LPCTSTR lpszName) { info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_CLOSE, 0, nullptr, lpszName); PostInfoMsg(msg); } void PostOnError(CONNID dwConnID, int enOperation, int iErrorCode, LPCTSTR lpszName) { LPTSTR lpszContent = new TCHAR[100]; wsprintf(lpszContent, _T("OP: %d, CODE: %d"), enOperation, iErrorCode); int content_len = lstrlen(lpszContent); info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_ERROR, content_len, lpszContent, lpszName); PostInfoMsg(msg); } void PostOnAccept(CONNID dwConnID, LPCTSTR lpszAddress, USHORT usPort, BOOL bPass, LPCTSTR lpszName) { LPTSTR lpszContent = new TCHAR[100]; wsprintf(lpszContent, _T("%s (%s:%d)"), bPass ? _T("PASS") : _T("REJECT"), lpszAddress, usPort); int content_len = lstrlen(lpszContent); info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_ACCEPT, content_len, lpszContent, lpszName); PostInfoMsg(msg); } void PostOnAccept2(CONNID dwConnID, LPCTSTR lpszName) { info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_ACCEPT, 0, nullptr, lpszName); PostInfoMsg(msg); } void PostOnHandShake(CONNID dwConnID, LPCTSTR lpszName) { info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_HAND_SHAKE, 0, nullptr, lpszName); PostInfoMsg(msg); } void PostOnPrepareListen(LPCTSTR lpszAddress, USHORT usPort, LPCTSTR lpszName) { LPTSTR lpszContent = new TCHAR[100]; wsprintf(lpszContent, _T("bind address: %s:%d"), lpszAddress, usPort); int content_len = lstrlen(lpszContent); info_msg* msg = info_msg::Construct(0, EVT_ON_PREPARE_LISTEN, content_len, lpszContent, lpszName); LogInfoMsg(msg); } void PostOnPrepareConnect(CONNID dwConnID, LPCTSTR lpszName) { info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_PREPARE_CONNECT, 0, nullptr, lpszName); LogInfoMsg(msg); } void PostOnConnect(CONNID dwConnID, LPCTSTR lpszAddress, USHORT usPort, LPCTSTR lpszName) { LPTSTR lpszContent = new TCHAR[100]; wsprintf(lpszContent, _T("local address: %s:%d"), lpszAddress, usPort); int content_len = lstrlen(lpszContent); info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_CONNECT, content_len, lpszContent, lpszName); PostInfoMsg(msg); } void PostOnConnect2(CONNID dwConnID, LPCTSTR lpszAddress, USHORT usPort, LPCTSTR lpszName) { LPTSTR lpszContent = new TCHAR[100]; wsprintf(lpszContent, _T("remote address: %s:%d"), lpszAddress, usPort); int content_len = lstrlen(lpszContent); info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_CONNECT, content_len, lpszContent, lpszName); PostInfoMsg(msg); } void PostOnConnect3(CONNID dwConnID, LPCTSTR lpszName) { info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_CONNECT, 0, nullptr, lpszName); PostInfoMsg(msg); } void PostOnShutdown(LPCTSTR lpszName) { info_msg* msg = info_msg::Construct(0, EVT_ON_SHUTDOWN, 0, nullptr, lpszName); PostInfoMsg(msg); } void PostServerStatics(const LONGLONG& llTotalSent, const LONGLONG& llTotalReceived, LPCTSTR lpszName) { LPTSTR lpszContent = new TCHAR[100]; wsprintf(lpszContent, _T(" *** Summary: send - %I64d, recv - %I64d"), llTotalSent, llTotalReceived); int content_len = lstrlen(lpszContent); info_msg* msg = info_msg::Construct(0, EVT_ON_END_TEST, content_len, lpszContent, lpszName); PostInfoMsg(msg); } void PostTimeConsuming(DWORD dwTickCount, LPCTSTR lpszName) { LPTSTR lpszContent = new TCHAR[100]; wsprintf(lpszContent, _T("Total Time Consuming: %u"), dwTickCount); int content_len = lstrlen(lpszContent); info_msg* msg = info_msg::Construct(0, EVT_ON_END_TEST, content_len, lpszContent, lpszName); PostInfoMsg(msg); } void PostOnMessageBegin(CONNID dwConnID, LPCTSTR lpszName) { info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_MESSAGE_BEGIN, 0, nullptr, lpszName); PostInfoMsg(msg); } void PostOnRequestLine(CONNID dwConnID, LPCSTR lpszMethod, USHORT usUrlFieldSet, LPCSTR lpszUrl, LPCTSTR lpszName) { USES_CONVERSION; int content_len = (int)(strlen(lpszMethod) + strlen(lpszUrl) + 20); LPTSTR lpszContent = new TCHAR[content_len]; wsprintf(lpszContent, _T("[%s/0x%02X] : %s"), A2T(lpszMethod), usUrlFieldSet, A2T(lpszUrl)); info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_REQUEST_LINE, content_len, lpszContent, lpszName); PostInfoMsg(msg); } void PostOnStatusLine(CONNID dwConnID, USHORT usStatusCode, LPCSTR lpszDesc, LPCTSTR lpszName) { USES_CONVERSION; int content_len = (int)(strlen(lpszDesc) + 10); LPTSTR lpszContent = new TCHAR[content_len]; wsprintf(lpszContent, _T("(%u) : %s"), usStatusCode, A2T(lpszDesc)); info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_STATUS_LINE, content_len, lpszContent, lpszName); PostInfoMsg(msg); } void PostOnHeader(CONNID dwConnID, LPCSTR lpszHeaderName, LPCSTR lpszHeaderValue, LPCTSTR lpszName) { USES_CONVERSION; int content_len = (int)(strlen(lpszHeaderName) + strlen(lpszHeaderValue) + 10); LPTSTR lpszContent = new TCHAR[content_len]; wsprintf(lpszContent, _T("%s: %s"), A2T(lpszHeaderName), A2T(lpszHeaderValue)); info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_HEADER, content_len, lpszContent, lpszName); PostInfoMsg(msg); } void PostOnHeadersComplete(CONNID dwConnID, LPCSTR lpszSummary, LPCTSTR lpszName) { USES_CONVERSION; static LPCTSTR PREFIX = _T("* * * * * * * * * Summary * * * * * * * * *\r\n"); static int PREFIX_LEN = lstrlen(PREFIX); LPCTSTR lpszSummaryT = A2CT(lpszSummary); int content_len = lstrlen(lpszSummaryT) + PREFIX_LEN + 1; LPTSTR lpszContent = new TCHAR[content_len]; memcpy(lpszContent, PREFIX, PREFIX_LEN * sizeof(TCHAR)); memcpy(lpszContent + PREFIX_LEN, lpszSummaryT, (content_len - PREFIX_LEN) * sizeof(TCHAR)); info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_HEADERS_COMPLETE, content_len, lpszContent, lpszName); PostInfoMsg(msg); } void PostOnBody(CONNID dwConnID, const BYTE* pData, int iLength, LPCTSTR lpszName) { LPTSTR lpszContent = new TCHAR[20]; wsprintf(lpszContent, _T("(%d bytes)"), iLength); int content_len = lstrlen(lpszContent); info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_BODY, content_len, lpszContent, lpszName); PostInfoMsg(msg); } void PostOnChunkHeader(CONNID dwConnID, int iLength, LPCTSTR lpszName) { LPTSTR lpszContent = new TCHAR[20]; wsprintf(lpszContent, _T("(%d bytes)"), iLength); int content_len = lstrlen(lpszContent); info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_CHUNK_HEADER, content_len, lpszContent, lpszName); PostInfoMsg(msg); } void PostOnChunkComplete(CONNID dwConnID, LPCTSTR lpszName) { info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_CHUNK_COMPLETE, 0, nullptr, lpszName); PostInfoMsg(msg); } void PostOnMessageComplete(CONNID dwConnID, LPCTSTR lpszName) { info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_MESSAGE_COMPLETE, 0, nullptr, lpszName); PostInfoMsg(msg); } void PostOnUpgrade(CONNID dwConnID, EnHttpUpgradeType enUpgradeType, LPCTSTR lpszName) { LPTSTR lpszContent = new TCHAR[20]; wsprintf(lpszContent, _T("(type: %d)"), enUpgradeType); int content_len = lstrlen(lpszContent); info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_UPGRADE, content_len, lpszContent, lpszName); PostInfoMsg(msg); } void PostOnParseError(CONNID dwConnID, int iErrorCode, LPCSTR lpszErrorDesc, LPCTSTR lpszName) { USES_CONVERSION; int content_len = (int)(strlen(lpszErrorDesc) + 10); LPTSTR lpszContent = new TCHAR[content_len]; wsprintf(lpszContent, _T("(%i) : %s"), iErrorCode, A2T(lpszErrorDesc)); info_msg* msg = info_msg::Construct(dwConnID, EVT_ON_PARSE_ERROR, content_len, lpszContent, lpszName); PostInfoMsg(msg); } void PostInfoMsg(info_msg* msg) { if( g_pMainWnd == nullptr || g_pMainWnd->GetSafeHwnd() == nullptr || !g_pMainWnd->PostMessage(USER_INFO_MSG, (WPARAM)msg )) info_msg::Destruct(msg); } void LogInfoMsg(info_msg* pInfoMsg) { CString msg; if(pInfoMsg->name) { if(pInfoMsg->connID > 0) { if(pInfoMsg->contentLength > 0) msg.Format(_T(" > [ %s #%Iu, %s ] -> %s"), pInfoMsg->name, pInfoMsg->connID, pInfoMsg->evt, pInfoMsg->content); else msg.Format(_T(" > [ %s #%Iu, %s ]"), pInfoMsg->name, pInfoMsg->connID, pInfoMsg->evt); } else { if(pInfoMsg->contentLength > 0) msg.Format(_T(" > [ %s - %s ] -> %s"), pInfoMsg->name, pInfoMsg->evt, pInfoMsg->content); else msg.Format(_T(" > [ %s - %s ]"), pInfoMsg->name, pInfoMsg->evt); } } else { if(pInfoMsg->connID > 0) { if(pInfoMsg->contentLength > 0) msg.Format(_T(" > [ %Iu, %s ] -> %s"), pInfoMsg->connID, pInfoMsg->evt, pInfoMsg->content); else msg.Format(_T(" > [ %Iu, %s ]"), pInfoMsg->connID, pInfoMsg->evt); } else { if(pInfoMsg->contentLength > 0) msg.Format(_T(" > [ %s ] -> %s"), pInfoMsg->evt, pInfoMsg->content); else msg.Format(_T(" > [ %s ]"), pInfoMsg->evt); } } LogMsg(msg); info_msg::Destruct(pInfoMsg); } void LogMsg(const CString& msg) { if(!g_pInfoList || !g_pInfoList->GetSafeHwnd()) return; g_pInfoList->SetRedraw(FALSE); int iCurIndex = g_pInfoList->GetCurSel(); BOOL bFirst = TRUE; int iStart = 0; int iAdd = 0; while(true) { CString item = msg.Tokenize(_T("\r\n"), iStart); if(iStart == -1) break; if(bFirst) bFirst = FALSE; else item.Insert(0, _T(" | ")); g_pInfoList->AddString(item); ++iAdd; } int iCount = g_pInfoList->GetCount(); BOOL bCurLast = (iCurIndex == LB_ERR || iCurIndex + iAdd == iCount - 1); int iDec = 0; while(g_pInfoList->GetCount() > MAX_LOG_RECORD_LENGTH) { g_pInfoList->DeleteString(0); ++iDec; } if(bCurLast) { iCurIndex = iCount - iDec - 1; g_pInfoList->SetCurSel(iCurIndex); } else if(iCurIndex < iDec) { iCurIndex = 0; g_pInfoList->SetCurSel(iCurIndex); } else iCurIndex = g_pInfoList->GetCurSel(); g_pInfoList->SetAnchorIndex(iCurIndex); g_pInfoList->SetRedraw(TRUE); } CBufferPtr* GeneratePkgBuffer(DWORD seq, LPCTSTR lpszName, short age, LPCTSTR lpszDesc) { USES_CONVERSION; LPCSTR name = T2A((LPTSTR)lpszName); LPCSTR desc = T2A((LPTSTR)lpszDesc); int desc_len = (int)strlen(desc) + 1; int body_len = offsetof(TPkgBody, desc) + desc_len; TPkgBody* pBody = (TPkgBody*)_alloca(body_len); memset(pBody, 0, body_len); pBody->age = age; strcpy(pBody->name, name); strcpy(pBody->desc, desc); TPkgHeader header; header.seq = seq; header.body_len = body_len; return GeneratePkgBuffer(header, *pBody); } CBufferPtr* GeneratePkgBuffer(const TPkgHeader& header, const TPkgBody& body) { int header_len = sizeof(TPkgHeader); int body_len = header.body_len; CBufferPtr* pBuffer = new CBufferPtr(header_len + body_len); memcpy(pBuffer->Ptr(), (BYTE*)&header, header_len); memcpy(pBuffer->Ptr() + header_len, (BYTE*)&body, body_len); return pBuffer; } #ifdef _SSL_SUPPORT #include "../../../Common/Src/FuncHelper.h" CString g_c_strCAPemCertFileOrPath; CString g_c_strPemCertFile; CString g_c_strPemKeyFile; CString g_s_strCAPemCertFileOrPath; CString g_s_strPemCertFile; CString g_s_strPemKeyFile; int g_c_iVerifyMode = SSL_VM_PEER; LPCTSTR g_c_lpszCAPemCertFileOrPath = _T("ssl-cert\\ca.crt"); LPCTSTR g_c_lpszPemCertFile = _T("ssl-cert\\client.cer"); LPCTSTR g_c_lpszPemKeyFile = _T("ssl-cert\\client.key"); LPCTSTR g_c_lpszKeyPasswod = _T("123456"); int g_s_iVerifyMode = SSL_VM_PEER | SSL_VM_FAIL_IF_NO_PEER_CERT; LPCTSTR g_s_lpszCAPemCertFileOrPath = _T("ssl-cert\\ca.crt"); LPCTSTR g_s_lpszPemCertFile = _T("ssl-cert\\server.cer"); LPCTSTR g_s_lpszPemKeyFile = _T("ssl-cert\\server.key"); LPCTSTR g_s_lpszKeyPasswod = _T("123456"); BOOL InitSSLParams(); BOOL g_SSLParams = InitSSLParams(); BOOL InitSSLParams() { ::SetCurrentPathToModulePath(); CString strPath; ::GetCurrentDirectory(MAX_PATH, strPath.GetBuffer(MAX_PATH)); strPath.ReleaseBuffer(); strPath += PATH_SEPARATOR_CHAR; if(g_c_lpszPemCertFile) { g_c_strPemCertFile = strPath + g_c_lpszPemCertFile; g_c_lpszPemCertFile = g_c_strPemCertFile; } if(g_c_lpszPemKeyFile) { g_c_strPemKeyFile = strPath + g_c_lpszPemKeyFile; g_c_lpszPemKeyFile = g_c_strPemKeyFile; } if(g_c_lpszCAPemCertFileOrPath) { g_c_strCAPemCertFileOrPath = strPath + g_c_lpszCAPemCertFileOrPath; g_c_lpszCAPemCertFileOrPath = g_c_strCAPemCertFileOrPath; } if(g_s_lpszPemCertFile) { g_s_strPemCertFile = strPath + g_s_lpszPemCertFile; g_s_lpszPemCertFile = g_s_strPemCertFile; } if(g_s_lpszPemKeyFile) { g_s_strPemKeyFile = strPath + g_s_lpszPemKeyFile; g_s_lpszPemKeyFile = g_s_strPemKeyFile; } if(g_s_lpszCAPemCertFileOrPath) { g_s_strCAPemCertFileOrPath = strPath + g_s_lpszCAPemCertFileOrPath; g_s_lpszCAPemCertFileOrPath = g_s_strCAPemCertFileOrPath; } return TRUE; } #endif