diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-02-12 14:30:25 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-02-12 14:30:25 +0100 |
commit | cd4ce4e3e5db04f5a66289dabf3ac1a9353299ef (patch) | |
tree | 0ff29db6268e65a7da3fbc388443adfe4a5adeac /lib/mime.h | |
parent | aabc7ae5ecf70973add429b5acbc86d6a57e4da5 (diff) | |
download | curl-bagder/mime-reducemalloc.tar.gz |
mime: put the boundary buffer into the curl_mime structbagder/mime-reducemalloc
... instead of allocating it separately and point to it. It is
fixed-size and always used for each part.
Diffstat (limited to 'lib/mime.h')
-rw-r--r-- | lib/mime.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/mime.h b/lib/mime.h index 4d5c70404..ea34a75a6 100644 --- a/lib/mime.h +++ b/lib/mime.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2018, 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 @@ -88,13 +88,16 @@ typedef struct { size_t offset; /* State-dependent offset. */ } mime_state; +/* mimimum buffer size for the boundary string */ +#define MIME_BOUNDARY_LEN (24 + MIME_RAND_BOUNDARY_CHARS + 1) + /* A mime multipart. */ struct curl_mime_s { struct Curl_easy *easy; /* The associated easy handle. */ curl_mimepart *parent; /* Parent part. */ curl_mimepart *firstpart; /* First part. */ curl_mimepart *lastpart; /* Last part. */ - char *boundary; /* The part boundary. */ + char boundary[MIME_BOUNDARY_LEN]; /* The part boundary. */ mime_state state; /* Current readback state. */ }; |