diff options
Diffstat (limited to 'lib/getinfo.c')
-rw-r--r-- | lib/getinfo.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/getinfo.c b/lib/getinfo.c index bc387c960..4aa813797 100644 --- a/lib/getinfo.c +++ b/lib/getinfo.c @@ -35,6 +35,7 @@ #include "memory.h" #include "sslgen.h" #include "connect.h" /* Curl_getconnectinfo() */ +#include "progress.h" /* Make this the last #include */ #include "memdebug.h" @@ -167,10 +168,12 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...) *param_longp = data->set.ssl.certverifyresult; break; case CURLINFO_CONTENT_LENGTH_DOWNLOAD: - *param_doublep = (double)data->progress.size_dl; + *param_doublep = (data->progress.flags & PGRS_DL_SIZE_KNOWN)? + (double)data->progress.size_dl:-1; break; case CURLINFO_CONTENT_LENGTH_UPLOAD: - *param_doublep = (double)data->progress.size_ul; + *param_doublep = (data->progress.flags & PGRS_UL_SIZE_KNOWN)? + (double)data->progress.size_ul:-1; break; case CURLINFO_REDIRECT_TIME: *param_doublep = data->progress.t_redirect; |