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
976f2861
Commit
976f2861
authored
Jan 20, 2014
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made mg_connection::content_len int -> size_t, which is 64-bit on 64-bit systems
parent
503a1a74
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
mongoose.c
mongoose.c
+2
-2
mongoose.h
mongoose.h
+1
-1
unit_test.c
unit_test.c
+2
-2
No files found.
mongoose.c
View file @
976f2861
...
...
@@ -2229,7 +2229,7 @@ static void call_uri_handler_if_data_is_buffered(struct connection *conn) {
do
{
}
while
(
deliver_websocket_frame
(
conn
));
}
else
#endif
if
(
loc
->
len
>=
c
->
content_len
)
{
if
(
(
size_t
)
loc
->
len
>=
c
->
content_len
)
{
call_uri_handler
(
conn
);
}
}
...
...
@@ -3329,7 +3329,7 @@ static void handle_lsp_request(struct connection *conn, const char *path,
prepare_lua_environment
(
&
conn
->
mg_conn
,
L
);
lua_pushcclosure
(
L
,
&
lua_error_handler
,
0
);
lua_pushglobaltable
(
L
);
lsp
(
conn
,
p
,
st
->
st_size
,
L
);
lsp
(
conn
,
p
,
(
int
)
st
->
st_size
,
L
);
close_local_endpoint
(
conn
);
}
...
...
mongoose.h
View file @
976f2861
...
...
@@ -46,7 +46,7 @@ struct mg_connection {
}
http_headers
[
30
];
char
*
content
;
// POST (or websocket message) data, or NULL
long
in
t
content_len
;
// content length
size_
t
content_len
;
// content length
int
is_websocket
;
// Connection is a websocket connection
int
status_code
;
// HTTP status code for HTTP error handler
...
...
unit_test.c
View file @
976f2861
...
...
@@ -440,7 +440,7 @@ static int cb2(struct mg_connection *conn) {
file_name
=
file1
;
}
if
((
file_data
=
read_file
(
file_name
,
&
file_len
))
!=
NULL
)
{
if
(
file_len
==
conn
->
content_len
&&
if
(
(
size_t
)
file_len
==
conn
->
content_len
&&
memcmp
(
file_data
,
conn
->
content
,
file_len
)
==
0
)
{
strcat
(
buf
,
"d"
);
}
else
{
...
...
@@ -526,7 +526,7 @@ static int us1(struct mg_connection *conn) {
}
else
if
(
conn
->
status_code
==
MG_DOWNLOAD_SUCCESS
)
{
char
*
file_data
=
read_file
(
file_name
,
&
file_size
);
sprintf
((
char
*
)
conn
->
connection_param
,
"%d"
,
file_size
==
conn
->
content_len
&&
(
size_t
)
file_size
==
conn
->
content_len
&&
memcmp
(
file_data
,
conn
->
content
,
file_size
)
==
0
?
1
:
0
);
free
(
file_data
);
}
else
if
(
conn
->
status_code
==
MG_CONNECT_FAILURE
)
{
...
...
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