*** empty log message ***

svn path=/trunk/boinc/; revision=11225
This commit is contained in:
David Anderson 2006-10-02 17:44:27 +00:00
parent 22ed034d14
commit fde92c7d86
8 changed files with 43 additions and 14 deletions

View File

@ -10632,3 +10632,20 @@ David 2 Oct 2006
file_xfer.C,h
gui_http.C
http_curl.C,h
David 2 Oct 2006
- core client: bug fix in bandwidth-limiting code
- core client bug fix: when reset or detach a project,
sometimes would get a crash when deleting FILE_INFOs.
This is because instead of
iter = foo.erase(iter);
we just had
foo.erase(iter);
Clean up all code to always use the former.
client/
app.C
client_state.C
cpu_sched.C
file_xfer.C
http_curl.C,h
pers_file_xfer.C

View File

@ -282,7 +282,7 @@ int ACTIVE_TASK_SET::remove(ACTIVE_TASK* atp) {
iter = active_tasks.begin();
while (iter != active_tasks.end()) {
if (*iter == atp) {
active_tasks.erase(iter);
iter = active_tasks.erase(iter);
return 0;
}
iter++;

View File

@ -1309,7 +1309,7 @@ int CLIENT_STATE::detach_project(PROJECT* project) {
while (fi_iter != file_infos.end()) {
fip = *fi_iter;
if (fip->project == project) {
file_infos.erase(fi_iter);
fi_iter = file_infos.erase(fi_iter);
delete fip;
} else {
fi_iter++;
@ -1329,7 +1329,7 @@ int CLIENT_STATE::detach_project(PROJECT* project) {
for (project_iter = projects.begin(); project_iter != projects.end(); project_iter++) {
p = *project_iter;
if (p == project) {
projects.erase(project_iter);
project_iter = projects.erase(project_iter);
break;
}
}

View File

@ -602,7 +602,7 @@ bool CLIENT_STATE::enforce_schedule() {
// The task is already running; remove it from the heap
//
atp = atp1;
running_tasks.erase(it);
it = running_tasks.erase(it);
std::make_heap(
running_tasks.begin(),
running_tasks.end(),

View File

@ -185,7 +185,8 @@ int FILE_XFER_SET::remove(FILE_XFER* fxp) {
iter = file_xfers.begin();
while (iter != file_xfers.end()) {
if (*iter == fxp) {
file_xfers.erase(iter);
iter = file_xfers.erase(iter);
set_bandwidth_limits(fxp->is_upload);
return 0;
}
iter++;
@ -193,7 +194,6 @@ int FILE_XFER_SET::remove(FILE_XFER* fxp) {
msg_printf(NULL, MSG_ERROR,
"File transfer for %s not found", fxp->fip->name
);
set_bandwidth_limits(fxp->is_upload);
return ERR_NOT_FOUND;
}

View File

@ -271,6 +271,9 @@ int HTTP_OP::libcurl_exec(
return ERR_HTTP_ERROR; // returns 0 (CURLM_OK) on successful handle creation
}
// the following seems to be a no-op
//curlErr = curl_easy_setopt(curlEasy, CURLOPT_ERRORBUFFER, error_msg);
// OK, we have a handle, now open an asynchronous libcurl connection
// set the URL to use
@ -529,7 +532,7 @@ int HTTP_OP_SET::remove(HTTP_OP* p) {
iter = http_ops.begin();
while (iter != http_ops.end()) {
if (*iter == p) {
http_ops.erase(iter);
iter = http_ops.erase(iter);
return 0;
}
iter++;
@ -907,7 +910,10 @@ void HTTP_OP_SET::got_select(FDSET_GROUP&, double timeout) {
// read messages from curl that may have come in from the above loop
//
while ((pcurlMsg = curl_multi_info_read(g_curlMulti, &iNumMsg))) {
while (1) {
pcurlMsg = curl_multi_info_read(g_curlMulti, &iNumMsg);
if (!pcurlMsg) break;
// if we have a msg, then somebody finished
// can check also with pcurlMsg->msg == CURLMSG_DONE
//
@ -1050,12 +1056,16 @@ 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) {
curl_easy_setopt(curlEasy, CURLOPT_MAX_SEND_SPEED_LARGE, bs);
cc = curl_easy_setopt(curlEasy, CURLOPT_MAX_SEND_SPEED_LARGE, bs);
} else {
curl_easy_setopt(curlEasy, CURLOPT_MAX_RECV_SPEED_LARGE, bs);
cc = curl_easy_setopt(curlEasy, CURLOPT_MAX_RECV_SPEED_LARGE, bs);
}
if (cc) {
msg_printf(NULL, MSG_ERROR, "Curl error: %s", curl_easy_strerror(cc));
}
}
const char *BOINC_RCSID_57f273bb60 = "$Id$";

View File

@ -133,17 +133,19 @@ public:
private:
// internal use in the class -- takes an init_get/post/post2 and turns it into
// an appropriate libcurl request
int libcurl_exec(const char* url, const char* in = NULL, const char* out = NULL,
double offset = 0.0f, bool bPost = true
int libcurl_exec(const char* url, const char* in, const char* out,
double offset, bool bPost
);
};
// global function used by libcurl to write http replies to disk
//
size_t libcurl_write(void *ptr, size_t size, size_t nmemb, HTTP_OP* phop);
size_t libcurl_read( void *ptr, size_t size, size_t nmemb, HTTP_OP* phop);
curlioerr libcurl_ioctl(CURL *handle, curliocmd cmd, HTTP_OP* phop);
int libcurl_debugfunction(CURL *handle, curl_infotype type,
unsigned char *data, size_t size, HTTP_OP* phop);
unsigned char *data, size_t size, HTTP_OP* phop
);
// represents a set of HTTP requests in progress
//

View File

@ -510,7 +510,7 @@ int PERS_FILE_XFER_SET::remove(PERS_FILE_XFER* pfx) {
iter = pers_file_xfers.begin();
while (iter != pers_file_xfers.end()) {
if (*iter == pfx) {
pers_file_xfers.erase(iter);
iter = pers_file_xfers.erase(iter);
return 0;
}
iter++;