From 48f6e5e1e945728ecab3c19b281460a377941b86 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 5 Jun 2007 09:08:24 +0000 Subject: [PATCH] report encryption data in peer_info --- src/deluge_core.cpp | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/src/deluge_core.cpp b/src/deluge_core.cpp index 40b76cdde..35c187573 100644 --- a/src/deluge_core.cpp +++ b/src/deluge_core.cpp @@ -871,27 +871,29 @@ static PyObject *torrent_get_peer_info(PyObject *self, PyObject *args) } 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}", - "download_speed", float(peers[i].down_speed), - "total_download", double(peers[i].total_download), - "upload_speed", float(peers[i].up_speed), - "total_upload", double(peers[i].total_upload), - "download_queue_length", long(peers[i].download_queue_length), - "upload_queue_length", long(peers[i].upload_queue_length), - "is_interesting", long((peers[i].flags & peer_info::interesting) != 0), - "is_choked", long((peers[i].flags & peer_info::choked) != 0), - "is_remote_interested", long((peers[i].flags & peer_info::remote_interested) != 0), - "is_remote_choked", long((peers[i].flags & peer_info::remote_choked) != 0), - "supports_extensions", long((peers[i].flags & peer_info::supports_extensions)!= 0), - "is_local_connection", long((peers[i].flags & peer_info::local_connection) != 0), - "is_awaiting_handshake", long((peers[i].flags & peer_info::handshake) != 0), - "is_connecting", long((peers[i].flags & peer_info::connecting) != 0), - "is_queued", long((peers[i].flags & peer_info::queued) != 0), - "client", peers[i].client.c_str(), - "is_seed", long(peers[i].seed), - "ip", peers[i].ip.address().to_string().c_str(), - "peer_has", float(float(pieces_had)*100.0/pieces.size()), - "pieces", py_pieces + "{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), + "total_download", double(peers[i].total_download), + "upload_speed", float(peers[i].up_speed), + "total_upload", double(peers[i].total_upload), + "download_queue_length", long(peers[i].download_queue_length), + "upload_queue_length", long(peers[i].upload_queue_length), + "is_interesting", long((peers[i].flags & peer_info::interesting) != 0), + "is_choked", long((peers[i].flags & peer_info::choked) != 0), + "is_remote_interested", long((peers[i].flags & peer_info::remote_interested) != 0), + "is_remote_choked", long((peers[i].flags & peer_info::remote_choked) != 0), + "supports_extensions", long((peers[i].flags & peer_info::supports_extensions)!= 0), + "is_local_connection", long((peers[i].flags & peer_info::local_connection) != 0), + "is_awaiting_handshake", long((peers[i].flags & peer_info::handshake) != 0), + "is_connecting", long((peers[i].flags & peer_info::connecting) != 0), + "is_queued", long((peers[i].flags & peer_info::queued) != 0), + "client", peers[i].client.c_str(), + "is_seed", long(peers[i].seed), + "ip", peers[i].ip.address().to_string().c_str(), + "peer_has", float(float(pieces_had)*100.0/pieces.size()), + "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