summaryrefslogtreecommitdiff
path: root/lib/getinfo.c
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2016-09-17 01:48:20 -0400
committerJay Satiro <raysatiro@yahoo.com>2016-09-20 01:14:01 -0400
commit22cfeac730d5b115b04f6b6ebf2f0a74f0bc978d (patch)
tree97c95add2f45b8f91c220cb5f1fd556d186808d8 /lib/getinfo.c
parent6834ebaaa3de5799bf4d4430005af5bca5bbe448 (diff)
downloadcurl-22cfeac730d5b115b04f6b6ebf2f0a74f0bc978d.tar.gz
easy: Reset all statistical session info in curl_easy_reset
Bug: https://github.com/curl/curl/issues/1017 Reported-by: Jeroen Ooms
Diffstat (limited to 'lib/getinfo.c')
-rw-r--r--lib/getinfo.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/getinfo.c b/lib/getinfo.c
index 262cd934f..9641d79dc 100644
--- a/lib/getinfo.c
+++ b/lib/getinfo.c
@@ -36,8 +36,8 @@
#include "memdebug.h"
/*
- * This is supposed to be called in the beginning of a perform() session
- * and should reset all session-info variables
+ * This is supposed to be called in the beginning of a perform() session and
+ * in curl_easy_reset() and should reset all session-info variables.
*/
CURLcode Curl_initinfo(struct Curl_easy *data)
{
@@ -58,18 +58,27 @@ CURLcode Curl_initinfo(struct Curl_easy *data)
info->filetime = -1; /* -1 is an illegal time and thus means unknown */
info->timecond = FALSE;
- free(info->contenttype);
- info->contenttype = NULL;
-
info->header_size = 0;
info->request_size = 0;
+ info->proxyauthavail = 0;
+ info->httpauthavail = 0;
info->numconnects = 0;
+ free(info->contenttype);
+ info->contenttype = NULL;
+
+ free(info->wouldredirect);
+ info->wouldredirect = NULL;
+
info->conn_primary_ip[0] = '\0';
info->conn_local_ip[0] = '\0';
info->conn_primary_port = 0;
info->conn_local_port = 0;
+#ifdef USE_SSL
+ Curl_ssl_free_certinfo(data);
+#endif
+
return CURLE_OK;
}