changed the handshake 'ip' to 'yourip'

This commit is contained in:
Arvid Norberg 2007-07-07 01:36:40 +00:00
parent 82e1160214
commit a46ef3ece8
2 changed files with 24 additions and 18 deletions

View File

@ -74,23 +74,29 @@ This is the defined item in the dictionary:
Here are some other items that an implementation may choose to support: Here are some other items that an implementation may choose to support:
+-------+-----------------------------------------------------------+ +--------+-----------------------------------------------------------+
| name | description | | name | description |
+=======+===========================================================+ +========+===========================================================+
| p | Local TCP listen port. Allows each side to learn about | | p | Local TCP listen port. Allows each side to learn about |
| | the TCP port number of the other side. Note that there is | | | the TCP port number of the other side. Note that there is |
| | no need for the receiving side of the connection to send | | | no need for the receiving side of the connection to send |
| | this extension message, since its port number is already | | | this extension message, since its port number is already |
| | known. | | | known. |
+-------+-----------------------------------------------------------+ +--------+-----------------------------------------------------------+
| v | Client name and version (as an utf-8 string). | | v | Client name and version (as a utf-8 string). |
| | This is a much more reliable way of identifying the | | | This is a much more reliable way of identifying the |
| | client than relying on the peer id encoding. | | | client than relying on the peer id encoding. |
+-------+-----------------------------------------------------------+ +--------+-----------------------------------------------------------+
| reqq | An integer, the number of outstanding request messages | | yourip | A string containing the compact representation of the ip |
| | this client supports without dropping any. The default in | | | address this peer sees you as. i.e. this is the |
| | in libtorrent is 250. | | | 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 The handshake dictionary could also include extended handshake
information, such as support for encrypted headers or anything information, such as support for encrypted headers or anything

View File

@ -1257,7 +1257,7 @@ namespace libtorrent
std::string remote_address; std::string remote_address;
std::back_insert_iterator<std::string> out(remote_address); std::back_insert_iterator<std::string> out(remote_address);
detail::write_address(remote().address(), out); detail::write_address(remote().address(), out);
handshake["ip"] = remote_address; handshake["yourip"] = remote_address;
handshake["reqq"] = m_ses.settings().max_allowed_in_request_queue; handshake["reqq"] = m_ses.settings().max_allowed_in_request_queue;
// loop backwards, to make the first extension be the last // loop backwards, to make the first extension be the last