From 8464c9c0f67755681f529e8b2dd6ee9232834259 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Wed, 10 Oct 2007 02:03:34 +0000 Subject: [PATCH] small tweak to deluge_core max_half_open --- src/deluge_core.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/deluge_core.cpp b/src/deluge_core.cpp index 93350a0c8..ed4562e18 100644 --- a/src/deluge_core.cpp +++ b/src/deluge_core.cpp @@ -373,8 +373,6 @@ static PyObject *torrent_init(PyObject *self, PyObject *args) M_settings->user_agent = std::string(user_agent); #if defined(_WIN32) M_ses->set_max_half_open_connections(8); -#else - M_ses->set_max_half_open_connections(-1); #endif M_ses->set_download_rate_limit(-1); @@ -474,7 +472,10 @@ static PyObject *torrent_set_max_half_open(PyObject *self, PyObject *args) python_long arg; if (!PyArg_ParseTuple(args, "i", &arg)) return NULL; - +#if defined(_WIN32) + if (arg > 8) + arg = 8; +#endif M_ses->set_max_half_open_connections(arg); Py_INCREF(Py_None); return Py_None;