forked from mirrors/treebird
WIP read_mime_data
FossilOrigin-Name: 96027a35fddcf99ed6f9ec4249178aa15a5325b2a1c7be94e5a44769b0d146d9
This commit is contained in:
parent
9d3607a6eb
commit
ac0fca508e
1 changed files with 16 additions and 0 deletions
16
src/mime.c
16
src/mime.c
|
@ -59,3 +59,19 @@ error:
|
|||
free(content_type);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* TODO Write a function like strchr but it checks a non-whitespace character */
|
||||
|
||||
char* read_mime_data(char* boundary, char* begin, struct http_mime_info* info)
|
||||
{
|
||||
char* begin_header;
|
||||
size_t bound_len = strlen(boundary);
|
||||
if (strncmp(begin, "--", 2) != 0 ||
|
||||
strncmp(begin+2, boundary, bound_len) != 0)
|
||||
return NULL;
|
||||
|
||||
begin_header = begin + 2 + bound+len + 2; /* Skip over LRSF */
|
||||
|
||||
if (strncmp(begin_header, "content-disposition", sizeof("content-disposition")) != 0)
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue