1
0

Fixed All signedness warnings in HTTPServer.cpp

This commit is contained in:
Tycho 2014-04-02 06:36:25 -07:00
parent 7ece0cc836
commit 1f5a4a39f2
10 changed files with 17 additions and 14 deletions

View File

@ -2633,7 +2633,7 @@ void cClientHandle::PacketError(unsigned char a_PacketType)
void cClientHandle::DataReceived(const char * a_Data, int a_Size)
void cClientHandle::DataReceived(const char * a_Data, size_t a_Size)
{
// Data is received from the client, store it in the buffer to be processed by the Tick thread:
m_TimeSinceLastPacket = 0;

View File

@ -362,7 +362,7 @@ private:
void HandleCommandBlockMessage(const char * a_Data, unsigned int a_Length);
// cSocketThreads::cCallback overrides:
virtual void DataReceived (const char * a_Data, int a_Size) override; // Data is received from the client
virtual void DataReceived (const char * a_Data, size_t a_Size) override; // Data is received from the client
virtual void GetOutgoingData(AString & a_Data) override; // Data can be sent to client
virtual void SocketClosed (void) override; // The socket has been closed for any reason
}; // tolua_export

View File

@ -144,7 +144,7 @@ void cHTTPConnection::Terminate(void)
void cHTTPConnection::DataReceived(const char * a_Data, int a_Size)
void cHTTPConnection::DataReceived(const char * a_Data, size_t a_Size)
{
switch (m_State)
{
@ -181,9 +181,9 @@ void cHTTPConnection::DataReceived(const char * a_Data, int a_Size)
}
// Process the rest of the incoming data into the request body:
if (a_Size > (int)BytesConsumed)
if (a_Size > BytesConsumed)
{
DataReceived(a_Data + BytesConsumed, a_Size - (int)BytesConsumed);
DataReceived(a_Data + BytesConsumed, a_Size - BytesConsumed);
}
else
{

View File

@ -91,7 +91,7 @@ protected:
// cSocketThreads::cCallback overrides:
virtual void DataReceived (const char * a_Data, int a_Size) override; // Data is received from the client
virtual void DataReceived (const char * a_Data, size_t a_Size) override; // Data is received from the client
virtual void GetOutgoingData(AString & a_Data) override; // Data can be sent to client
virtual void SocketClosed (void) override; // The socket has been closed for any reason
} ;

View File

@ -52,7 +52,7 @@ cHTTPFormParser::cHTTPFormParser(cHTTPRequest & a_Request, cCallbacks & a_Callba
cHTTPFormParser::cHTTPFormParser(eKind a_Kind, const char * a_Data, int a_Size, cCallbacks & a_Callbacks) :
cHTTPFormParser::cHTTPFormParser(eKind a_Kind, const char * a_Data, size_t a_Size, cCallbacks & a_Callbacks) :
m_Callbacks(a_Callbacks),
m_Kind(a_Kind),
m_IsValid(true)
@ -64,7 +64,7 @@ cHTTPFormParser::cHTTPFormParser(eKind a_Kind, const char * a_Data, int a_Size,
void cHTTPFormParser::Parse(const char * a_Data, int a_Size)
void cHTTPFormParser::Parse(const char * a_Data, size_t a_Size)
{
if (!m_IsValid)
{

View File

@ -36,6 +36,9 @@ public:
class cCallbacks
{
public:
virtual ~cCallbacks() {};
/// Called when a new file part is encountered in the form data
virtual void OnFileStart(cHTTPFormParser & a_Parser, const AString & a_FileName) = 0;
@ -51,10 +54,10 @@ public:
cHTTPFormParser(cHTTPRequest & a_Request, cCallbacks & a_Callbacks);
/// Creates a parser with the specified content type that reads data from a string
cHTTPFormParser(eKind a_Kind, const char * a_Data, int a_Size, cCallbacks & a_Callbacks);
cHTTPFormParser(eKind a_Kind, const char * a_Data, size_t a_Size, cCallbacks & a_Callbacks);
/// Adds more data into the parser, as the request body is received
void Parse(const char * a_Data, int a_Size);
void Parse(const char * a_Data, size_t a_Size);
/** Notifies that there's no more data incoming and the parser should finish its parsing.
Returns true if parsing successful

View File

@ -39,7 +39,7 @@ public:
void AddHeader(const AString & a_Key, const AString & a_Value);
void SetContentType (const AString & a_ContentType) { m_ContentType = a_ContentType; }
void SetContentLength(int a_ContentLength) { m_ContentLength = a_ContentLength; }
void SetContentLength(size_t a_ContentLength) { m_ContentLength = a_ContentLength; }
const AString & GetContentType (void) const { return m_ContentType; }
size_t GetContentLength(void) const { return m_ContentLength; }

View File

@ -64,7 +64,7 @@ public:
virtual ~cCallback() {}
/** Called when data is received from the remote party */
virtual void DataReceived(const char * a_Data, int a_Size) = 0;
virtual void DataReceived(const char * a_Data, size_t a_Size) = 0;
/** Called when data can be sent to remote party
The function is supposed to *set* outgoing data to a_Data (overwrite) */

View File

@ -169,7 +169,7 @@ cRCONServer::cConnection::cConnection(cRCONServer & a_RCONServer, cSocket & a_So
void cRCONServer::cConnection::DataReceived(const char * a_Data, int a_Size)
void cRCONServer::cConnection::DataReceived(const char * a_Data, size_t a_Size)
{
// Append data to the buffer:
m_Buffer.append(a_Data, a_Size);

View File

@ -65,7 +65,7 @@ protected:
// cSocketThreads::cCallback overrides:
virtual void DataReceived(const char * a_Data, int a_Size) override;
virtual void DataReceived(const char * a_Data, size_t a_Size) override;
virtual void GetOutgoingData(AString & a_Data) override;
virtual void SocketClosed(void) override;