summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-04-05 23:12:17 +0200
committerTycho <work.tycho+git@gmail.com>2014-04-05 23:12:17 +0200
commit23395a5ce1daab24465d607575c09e06e5b7c449 (patch)
tree18555c220fc6e602b071a935b190ef25444f18a9 /Tools
parentFixed tolua++ override support (diff)
parentFixed Endiannes conversion routines for floats and doubles. (diff)
downloadcuberite-23395a5ce1daab24465d607575c09e06e5b7c449.tar
cuberite-23395a5ce1daab24465d607575c09e06e5b7c449.tar.gz
cuberite-23395a5ce1daab24465d607575c09e06e5b7c449.tar.bz2
cuberite-23395a5ce1daab24465d607575c09e06e5b7c449.tar.lz
cuberite-23395a5ce1daab24465d607575c09e06e5b7c449.tar.xz
cuberite-23395a5ce1daab24465d607575c09e06e5b7c449.tar.zst
cuberite-23395a5ce1daab24465d607575c09e06e5b7c449.zip
Diffstat (limited to 'Tools')
-rw-r--r--Tools/ProtoProxy/Connection.cpp10
-rw-r--r--Tools/ProtoProxy/Connection.h2
2 files changed, 8 insertions, 4 deletions
diff --git a/Tools/ProtoProxy/Connection.cpp b/Tools/ProtoProxy/Connection.cpp
index f02b503f1..d9b8e3dd1 100644
--- a/Tools/ProtoProxy/Connection.cpp
+++ b/Tools/ProtoProxy/Connection.cpp
@@ -387,6 +387,8 @@ bool cConnection::RelayFromServer(void)
return CLIENTSEND(Buffer, res);
}
}
+ ASSERT(!"Unhandled server state while relaying from server");
+ return false;
}
@@ -423,6 +425,8 @@ bool cConnection::RelayFromClient(void)
return SERVERSEND(Buffer, res);
}
}
+ ASSERT(!"Unhandled server state while relaying from client");
+ return false;
}
@@ -438,11 +442,11 @@ double cConnection::GetRelativeTime(void)
-bool cConnection::SendData(SOCKET a_Socket, const char * a_Data, int a_Size, const char * a_Peer)
+bool cConnection::SendData(SOCKET a_Socket, const char * a_Data, size_t a_Size, const char * a_Peer)
{
- DataLog(a_Data, a_Size, "Sending data to %s, %d bytes", a_Peer, a_Size);
+ DataLog(a_Data, a_Size, "Sending data to %s, %u bytes", a_Peer, (unsigned)a_Size);
- int res = send(a_Socket, a_Data, a_Size, 0);
+ int res = send(a_Socket, a_Data, (int)a_Size, 0);
if (res <= 0)
{
Log("%s closed the socket: %d, %d; aborting connection", a_Peer, res, SocketError);
diff --git a/Tools/ProtoProxy/Connection.h b/Tools/ProtoProxy/Connection.h
index 70b759d0f..9e04994b7 100644
--- a/Tools/ProtoProxy/Connection.h
+++ b/Tools/ProtoProxy/Connection.h
@@ -103,7 +103,7 @@ protected:
double GetRelativeTime(void);
/// Sends data to the specified socket. If sending fails, prints a fail message using a_Peer and returns false.
- bool SendData(SOCKET a_Socket, const char * a_Data, int a_Size, const char * a_Peer);
+ bool SendData(SOCKET a_Socket, const char * a_Data, size_t a_Size, const char * a_Peer);
/// Sends data to the specified socket. If sending fails, prints a fail message using a_Peer and returns false.
bool SendData(SOCKET a_Socket, cByteBuffer & a_Data, const char * a_Peer);