From 8b55be9f989f88aa0f464ec1c5f7dbef70310055 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Thu, 14 Jul 2022 19:35:18 -0600 Subject: * Improvements in the http code in processing http headers. --- imap/src/c-client/http.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'imap/src/c-client/http.c') diff --git a/imap/src/c-client/http.c b/imap/src/c-client/http.c index bb0f34d4..d291c975 100644 --- a/imap/src/c-client/http.c +++ b/imap/src/c-client/http.c @@ -1124,10 +1124,12 @@ http_reply (HTTPSTREAM *stream) if(stream->header->content_length){ size = atol(stream->header->content_length->p->vp->value); if (stream->response) fs_give ((void **) &stream->response); - stream->response = (unsigned char *) net_getsize (stream->netstream, size); - if(stream->response){ - buffer_add(&stream->reply, stream->response); - if(stream->debug) mm_log(stream->response, HTTPDEBUG); + if(size > 0L){ + stream->response = (unsigned char *) net_getsize (stream->netstream, size); + if(stream->response){ + buffer_add(&stream->reply, stream->response); + if(stream->debug) mm_log(stream->response, HTTPDEBUG); + } } } else if (stream->header->transfer_encoding){ -- cgit v1.2.3-70-g09d2