Browse Source

fix problem with dhtput > 2kb (for avatar)

miguelfreitas
Miguel Freitas 11 years ago
parent
commit
7a72e63372
  1. 1
      libtorrent/src/kademlia/node.cpp
  2. 2
      libtorrent/src/udp_socket.cpp

1
libtorrent/src/kademlia/node.cpp

@ -1038,6 +1038,7 @@ void node_impl::incoming_request(msg const& m, entry& e) @@ -1038,6 +1038,7 @@ void node_impl::incoming_request(msg const& m, entry& e)
// pointer and length to the whole entry
std::pair<char const*, int> 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");

2
libtorrent/src/udp_socket.cpp

@ -95,7 +95,7 @@ udp_socket::udp_socket(asio::io_service& ios @@ -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);
}

Loading…
Cancel
Save