Fixed All signedness warnings in HTTPServer.cpp
This commit is contained in:
parent
7ece0cc836
commit
1f5a4a39f2
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
} ;
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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; }
|
||||
|
@ -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) */
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user