summaryrefslogtreecommitdiff
path: root/src/network/core/tcp.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-10-07 20:58:14 +0000
committerrubidium <rubidium@openttd.org>2009-10-07 20:58:14 +0000
commitdf75db67ebe271e9de92cc65872ff65b46e4ad4a (patch)
tree48f73cf744b9a0656a9dd23a8a6bab9608fa2a7d /src/network/core/tcp.cpp
parent8c37da1be680852d5429da8d5519fa3f799575e3 (diff)
downloadopenttd-df75db67ebe271e9de92cc65872ff65b46e4ad4a.tar.xz
(svn r17742) -Codechange: remove unused variable from Recv_Packet
Diffstat (limited to 'src/network/core/tcp.cpp')
-rw-r--r--src/network/core/tcp.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/network/core/tcp.cpp b/src/network/core/tcp.cpp
index 2064945a7..b30e4e526 100644
--- a/src/network/core/tcp.cpp
+++ b/src/network/core/tcp.cpp
@@ -131,13 +131,11 @@ bool NetworkTCPSocketHandler::Send_Packets()
* @param status the variable to store the status into
* @return the received packet (or NULL when it didn't receive one)
*/
-Packet *NetworkTCPSocketHandler::Recv_Packet(NetworkRecvStatus *status)
+Packet *NetworkTCPSocketHandler::Recv_Packet()
{
ssize_t res;
Packet *p;
- *status = NETWORK_RECV_STATUS_OKAY;
-
if (!this->IsConnected()) return NULL;
if (this->packet_recv == NULL) {
@@ -157,7 +155,7 @@ Packet *NetworkTCPSocketHandler::Recv_Packet(NetworkRecvStatus *status)
if (err != EWOULDBLOCK) {
/* Something went wrong... (104 is connection reset by peer) */
if (err != 104) DEBUG(net, 0, "recv failed with error %d", err);
- *status = this->CloseConnection();
+ this->CloseConnection();
return NULL;
}
/* Connection would block, so stop for now */
@@ -165,7 +163,7 @@ Packet *NetworkTCPSocketHandler::Recv_Packet(NetworkRecvStatus *status)
}
if (res == 0) {
/* Client/server has left */
- *status = this->CloseConnection();
+ this->CloseConnection();
return NULL;
}
p->pos += res;
@@ -175,7 +173,7 @@ Packet *NetworkTCPSocketHandler::Recv_Packet(NetworkRecvStatus *status)
p->ReadRawPacketSize();
if (p->size > SEND_MTU) {
- *status = this->CloseConnection();
+ this->CloseConnection();
return NULL;
}
}
@@ -188,7 +186,7 @@ Packet *NetworkTCPSocketHandler::Recv_Packet(NetworkRecvStatus *status)
if (err != EWOULDBLOCK) {
/* Something went wrong... (104 is connection reset by peer) */
if (err != 104) DEBUG(net, 0, "recv failed with error %d", err);
- *status = this->CloseConnection();
+ this->CloseConnection();
return NULL;
}
/* Connection would block */
@@ -196,7 +194,7 @@ Packet *NetworkTCPSocketHandler::Recv_Packet(NetworkRecvStatus *status)
}
if (res == 0) {
/* Client/server has left */
- *status = this->CloseConnection();
+ this->CloseConnection();
return NULL;
}