Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
322ed3cc
Commit
322ed3cc
authored
Jan 21, 2013
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fflush()-ing uploaded file before calling MG_UPLOAD callback
parent
6d4d53c2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
mongoose.c
mongoose.c
+2
-1
No files found.
mongoose.c
View file @
322ed3cc
...
@@ -4191,7 +4191,8 @@ int mg_upload(struct mg_connection *conn, const char *destination_dir) {
...
@@ -4191,7 +4191,8 @@ int mg_upload(struct mg_connection *conn, const char *destination_dir) {
if
(
!
memcmp
(
&
buf
[
i
],
"
\r\n
--"
,
4
)
&&
if
(
!
memcmp
(
&
buf
[
i
],
"
\r\n
--"
,
4
)
&&
!
memcmp
(
&
buf
[
i
+
4
],
boundary
,
boundary_len
))
{
!
memcmp
(
&
buf
[
i
+
4
],
boundary
,
boundary_len
))
{
// Found boundary, that's the end of file data.
// Found boundary, that's the end of file data.
(
void
)
fwrite
(
buf
,
1
,
i
,
fp
);
fwrite
(
buf
,
1
,
i
,
fp
);
fflush
(
fp
);
num_uploaded_files
++
;
num_uploaded_files
++
;
conn
->
request_info
.
ev_data
=
(
void
*
)
path
;
conn
->
request_info
.
ev_data
=
(
void
*
)
path
;
call_user
(
conn
,
MG_UPLOAD
);
call_user
(
conn
,
MG_UPLOAD
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment