mirror of
https://github.com/apache/httpd.git
synced 2025-11-17 00:03:29 +03:00
apreq: Sync r1894983 from libapreq.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894986 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -220,17 +220,24 @@ struct mfd_ctx * create_multipart_context(const char *content_type,
|
|||||||
{
|
{
|
||||||
apr_status_t s;
|
apr_status_t s;
|
||||||
apr_size_t blen;
|
apr_size_t blen;
|
||||||
struct mfd_ctx *ctx = apr_palloc(pool, sizeof *ctx);
|
struct mfd_ctx *ctx;
|
||||||
char *ct = apr_pstrdup(pool, content_type);
|
const char *attr;
|
||||||
|
char *buf;
|
||||||
|
|
||||||
ct = strchr(ct, ';');
|
attr = (content_type) ? strchr(content_type, ';') : NULL;
|
||||||
if (ct == NULL)
|
if (!attr)
|
||||||
return NULL; /* missing semicolon */
|
return NULL; /* missing semicolon */
|
||||||
|
|
||||||
*ct++ = 0;
|
ctx = apr_palloc(pool, sizeof *ctx);
|
||||||
s = apreq_header_attribute(ct, "boundary", 8,
|
|
||||||
(const char **)&ctx->bdry, &blen);
|
|
||||||
|
|
||||||
|
attr++;
|
||||||
|
blen = strlen(attr) + 1;
|
||||||
|
buf = apr_palloc(pool, 4 + blen);
|
||||||
|
buf += 4;
|
||||||
|
memcpy(buf, attr, blen);
|
||||||
|
|
||||||
|
s = apreq_header_attribute(buf, "boundary", 8,
|
||||||
|
(const char **)&ctx->bdry, &blen);
|
||||||
if (s != APR_SUCCESS)
|
if (s != APR_SUCCESS)
|
||||||
return NULL; /* missing boundary */
|
return NULL; /* missing boundary */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user