+PHP_HTTP_API STATUS _http_request_flush_cookies(http_request *request)
+{
+ int initialized = 1;
+ TSRMLS_FETCH_FROM_CTX(request->tsrm_ls);
+
+ HTTP_CHECK_CURL_INIT(request->ch, http_curl_init_ex(request->ch, request), initialized = 0);
+#if HTTP_CURL_VERSION(7,17,1)
+ if (initialized && CURLE_OK == curl_easy_setopt(request->ch, CURLOPT_COOKIELIST, "FLUSH")) {
+ return SUCCESS;
+ }
+#else
+ http_error(HE_WARNING, HTTP_E_REQUEST, "Could not flush cookies (need libcurl >= v7.17.1)");
+#endif
+ return FAILURE;
+}
+