aboutsummaryrefslogtreecommitdiff
path: root/lib/getinfo.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-01-29 10:49:32 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-01-29 10:49:32 +0000
commit76c53c690cefa62e09aa553d0f1f9a26122c0ff1 (patch)
tree70a042934ba4fc6ae6ae1d447a0320b4f1ef9cf6 /lib/getinfo.c
parentc341b11aafedb8beb209342dbfb12f9d70f742b4 (diff)
Giaslas Georgios introduced CURLINFO_CONTENT_TYPE
Diffstat (limited to 'lib/getinfo.c')
-rw-r--r--lib/getinfo.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/getinfo.c b/lib/getinfo.c
index 51ceacbe6..1df9b1743 100644
--- a/lib/getinfo.c
+++ b/lib/getinfo.c
@@ -48,9 +48,13 @@ CURLcode Curl_initinfo(struct SessionHandle *data)
info->httpcode = 0;
info->httpversion=0;
info->filetime=-1; /* -1 is an illegal time and thus means unknown */
+
+ if (info->contenttype)
+ free(info->contenttype);
+ info->contenttype = NULL;
+
info->header_size = 0;
info->request_size = 0;
-
return CURLE_OK;
}
@@ -134,6 +138,9 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
case CURLINFO_CONTENT_LENGTH_UPLOAD:
*param_doublep = data->progress.size_ul;
break;
+ case CURLINFO_CONTENT_TYPE:
+ *param_charp = data->info.contenttype;
+ break;
default:
return CURLE_BAD_FUNCTION_ARGUMENT;
}