summaryrefslogtreecommitdiff
path: root/lib/mime.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-03-02 07:42:55 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-03-02 08:07:49 +0100
commit8cd4e6d81fbf2b179f996146b3b111694fd8716e (patch)
tree74ae49f0012b9dfa7d64aa60204fc00d91ebf791 /lib/mime.c
parentd7242f4757de67f02b13fac850c3472598f999ca (diff)
downloadcurl-8cd4e6d81fbf2b179f996146b3b111694fd8716e.tar.gz
Revert "mime: latch last read callback status."
This reverts commit 87869e38d7afdec3ef1bb4965711458b088e254f. Fixes #5014 Closes #5015 Reopens #4833
Diffstat (limited to 'lib/mime.c')
-rw-r--r--lib/mime.c41
1 files changed, 4 insertions, 37 deletions
diff --git a/lib/mime.c b/lib/mime.c
index 5f928a171..081e51e50 100644
--- a/lib/mime.c
+++ b/lib/mime.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -740,19 +740,9 @@ static size_t read_part_content(curl_mimepart *part,
{
size_t sz = 0;
- switch(part->lastreadstatus) {
- case 0:
- case CURL_READFUNC_ABORT:
- case CURL_READFUNC_PAUSE:
- case READ_ERROR:
- break;
- default:
- if(part->readfunc)
- sz = part->readfunc(buffer, 1, bufsize, part->arg);
- part->lastreadstatus = sz;
- break;
- }
- return part->lastreadstatus;
+ if(part->readfunc)
+ sz = part->readfunc(buffer, 1, bufsize, part->arg);
+ return sz;
}
/* Read and encode part content. */
@@ -1041,7 +1031,6 @@ static int mime_part_rewind(curl_mimepart *part)
if(res == CURL_SEEKFUNC_OK)
mimesetstate(&part->state, targetstate, NULL);
- part->lastreadstatus = 1; /* Successful read status. */
return res;
}
@@ -1084,7 +1073,6 @@ static void cleanup_part_content(curl_mimepart *part)
part->datasize = (curl_off_t) 0; /* No size yet. */
cleanup_encoder_state(&part->encstate);
part->kind = MIMEKIND_NONE;
- part->lastreadstatus = 1; /* Successful read status. */
}
static void mime_subparts_free(void *ptr)
@@ -1250,7 +1238,6 @@ void Curl_mime_initpart(curl_mimepart *part, struct Curl_easy *easy)
{
memset((char *) part, 0, sizeof(*part));
part->easy = easy;
- part->lastreadstatus = 1; /* Successful read status. */
mimesetstate(&part->state, MIMESTATE_BEGIN, NULL);
}
@@ -1818,26 +1805,6 @@ CURLcode Curl_mime_prepare_headers(curl_mimepart *part,
return ret;
}
-/* Recursively reset paused status in the given part. */
-void Curl_mime_unpause(curl_mimepart *part)
-{
- if(part) {
- if(part->lastreadstatus == CURL_READFUNC_PAUSE)
- part->lastreadstatus = 1; /* Successful read status. */
- if(part->kind == MIMEKIND_MULTIPART) {
- curl_mime *mime = (curl_mime *) part->arg;
-
- if(mime) {
- curl_mimepart *subpart;
-
- for(subpart = mime->firstpart; subpart; subpart = subpart->nextpart)
- Curl_mime_unpause(subpart);
- }
- }
- }
-}
-
-
#else /* !CURL_DISABLE_HTTP || !CURL_DISABLE_SMTP || !CURL_DISABLE_IMAP */
/* Mime not compiled in: define stubs for externally-referenced functions. */