Skip to content

Commit

Permalink
sync upstream lib/noson
Browse files Browse the repository at this point in the history
janbar-noson-d4c2ec9
  • Loading branch information
janbar committed Jul 22, 2017
1 parent 241e4b0 commit 3283f73
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/lib/noson/noson/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ endif ()

###############################################################################
# set lib version here
set (NOSON_LIB_VERSION "1.5.0")
set (NOSON_LIB_VERSION "1.5.1")
set (NOSON_LIB_SOVERSION "1")

###############################################################################
Expand Down
8 changes: 6 additions & 2 deletions backend/lib/noson/noson/src/private/wsresponse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ size_t WSResponse::ReadChunk(void *buf, size_t buflen)
if (m_contentChunked)
{
// no more pending byte in chunk buffer
if (m_chunkPtr == NULL || m_chunkPtr >= m_chunkEOR)
if (m_chunkPtr >= m_chunkEnd)
{
// process next chunk if all bytes have been read from the chunk buffer
// process next chunk
SAFE_DELETE_ARRAY(m_chunkBuffer);
m_chunkBuffer = m_chunkPtr = m_chunkEOR = m_chunkEnd = NULL;
std::string strread;
Expand All @@ -310,6 +310,10 @@ size_t WSResponse::ReadChunk(void *buf, size_t buflen)
}
else
return 0; // that's the end of chunks
}
// fill chunk buffer
if (m_chunkPtr >= m_chunkEOR)
{
// ask for new data to fill in the chunk buffer
// fill at last read position and until to the end
m_chunkEOR += m_socket->ReceiveData(m_chunkEOR, m_chunkEnd - m_chunkEOR);
Expand Down
2 changes: 1 addition & 1 deletion backend/lib/noson/noson/src/private/wsresponse.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace NSROOT
bool GetHeaderValue(const std::string& header, std::string& value);

static bool ReadHeaderLine(NetSocket *socket, const char *eol, std::string& line, size_t *len);

private:
TcpSocket *m_socket;
bool m_successful;
Expand Down

0 comments on commit 3283f73

Please sign in to comment.