Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(610)

Unified Diff: libcurl_http_fetcher.cc

Issue 3021003: AU: minor fixes requested in http://codereview.chromium.org/3010009 (Closed) Base URL: ssh://git@chromiumos-git/update_engine.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « libcurl_http_fetcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libcurl_http_fetcher.cc
diff --git a/libcurl_http_fetcher.cc b/libcurl_http_fetcher.cc
index e2f18afcb66c0c5e3f71c8ca81fe97fe67193cc4..e969cf5a8b5dbad443545cd51a2e7f4090d23e50 100644
--- a/libcurl_http_fetcher.cc
+++ b/libcurl_http_fetcher.cc
@@ -79,7 +79,7 @@ void LibcurlHttpFetcher::TerminateTransfer() {
CleanUp();
}
-bool LibcurlHttpFetcher::CurlPerformOnce() {
+void LibcurlHttpFetcher::CurlPerformOnce() {
CHECK(transfer_in_progress_);
int running_handles = 0;
CURLMcode retcode = CURLM_CALL_MULTI_PERFORM;
@@ -116,7 +116,7 @@ bool LibcurlHttpFetcher::CurlPerformOnce() {
&LibcurlHttpFetcher::StaticRetryTimeoutCallback,
this);
}
- return false;
+ return;
} else {
if (delegate_) {
// success is when http_response_code is 200
@@ -127,7 +127,6 @@ bool LibcurlHttpFetcher::CurlPerformOnce() {
// set up callback
SetupMainloopSources();
}
- return false;
}
size_t LibcurlHttpFetcher::LibcurlWrite(void *ptr, size_t size, size_t nmemb) {
@@ -258,14 +257,11 @@ gboolean LibcurlHttpFetcher::RetryTimeoutCallback() {
}
gboolean LibcurlHttpFetcher::TimeoutCallback() {
+ // We always return true, even if we don't want glib to cll us back.
petkov 2010/07/17 04:32:43 typo: cll
+ // We will remove the event source separately if we don't want to
+ // be called back.
if (!transfer_in_progress_)
return TRUE;
- // Since we will return false from this function, which tells glib to
- // destroy the timeout callback, we must NULL it out here. This way, when
- // setting up callback sources again, we won't try to delete this (doomed)
- // timeout callback then.
- // TODO(adlr): optimize by checking if we can keep this timeout callback.
- //timeout_source_ = NULL;
CurlPerformOnce();
return TRUE;
}
« no previous file with comments | « libcurl_http_fetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698