aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-06-04 22:43:33 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-06-04 22:43:33 +0300
commited772da0cce100be856fb1c3bbce949e333543fb (patch)
treed36af64241c974313b7dff25612e4afe0325df4c
parentf48882213e31c47660cf0c87df1e04e51db9b50a (diff)
downloadminetest-ed772da0cce100be856fb1c3bbce949e333543fb.tar.gz
minetest-ed772da0cce100be856fb1c3bbce949e333543fb.tar.bz2
minetest-ed772da0cce100be856fb1c3bbce949e333543fb.zip
Remove misdesigned exception from ReliablePacketBuffer
-rw-r--r--src/connection.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/connection.cpp b/src/connection.cpp
index 127cabdc5..5bf47f13c 100644
--- a/src/connection.cpp
+++ b/src/connection.cpp
@@ -353,9 +353,11 @@ SharedBuffer<u8> IncomingSplitBuffer::insert(BufferedPacket &p, bool reliable)
<<" != sp->reliable="<<sp->reliable
<<std::endl;
- // If chunk already exists, cancel
+ // If chunk already exists, ignore it.
+ // Sometimes two identical packets may arrive when there is network
+ // lag and the server re-sends stuff.
if(sp->chunks.find(chunk_num) != NULL)
- throw AlreadyExistsException("Chunk already in buffer");
+ return SharedBuffer<u8>();
// Cut chunk data out of packet
u32 chunkdatasize = p.data.getSize() - headersize;