Skip to content

Commit

Permalink
Compiler warnings removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomenz committed Oct 29, 2024
1 parent 1f1e7f4 commit 9414898
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
16 changes: 8 additions & 8 deletions HttpFetch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ using namespace std::placeholders;

vector<string> vecProtokolls = { {"h2"}, {"http/1.1"} };

HttpFetch::HttpFetch(function<void(HttpFetch*, void*, uint32_t)> fnNotify, void* vpUserData) : m_pcClientCon(nullptr), m_sPort(80), m_UseSSL(false), m_uiStatus(0), m_bIsHttp2(false), m_bOutpHeader(false), m_bEndOfHeader(false), m_nContentLength(SIZE_MAX), m_nContentReceived(0), m_nChuncked(-1), m_nNextChunk(0), m_nChunkFooter(0), m_fnNotify(fnNotify)
HttpFetch::HttpFetch(function<void(HttpFetch*, void*, uint32_t)> fnNotify, void* /*vpUserData*/) : m_pcClientCon(nullptr), m_sPort(80), m_UseSSL(false), m_uiStatus(0), m_bIsHttp2(false), m_bOutpHeader(false), m_bEndOfHeader(false), m_nContentLength(SIZE_MAX), m_nContentReceived(0), m_nChuncked(-1), m_nNextChunk(0), m_nChunkFooter(0), m_fnNotify(fnNotify)
{
}

Expand Down Expand Up @@ -197,7 +197,7 @@ nSend += nDataLen;
this_thread::sleep_for(chrono::milliseconds(10));
m_mxVecData.lock();
}
if (m_vecData.size() > 0)
//if (m_vecData.size() > 0)
{
data = move(m_vecData.front());
m_vecData.pop_front();
Expand Down Expand Up @@ -265,7 +265,7 @@ nSend += nDataLen;
this_thread::sleep_for(chrono::milliseconds(10));
m_mxVecData.lock();
}
if (m_vecData.size() > 0)
//if (m_vecData.size() > 0)
{
data = move(m_vecData.front());
m_vecData.pop_front();
Expand Down Expand Up @@ -368,7 +368,7 @@ void HttpFetch::DatenEmpfangen(TcpSocket* const pTcpSocket)

//if ((m_nContentLength == SIZE_MAX || m_nContentLength == 0) && m_nChuncked != 0) // Server send a content-length from 0 to signal end of header we are done, and we do not have a chunked transfer encoding!
//{
m_umStreamCache.insert(make_pair(0, STREAMITEM({ 0, deque<DATAITEM>(), move(m_umRespHeader), 0, 0, INITWINDOWSIZE(m_tuStreamSettings) })));
m_umStreamCache.insert(make_pair(0, STREAMITEM({ 0, deque<DATAITEM>(), move(m_umRespHeader), 0, 0, INITWINDOWSIZE(m_tuStreamSettings), {}, {} })));
EndOfStreamAction(m_soMetaDa, 0, m_umStreamCache, m_tuStreamSettings, m_mtxStreams, m_mResWndSizes, atTmp, m_mxVecData, m_vecData, dqAuth);
// return;
//}
Expand Down Expand Up @@ -483,7 +483,7 @@ void HttpFetch::DatenEmpfangen(TcpSocket* const pTcpSocket)
m_nNextChunk -= nAnzahlDatenBytes;

if (nRead == 0 && m_nNextChunk == 0) // we expect the \r\n after the chunk, the next Data we receive should be a \r\n
;
{}
if (nRead >= 2 && string(spBuffer.get() + nWriteOffset).substr(0, 2) == "\r\n")
nRead -= 2, nWriteOffset += 2, m_nChunkFooter = 0;

Expand Down Expand Up @@ -518,7 +518,7 @@ void HttpFetch::SocketError(BaseSocket* const pBaseSocket)
pBaseSocket->Close();
}

void HttpFetch::SocketClosing(BaseSocket* const pBaseSocket)
void HttpFetch::SocketClosing(BaseSocket* const /*pBaseSocket*/)
{
OutputDebugString(L"Http2Fetch::SocketClosing\r\n");

Expand All @@ -528,13 +528,13 @@ void HttpFetch::SocketClosing(BaseSocket* const pBaseSocket)
m_Timer.get()->Stop();
}

