mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-08-31 15:11:08 +00:00
Fix detection of upload boundary.
Sometime a boundary can be splitted and received in two read operations.
This commit is contained in:
@@ -1982,7 +1982,7 @@ recv_form_field (RecvFSM *fsm, gboolean *no_line)
|
||||
free (line);
|
||||
} else {
|
||||
size_t size = evbuffer_get_length (fsm->line);
|
||||
if (size > 0) {
|
||||
if (size >= strlen(fsm->boundary)) {
|
||||
char *buf = g_new (char, size);
|
||||
evbuffer_remove (fsm->line, buf, size);
|
||||
if (strstr(buf, fsm->boundary) != NULL) {
|
||||
@@ -2043,7 +2043,7 @@ recv_file_data (RecvFSM *fsm, gboolean *no_line)
|
||||
if (!line) {
|
||||
// handle boundary
|
||||
size_t size = evbuffer_get_length (fsm->line);
|
||||
if (size > 0) {
|
||||
if (size >= strlen(fsm->boundary)) {
|
||||
char *buf = g_new (char, size);
|
||||
evbuffer_remove (fsm->line, buf, size);
|
||||
if (strstr(buf, fsm->boundary) != NULL) {
|
||||
|
Reference in New Issue
Block a user