diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2009-09-11 15:04:47 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2009-09-11 15:04:47 +0200 |
commit | c18004e67869a9de88d9f8038a7a1957f20f63fc (patch) | |
tree | 67e1ae2e3886dfe4d8421fe0faf1e461dea14e04 /src/Net/Connection.cpp | |
parent | 36a3a590ffa4133f7f2d980a57d48ef95c680b71 (diff) | |
download | mad-c18004e67869a9de88d9f8038a7a1957f20f63fc.tar mad-c18004e67869a9de88d9f8038a7a1957f20f63fc.zip |
Net: Add support for packets >64K
Need too secure this against DoS...
Diffstat (limited to 'src/Net/Connection.cpp')
-rw-r--r-- | src/Net/Connection.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Net/Connection.cpp b/src/Net/Connection.cpp index 80a7163..f1beb35 100644 --- a/src/Net/Connection.cpp +++ b/src/Net/Connection.cpp @@ -96,7 +96,7 @@ void Connection::handleHeaderReceive(const boost::shared_array<boost::uint8_t> & enterReceiveLoop(); } else { - rawReceive(ntohs(header.length), boost::bind(&Connection::handleDataReceive, thisPtr.lock(), _1)); + rawReceive(ntohl(header.length), boost::bind(&Connection::handleDataReceive, thisPtr.lock(), _1)); } } @@ -104,7 +104,7 @@ void Connection::handleDataReceive(const boost::shared_array<boost::uint8_t> &da { boost::upgrade_lock<boost::shared_mutex> lock(connectionLock); - receiveSignal.emit(boost::shared_ptr<Packet>(new Packet(ntohs(header.requestId), data.get(), ntohs(header.length)))); + receiveSignal.emit(boost::shared_ptr<Packet>(new Packet(ntohs(header.requestId), data.get(), ntohl(header.length)))); } enterReceiveLoop(); |