1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-25 14:42:52 +00:00

fix get form field (#480)

This commit is contained in:
Xiangyue Cai
2021-07-28 15:56:09 +08:00
committed by GitHub
parent 537226aca7
commit 8f7b838720

View File

@@ -1983,11 +1983,13 @@ recv_form_field (RecvFSM *fsm, gboolean *no_line)
} else {
size_t size = evbuffer_get_length (fsm->line);
if (size >= strlen(fsm->boundary) + 4) {
char *buf = g_new (char, size);
evbuffer_remove (fsm->line, buf, size);
if (strstr(buf, fsm->boundary) != NULL) {
struct evbuffer_ptr search_boundary = evbuffer_search (fsm->line,
fsm->boundary,
strlen(fsm->boundary),
NULL);
if (search_boundary.pos != -1) {
seaf_debug ("[upload] form field ends.\n");
evbuffer_drain (fsm->line, size);
g_free (fsm->input_name);
fsm->input_name = NULL;
fsm->state = RECV_HEADERS;