summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cache/src/tango_cache_client.cpp4
-rw-r--r--cache/src/tango_cache_client_in.h3
2 files changed, 5 insertions, 2 deletions
diff --git a/cache/src/tango_cache_client.cpp b/cache/src/tango_cache_client.cpp
index 3df1dfd..8a62350 100644
--- a/cache/src/tango_cache_client.cpp
+++ b/cache/src/tango_cache_client.cpp
@@ -927,6 +927,10 @@ static int curl_timer_function_cb(CURLM *multi, long timeout_ms, void *userp)
}
else if(timeout_ms == -1) //timeout_ms is -1 means we should delete the timer.
{
+ //call curl_multi_socket_action to update multidata->sessions, otherwise it will not be updated to 0
+ //when all transfers complete in some occasions(eg, GET, some objects hited while ohters miss).
+ rc = curl_multi_socket_action(multi, CURL_SOCKET_TIMEOUT, 0, &still_running);
+ multidata->sessions = still_running;
evtimer_del(&multidata->timer_event);
}
else //update the timer to the new value.
diff --git a/cache/src/tango_cache_client_in.h b/cache/src/tango_cache_client_in.h
index 3285280..330ac55 100644
--- a/cache/src/tango_cache_client_in.h
+++ b/cache/src/tango_cache_client_in.h
@@ -143,7 +143,7 @@ struct tango_cache_parameter
struct minio_multihd_data
{
- long long sessions; //��ǰ���ڽ���GET/PUT�ĻỰ��
+ volatile long long sessions; //��ǰ���ڽ���GET/PUT�ĻỰ��
CURLM *multi_hd;
struct event timer_event;
struct event_base* evbase;
@@ -160,7 +160,6 @@ struct tango_cache_instance
char redisaddr[128];
map<string, minio_multihd_data*> *minio_hosts;
- struct minio_multihd_data multidata;
const struct tango_cache_parameter *param;
void *runtime_log;
struct cache_statistics statistic;