diff --git a/checkin_notes b/checkin_notes index 2615b22ac2..d19fbde1ba 100755 --- a/checkin_notes +++ b/checkin_notes @@ -10752,3 +10752,11 @@ David 3 Oct 2006 client_state.h cpu_sched.C cs_scheduler.C + +David 3 Oct 2006 + - core client: fixed bug that could cause Curl to be + passed a null pointer (bandwidth limiting) + + client/ + file_xfer.C + http_curl.C,h diff --git a/client/file_xfer.C b/client/file_xfer.C index 8092ffd2c7..5aefd52a70 100644 --- a/client/file_xfer.C +++ b/client/file_xfer.C @@ -368,6 +368,7 @@ void FILE_XFER_SET::set_bandwidth_limits(bool is_upload) { int n = 0; for (i=0; iis_active()) continue; if (is_upload) { if (!fxp->is_upload) continue; } else { @@ -379,6 +380,7 @@ void FILE_XFER_SET::set_bandwidth_limits(bool is_upload) { max_bytes_sec /= n; for (i=0; iis_active()) continue; if (is_upload) { if (!fxp->is_upload) continue; fxp->set_speed_limit(true, max_bytes_sec); diff --git a/client/http_curl.C b/client/http_curl.C index 1495ae1028..2e71ab58a0 100644 --- a/client/http_curl.C +++ b/client/http_curl.C @@ -1041,6 +1041,7 @@ void HTTP_OP::update_speed() { void HTTP_OP::set_speed_limit(bool is_upload, double bytes_sec) { CURLcode cc; curl_off_t bs = (curl_off_t)bytes_sec; + if (is_upload) { cc = curl_easy_setopt(curlEasy, CURLOPT_MAX_SEND_SPEED_LARGE, bs); } else { diff --git a/client/http_curl.h b/client/http_curl.h index 3c12b71b99..f40f59e7a7 100644 --- a/client/http_curl.h +++ b/client/http_curl.h @@ -130,6 +130,9 @@ public: bool http_op_done(); int set_proxy(PROXY_INFO *new_pi); void setupProxyCurl(); + bool is_active() { + return curlEasy!=NULL; + } private: // internal use in the class -- takes an init_get/post/post2 and turns it into