better way to show number of connections
This commit is contained in:
parent
9bd76e077a
commit
dead0864ad
|
@ -646,7 +646,6 @@ static PyObject *torrent_set_max_connections_global(PyObject *self, PyObject *ar
|
|||
|
||||
// printf("Setting max connections: %d\r\n", max_conn);
|
||||
M_ses->set_max_connections(max_conn);
|
||||
|
||||
Py_INCREF(Py_None); return Py_None;
|
||||
}
|
||||
|
||||
|
@ -1217,11 +1216,12 @@ static PyObject *torrent_get_session_info(PyObject *self, PyObject *args)
|
|||
{
|
||||
session_status s = M_ses->status();
|
||||
|
||||
return Py_BuildValue("{s:l,s:f,s:f,s:l,s:f,s:f}",
|
||||
return Py_BuildValue("{s:l,s:f,s:f,s:ls:l,s:f,s:f}",
|
||||
"has_incoming_connections", long(s.has_incoming_connections),
|
||||
"upload_rate", float(s.payload_upload_rate),
|
||||
"download_rate", float(s.payload_download_rate),
|
||||
"num_peers", long(s.num_peers),
|
||||
"num_connections", long(M_ses->num_connections()),
|
||||
"total_downloaded", float(s.total_payload_download),
|
||||
"total_uploaded", float(s.total_payload_upload));
|
||||
}
|
||||
|
|
|
@ -1091,7 +1091,7 @@ window, please enter your password"))
|
|||
def update_statusbar_and_tray(self):
|
||||
plugin_messages = self.plugins.get_plugin_tray_messages()
|
||||
core_state = self.manager.get_state()
|
||||
connections = core_state['num_peers']
|
||||
connections = core_state['num_connections']
|
||||
if self.config.get("max_connections_global") < 0 :
|
||||
max_connections = _("Unlimited")
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue