From 7a72e63372a242bd648c84c6b95c1821d2f493ee Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Sat, 5 Oct 2013 21:59:00 -0300 Subject: [PATCH] fix problem with dhtput > 2kb (for avatar) --- libtorrent/src/kademlia/node.cpp | 1 + libtorrent/src/udp_socket.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libtorrent/src/kademlia/node.cpp b/libtorrent/src/kademlia/node.cpp index d1099bb6..86531fab 100644 --- a/libtorrent/src/kademlia/node.cpp +++ b/libtorrent/src/kademlia/node.cpp @@ -1038,6 +1038,7 @@ void node_impl::incoming_request(msg const& m, entry& e) // pointer and length to the whole entry std::pair buf = msg_keys[mk_p]->data_section(); int maxSize = (multi) ? 512 : 8192; // single is bigger for avatar image etc + // Note: when increasing maxSize, check m_buf_size @ udp_socket.cpp. if (buf.second > maxSize || buf.second <= 0) { incoming_error(e, "message too big"); diff --git a/libtorrent/src/udp_socket.cpp b/libtorrent/src/udp_socket.cpp index 360f431f..8890c684 100644 --- a/libtorrent/src/udp_socket.cpp +++ b/libtorrent/src/udp_socket.cpp @@ -95,7 +95,7 @@ udp_socket::udp_socket(asio::io_service& ios #endif #endif - m_buf_size = 2000; + m_buf_size = 10000; m_new_buf_size = m_buf_size; m_buf = (char*)malloc(m_buf_size); }