diff --git a/docs/extension_protocol.rst b/docs/extension_protocol.rst index 3a081f68b..4b107d3d1 100644 --- a/docs/extension_protocol.rst +++ b/docs/extension_protocol.rst @@ -74,23 +74,29 @@ This is the defined item in the dictionary: Here are some other items that an implementation may choose to support: -+-------+-----------------------------------------------------------+ -| name | description | -+=======+===========================================================+ -| p | Local TCP listen port. Allows each side to learn about | -| | the TCP port number of the other side. Note that there is | -| | no need for the receiving side of the connection to send | -| | this extension message, since its port number is already | -| | known. | -+-------+-----------------------------------------------------------+ -| v | Client name and version (as an utf-8 string). | -| | This is a much more reliable way of identifying the | -| | client than relying on the peer id encoding. | -+-------+-----------------------------------------------------------+ -| reqq | An integer, the number of outstanding request messages | -| | this client supports without dropping any. The default in | -| | in libtorrent is 250. | -+-------+-----------------------------------------------------------+ ++--------+-----------------------------------------------------------+ +| name | description | ++========+===========================================================+ +| p | Local TCP listen port. Allows each side to learn about | +| | the TCP port number of the other side. Note that there is | +| | no need for the receiving side of the connection to send | +| | this extension message, since its port number is already | +| | known. | ++--------+-----------------------------------------------------------+ +| v | Client name and version (as a utf-8 string). | +| | This is a much more reliable way of identifying the | +| | client than relying on the peer id encoding. | ++--------+-----------------------------------------------------------+ +| yourip | A string containing the compact representation of the ip | +| | address this peer sees you as. i.e. this is the | +| | receiver's external ip address (no port is included). | +| | This may be both an IPv4 (4 bytes) or an IPv6 (16 bytes) | +| | address. | ++--------+-----------------------------------------------------------+ +| reqq | An integer, the number of outstanding request messages | +| | this client supports without dropping any. The default in | +| | in libtorrent is 250. | ++--------+-----------------------------------------------------------+ The handshake dictionary could also include extended handshake information, such as support for encrypted headers or anything diff --git a/src/bt_peer_connection.cpp b/src/bt_peer_connection.cpp index 2483b4a2a..b3ff591e5 100755 --- a/src/bt_peer_connection.cpp +++ b/src/bt_peer_connection.cpp @@ -1257,7 +1257,7 @@ namespace libtorrent std::string remote_address; std::back_insert_iterator out(remote_address); detail::write_address(remote().address(), out); - handshake["ip"] = remote_address; + handshake["yourip"] = remote_address; handshake["reqq"] = m_ses.settings().max_allowed_in_request_queue; // loop backwards, to make the first extension be the last