From 07d15709a6f9685c542c254bd6a1b9564085ef52 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Thu, 7 Jun 2007 20:05:33 +0000 Subject: [PATCH] enc fix --- src/deluge_core.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/deluge_core.cpp b/src/deluge_core.cpp index d97710bf6..19999272a 100644 --- a/src/deluge_core.cpp +++ b/src/deluge_core.cpp @@ -1223,14 +1223,18 @@ static PyObject *torrent_pe_settings(PyObject *self, PyObject *args) { pe_settings s = pe_settings(); M_pe_settings = new pe_settings(); - M_pe_settings->out_enc_policy = s.out_enc_policy; - printf("out policy is %d\r\n", s.out_enc_policy); - M_pe_settings->in_enc_policy = s.in_enc_policy; - printf("in policy is %d\r\n", s.in_enc_policy) ; - M_pe_settings->allowed_enc_level = s.allowed_enc_level; - printf("level is %d\r\n", s.allowed_enc_level); - M_pe_settings->prefer_rc4 = int(s.prefer_rc4); - printf("prefer rc4 is %d\r\n", s.prefer_rc4); + libtorrent::pe_settings::enc_policy out, in, prefer; + libtorrent::pe_settings::enc_level level; + + PyArg_ParseTuple(args, "iiii", &out, &in, &level, &prefer); + M_pe_settings->out_enc_policy = out; + printf("out policy is %d\r\n", M_pe_settings->out_enc_policy); + M_pe_settings->in_enc_policy = in; + printf("in policy is %d\r\n", M_pe_settings->in_enc_policy) ; + M_pe_settings->allowed_enc_level = level; + printf("level is %d\r\n", M_pe_settings->allowed_enc_level); + M_pe_settings->prefer_rc4 = prefer; + printf("prefer rc4 is %d\r\n", M_pe_settings->prefer_rc4); M_ses->set_pe_settings(*M_pe_settings); return Py_None; }