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
22cb0efd
Commit
22cb0efd
authored
Mar 03, 2016
by
Alexander Alashkin
Committed by
Marko Mikulicic
Mar 04, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement FW upload via POST
PUBLISHED_FROM=6167cc57df932f6c113d03096eba0af0b456c3c3
parent
a68d3d63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
mongoose.c
mongoose.c
+13
-11
No files found.
mongoose.c
View file @
22cb0efd
...
...
@@ -4961,7 +4961,7 @@ static void mg_call_endpoint_handler(struct mg_connection *nc, int ev,
#ifdef MG_ENABLE_HTTP_STREAMING_MULTIPART
static
void
mg_multipart_continue
(
struct
mg_connection
*
nc
,
struct
mbuf
*
io
,
int
req_len
,
int
ev
,
void
*
ev_data
);
int
ev
,
void
*
ev_data
);
static
void
mg_multipart_begin
(
struct
mg_connection
*
nc
,
struct
http_message
*
hm
,
struct
mbuf
*
io
,
...
...
@@ -5020,6 +5020,14 @@ void http_handler(struct mg_connection *nc, int ev, void *ev_data) {
if
(
ev
==
MG_EV_RECV
)
{
struct
mg_str
*
s
;
#ifdef MG_ENABLE_HTTP_STREAMING_MULTIPART
if
(
nc
->
strm_state
.
len
!=
0
)
{
mg_multipart_continue
(
nc
,
io
,
ev
,
ev_data
);
return
;
}
#endif
/* MG_ENABLE_HTTP_STREAMING_MULTIPART */
req_len
=
mg_parse_http
(
io
->
buf
,
io
->
len
,
hm
,
is_req
);
if
(
req_len
>
0
&&
...
...
@@ -5028,11 +5036,8 @@ void http_handler(struct mg_connection *nc, int ev, void *ev_data) {
mg_handle_chunked
(
nc
,
hm
,
io
->
buf
+
req_len
,
io
->
len
-
req_len
);
}
if
(
#ifdef MG_ENABLE_HTTP_STREAMING_MULTIPART
nc
->
strm_state
.
len
==
0
&&
#endif
/* MG_ENABLE_HTTP_STREAMING_MULTIPART */
(
req_len
<
0
||
/* TODO(alashkin): refactor this ifelseifelseifelseifelse */
if
((
req_len
<
0
||
(
req_len
==
0
&&
io
->
len
>=
MG_MAX_HTTP_REQUEST_SIZE
)))
{
DBG
((
"invalid request"
));
nc
->
flags
|=
MG_F_CLOSE_IMMEDIATELY
;
...
...
@@ -5066,10 +5071,6 @@ void http_handler(struct mg_connection *nc, int ev, void *ev_data) {
websocket_handler
(
nc
,
MG_EV_RECV
,
ev_data
);
}
#endif
/* MG_DISABLE_HTTP_WEBSOCKET */
#ifdef MG_ENABLE_HTTP_STREAMING_MULTIPART
}
else
if
(
nc
->
strm_state
.
len
!=
0
)
{
mg_multipart_continue
(
nc
,
io
,
req_len
,
ev
,
ev_data
);
#endif
/* MG_ENABLE_HTTP_STREAMING_MULTIPART */
}
else
if
(
hm
->
message
.
len
<=
io
->
len
)
{
int
trigger_ev
=
nc
->
listener
?
MG_EV_HTTP_REQUEST
:
MG_EV_HTTP_REPLY
;
...
...
@@ -5201,12 +5202,13 @@ exit_mp:
}
static
void
mg_multipart_continue
(
struct
mg_connection
*
nc
,
struct
mbuf
*
io
,
int
req_len
,
int
ev
,
void
*
ev_data
)
{
int
ev
,
void
*
ev_data
)
{
/* Continue to stream multipart */
struct
stream_info
si
;
mg_event_handler_t
handler
;
struct
mg_http_multipart_part
mp
;
const
char
*
boundary
;
int
req_len
;
mg_parse_stream_info
(
&
nc
->
strm_state
,
&
si
);
handler
=
get_endpoint_handler
(
nc
->
listener
,
&
si
.
endpoint
);
...
...
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