src/cloud.c
static bool cloud_recvComplete(CLOUD_SESSION_T *s)
{
   bool complete = false;

   if (parse_fullHeaderFound(s->recvBuf))
   {
      s->httpStatus = parse_getStatusCode(s->recvBuf);
      s->diags->lastHttpStatus = s->httpStatus;
      if (parse_transferEncodingChunkedFound(s->recvBuf))
      {
         complete = parse_fullDataChunkFound(s->recvBuf);
      }
      else if (parse_contentLengthFound(s->recvBuf))
      {
         complete = parse_entireContentReceived(s->recvBuf, s->totalBytesRcvd);
      }
      else
      {
         complete = true;
      }
   }

   return complete;
}
//!
//! Parse the receive buffer and do one of the following:
//!
//! A) If header contains content-length:
//!    Compare the size of the body to the number of bytes specified by
//!    content-length.
//!    If the size matches, true is returned.  Otherwise false is returned.
//! B) If header contains transfer-encoding: chunked.
//!    Parse the body of the message and search for a chunk of size 0,
//!    indicating the end of the packet. If a chunk size of 0 is found,
//!    true is returned. Otherwise, false is returned.
//! C) Buffer does not contain a full header yet (cannot find \r\n\r\n
//!    termination)
//!    Return false.
//! D) Buffer contains none of these in the header:
//!    Set the session as failed, we can not accept it..
//!
//! @param[in] *s pointer to a Cloud session structure object.
//!

Parse the receive buffer and do one of the following:
A) If header contains content-length:
Compare the size of the body to the number of bytes specified by
content-length.
If the size matches, true is returned.  Otherwise false is returned.
B) If header contains transfer-encoding: chunked.
Parse the body of the message and search for a chunk of size 0,
indicating the end of the packet. If a chunk size of 0 is found,
true is returned. Otherwise, false is returned.
C) Buffer does not contain a full header yet (cannot find \r\n\r\n
termination)
Return false.
D) Buffer contains none of these in the header:
Set the session as failed, we can not accept it
Parse the receive buffer and do one of the following : A ) If header contains content - length : Compare the size of the body to the number of bytes specified by content - length . If the size matches true is returned . Otherwise false is returned . B ) If header contains transfer - encoding : chunked . Parse the body of the message and search for a chunk of size 0 indicating the end of the packet . If a chunk size of 0 is found true is returned . Otherwise false is returned . C ) Buffer does not contain a full header yet ( cannot find \ r \ n \ r \ n termination ) Return false . D ) Buffer contains none of these in the header : Set the session as failed we can not accept it
static bool cloud_recvComplete(CLOUD_SESSION_T *s)
{
   bool complete = false;
   if (parse_fullHeaderFound(s->recvBuf))
   {
      s->httpStatus = parse_getStatusCode(s->recvBuf);
      s->diags->lastHttpStatus = s->httpStatus;
      if (parse_transferEncodingChunkedFound(s->recvBuf))
      {
         complete = parse_fullDataChunkFound(s->recvBuf);
      }
      else if (parse_contentLengthFound(s->recvBuf))
      {
         complete = parse_entireContentReceived(s->recvBuf, s->totalBytesRcvd);
      }
      else
      {
         complete = true;
      }
   }
   return complete;
}
static bool cloud_recvComplete ( CLOUD_SESSION_T * s ) { bool complete = false ; if ( parse_fullHeaderFound ( s -> recvBuf ) ) { s -> httpStatus = parse_getStatusCode ( s -> recvBuf ) ; s -> diags -> lastHttpStatus = s -> httpStatus ; if ( parse_transferEncodingChunkedFound ( s -> recvBuf ) ) { complete = parse_fullDataChunkFound ( s -> recvBuf ) ; } else if ( parse_contentLengthFound ( s -> recvBuf ) ) { complete = parse_entireContentReceived ( s -> recvBuf , s -> totalBytesRcvd ) ; } else { complete = true ; } } return complete ; }
Parse the receive buffer and do one of the following:
A) If header contains content-length:
Compare the size of the body to the number of bytes specified by
content-length.
Parse the receive buffer and do one of the following : A ) If header contains content - length : Compare the size of the body to the number of bytes specified by content - length .