From 45862c4697eef6a5c3115a11add876bf878e4e4a Mon Sep 17 00:00:00 2001 From: HustXrb Date: Mon, 13 Jun 2016 17:20:30 +0800 Subject: [PATCH] restore keep-alive setting --- hustdb/sync/module/http.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hustdb/sync/module/http.cpp b/hustdb/sync/module/http.cpp index 3ad3122..74ec6b2 100644 --- a/hustdb/sync/module/http.cpp +++ b/hustdb/sync/module/http.cpp @@ -231,8 +231,8 @@ extern "C" curl_easy_setopt (http->curl, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt (http->curl, CURLOPT_AUTOREFERER, 1); - curl_easy_setopt (http->curl, CURLOPT_MAXREDIRS, 11); - curl_easy_setopt (http->curl, CURLOPT_MAXCONNECTS, 11); + curl_easy_setopt (http->curl, CURLOPT_MAXREDIRS, 10); + curl_easy_setopt (http->curl, CURLOPT_MAXCONNECTS, 100); curl_easy_setopt (http->curl, CURLOPT_CLOSEPOLICY, CURLCLOSEPOLICY_LEAST_RECENTLY_USED); curl_easy_setopt (http->curl, CURLOPT_FILETIME, 1); @@ -312,6 +312,12 @@ extern "C" return false; } } + + r = curl_easy_setopt (http->curl, CURLOPT_POST, 1); + if ( unlikely (CURLE_OK != r) ) + { + return false; + } r = curl_easy_setopt (http->curl, CURLOPT_POSTFIELDS, fields); if ( unlikely (CURLE_OK != r) )