From 76c53c690cefa62e09aa553d0f1f9a26122c0ff1 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 29 Jan 2002 10:49:32 +0000 Subject: Giaslas Georgios introduced CURLINFO_CONTENT_TYPE --- lib/getinfo.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/getinfo.c') 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; } -- cgit v1.2.3