diff options
author | Stijn Buys <ingar@osirion.org> | 2008-05-01 12:41:31 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-05-01 12:41:31 +0000 |
commit | f5266b403c50cb2b6d712e6d8f41b62ad2433efb (patch) | |
tree | fbd1cbafbb6d43b2fd5838cff8ce85df245bac86 /src/core/netclient.cc | |
parent | e2b18c44a6ae38bb84f717c86988a80da137c3e7 (diff) |
lights
Diffstat (limited to 'src/core/netclient.cc')
-rw-r--r-- | src/core/netclient.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/core/netclient.cc b/src/core/netclient.cc index c910e26..0c0d72a 100644 --- a/src/core/netclient.cc +++ b/src/core/netclient.cc @@ -121,7 +121,6 @@ void NetClient::send(std::string const &msg) void NetClient::transmit(int serverfd) { - if (!sendq.size()) { if (client_keepalive + NETTIMEOUT/2 < application()->time()) { sendq.assign("ping\n"); @@ -129,7 +128,7 @@ void NetClient::transmit(int serverfd) return; } } else if (sendq.size() >= FRAMESIZE) { - con_warn << "Outgoing message exceeds " << FRAMESIZE << " bytes!\n"; + con_warn << "Outgoing message exceeds " << FRAMESIZE -1 << " bytes!\n"; //sendq.clear(); //return; } @@ -137,7 +136,7 @@ void NetClient::transmit(int serverfd) ssize_t bytes_sent = 0; while (sendq.size() && !error()) { - bytes_sent = ::sendto(serverfd, sendq.c_str(), sendq.size(), 0, + bytes_sent = ::sendto(serverfd, sendq.c_str(), sendq.size()+1, 0, (struct sockaddr *)&client_addr, sizeof(client_addr)); if (bytes_sent < 0) { |