void HttpFetch::OnTimeout(const Timer<TcpSocket>* const pTimer, TcpSocket* /*pUser*/)
void HttpFetch::OnTimeout(const Timer<TcpSocket>* const /*pTimer*/, TcpSocket* /*pUser*/)
{
OutputDebugString(L"Http2Fetch::OnTimeout\r\n");
m_pcClientCon->Close();
}

void HttpFetch::EndOfStreamAction(const MetaSocketData soMetaDa, const uint32_t streamId, STREAMLIST& StreamList, STREAMSETTINGS& tuStreamSettings, mutex& pmtxStream, RESERVEDWINDOWSIZE& maResWndSizes, atomic<bool>& patStop, mutex& pmtxReqdata, deque<unique_ptr<char[]>>& vecData, deque<AUTHITEM>& lstAuthInfo)
void HttpFetch::EndOfStreamAction(const MetaSocketData& soMetaDa, const uint32_t streamId, STREAMLIST& StreamList, STREAMSETTINGS& /*tuStreamSettings*/, mutex& /*pmtxStream*/, RESERVEDWINDOWSIZE& /*maResWndSizes*/, atomic<bool>& /*patStop*/, mutex& pmtxReqdata, deque<unique_ptr<char[]>>& vecData, deque<AUTHITEM>& /*lstAuthInfo*/)
{
m_umRespHeader = move(GETHEADERLIST(StreamList.find(streamId)));

Expand Down
2 changes: 1 addition & 1 deletion HttpFetch.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class HttpFetch : public Http2Protocol
// shared_ptr<TempFile> m_pTmpFileRec;
// shared_ptr<TempFile> m_pTmpFileSend;
unique_ptr<Timer<TcpSocket>> m_Timer;
MetaSocketData m_soMetaDa;
MetaSocketData m_soMetaDa{};
string m_strBuffer;
HeadList m_umRespHeader;
HeadList m_umAddHeader;
Expand Down
2 changes: 1 addition & 1 deletion HttpServ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1718,7 +1718,7 @@ void CHttpServ::DoAction(const MetaSocketData soMetaDa, const uint8_t httpVers,
for (auto& itHeader : lstHeaderFields)
{
if ((bAuthHandlerInScript == false && itHeader.first == "authorization")
|| (nSollLen <= 0 && itHeader.first == "content-length"))
|| (nSollLen == 0 && itHeader.first == "content-length"))
continue;

auto itArray = find_if(begin(caHeaders), end(caHeaders), [&](auto& prItem) noexcept { return prItem.first == itHeader.first ? true : false; });
Expand Down
12 changes: 3 additions & 9 deletions SpawnProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,13 @@ static const std::vector<std::string> vEnvFilter{"USER=", "HOME="};

mutex SpawnProcess::s_mtxIOstreams;

SpawnProcess::SpawnProcess()
SpawnProcess::SpawnProcess() : m_fdStdOutPipe{-1,-1}, m_fdStdInPipe{-1,-1}, m_fdStdErrPipe{-1,-1}
{
m_fdStdOutPipe[0] = -1;
m_fdStdOutPipe[1] = -1;
m_fdStdInPipe[0] = -1;
m_fdStdInPipe[1] = -1;
m_fdStdErrPipe[0] = -1;
m_fdStdErrPipe[1] = -1;
#if defined(_WIN32) || defined(_WIN64)
m_hProcess = INVALID_HANDLE_VALUE;
m_hProcess{INVALID_HANDLE_VALUE};
#endif

char** aszEnv = _environ;
char** aszEnv {_environ};
while (*aszEnv)
{
if (std::find_if(vEnvFilter.begin(), vEnvFilter.end(), [&](auto& strFilter) { return std::string(*aszEnv).find(strFilter) == 0 ? true : false; }) != vEnvFilter.end())
Expand Down

0 comments on commit 9414898

Please sign in to comment.