aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/easy.c2
-rw-r--r--lib/getinfo.c7
-rw-r--r--lib/url.c3
-rw-r--r--lib/urldata.h2
4 files changed, 11 insertions, 3 deletions
diff --git a/lib/easy.c b/lib/easy.c
index eee1061e8..1242369d5 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -927,6 +927,8 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data)
Curl_convert_setup(outcurl);
+ Curl_initinfo(outcurl);
+
outcurl->magic = CURLEASY_MAGIC_NUMBER;
/* we reach this point and thus we are OK */
diff --git a/lib/getinfo.c b/lib/getinfo.c
index 9641d79dc..3186d8ac5 100644
--- a/lib/getinfo.c
+++ b/lib/getinfo.c
@@ -36,8 +36,11 @@
#include "memdebug.h"
/*
- * 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.
+ * Initialize statistical and informational data.
+ *
+ * This function is called in curl_easy_reset, curl_easy_duphandle and at the
+ * beginning of a perform session. It must reset the session-info variables,
+ * in particular all variables in struct PureInfo.
*/
CURLcode Curl_initinfo(struct Curl_easy *data)
{
diff --git a/lib/url.c b/lib/url.c
index b997f419b..65c2e5414 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -92,6 +92,7 @@ bool curl_win32_idn_to_ascii(const char *in, char **out);
#include "warnless.h"
#include "non-ascii.h"
#include "inet_pton.h"
+#include "getinfo.h"
/* And now for the protocols */
#include "ftp.h"
@@ -646,6 +647,8 @@ CURLcode Curl_open(struct Curl_easy **curl)
Curl_convert_init(data);
+ Curl_initinfo(data);
+
/* most recent connection is not yet defined */
data->state.lastconnect = NULL;
diff --git a/lib/urldata.h b/lib/urldata.h
index 7c7bf1ba0..938462605 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -1105,7 +1105,7 @@ struct connectdata {
/*
* Struct to keep statistical and informational data.
- * All variables in this struct must be reset in Curl_initinfo().
+ * All variables in this struct must be initialized/reset in Curl_initinfo().
*/
struct PureInfo {
int httpcode; /* Recent HTTP, FTP, RTSP or SMTP response code */