report encryption data in peer_info
This commit is contained in:
parent
6d1805c85d
commit
48f6e5e1e9
|
@ -871,7 +871,7 @@ static PyObject *torrent_get_peer_info(PyObject *self, PyObject *args)
|
||||||
}
|
}
|
||||||
|
|
||||||
peer_info = Py_BuildValue(
|
peer_info = Py_BuildValue(
|
||||||
"{s:f,s:d,s:f,s:d,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:s,s:i,s:s,s:f,s:O}",
|
"{s:f,s:d,s:f,s:d,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:s,s:i,s:s,s:f,s:O,s:i,s:i}",
|
||||||
"download_speed", float(peers[i].down_speed),
|
"download_speed", float(peers[i].down_speed),
|
||||||
"total_download", double(peers[i].total_download),
|
"total_download", double(peers[i].total_download),
|
||||||
"upload_speed", float(peers[i].up_speed),
|
"upload_speed", float(peers[i].up_speed),
|
||||||
|
@ -891,7 +891,9 @@ static PyObject *torrent_get_peer_info(PyObject *self, PyObject *args)
|
||||||
"is_seed", long(peers[i].seed),
|
"is_seed", long(peers[i].seed),
|
||||||
"ip", peers[i].ip.address().to_string().c_str(),
|
"ip", peers[i].ip.address().to_string().c_str(),
|
||||||
"peer_has", float(float(pieces_had)*100.0/pieces.size()),
|
"peer_has", float(float(pieces_had)*100.0/pieces.size()),
|
||||||
"pieces", py_pieces
|
"pieces", py_pieces,
|
||||||
|
"rc4_encrypted", long((peers[i].flags & peer_info::rc4_encrypted) != 0),
|
||||||
|
"plaintext_encrypted", long((peers[i].flags & peer_info::plaintext_encrypted) != 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
Py_DECREF(py_pieces); // Assuming the previous line does NOT steal the ref, then this is
|
Py_DECREF(py_pieces); // Assuming the previous line does NOT steal the ref, then this is
|
||||||
|
|
Loading…
Reference in New Issue