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
58d3abe1
Commit
58d3abe1
authored
Dec 05, 2013
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed iterate_callback()
parent
03e73782
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
core.c
build/src/core.c
+4
-3
No files found.
build/src/core.c
View file @
58d3abe1
...
@@ -1206,13 +1206,12 @@ static void send_continue_if_expected(struct connection *conn) {
...
@@ -1206,13 +1206,12 @@ static void send_continue_if_expected(struct connection *conn) {
static
void
process_request
(
struct
connection
*
conn
)
{
static
void
process_request
(
struct
connection
*
conn
)
{
struct
iobuf
*
io
=
&
conn
->
local_iobuf
;
struct
iobuf
*
io
=
&
conn
->
local_iobuf
;
//DBG(("parse_http_message(%d [%.*s])", io->len, io->len, io->buf));
if
(
conn
->
request_len
==
0
&&
if
(
conn
->
request_len
==
0
&&
(
conn
->
request_len
=
get_request_len
((
unsigned
char
*
)
io
->
buf
,
(
conn
->
request_len
=
get_request_len
((
unsigned
char
*
)
io
->
buf
,
io
->
len
))
>
0
)
{
io
->
len
))
>
0
)
{
// If request is buffered in, remove it from the iobuf. This is because
// If request is buffered in, remove it from the iobuf. This is because
// iobuf could be reallocated, and pointers in parsed request could
// iobuf could be reallocated, and pointers in parsed request could
// become ivalid.
// become i
n
valid.
conn
->
request
=
(
char
*
)
malloc
(
conn
->
request_len
);
conn
->
request
=
(
char
*
)
malloc
(
conn
->
request_len
);
memcpy
(
conn
->
request
,
io
->
buf
,
conn
->
request_len
);
memcpy
(
conn
->
request
,
io
->
buf
,
conn
->
request_len
);
memmove
(
io
->
buf
,
io
->
buf
+
conn
->
request_len
,
io
->
len
-
conn
->
request_len
);
memmove
(
io
->
buf
,
io
->
buf
+
conn
->
request_len
,
io
->
len
-
conn
->
request_len
);
...
@@ -1477,7 +1476,9 @@ struct mg_server *mg_create_server(void *server_data) {
...
@@ -1477,7 +1476,9 @@ struct mg_server *mg_create_server(void *server_data) {
static
void
iterate_callback
(
struct
mg_connection
*
c
,
void
*
param
)
{
static
void
iterate_callback
(
struct
mg_connection
*
c
,
void
*
param
)
{
if
(
c
->
connection_param
!=
NULL
)
{
if
(
c
->
connection_param
!=
NULL
)
{
mg_write
(
c
,
"%d"
,
*
(
int
*
)
param
);
char
buf
[
20
];
int
len
=
snprintf
(
buf
,
sizeof
(
buf
),
"%d"
,
*
(
int
*
)
param
);
mg_write
(
c
,
buf
,
len
);
}
}
}
}
...
...
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