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
2485a8f8
Commit
2485a8f8
authored
8 years ago
by
Alexander Alashkin
Committed by
Cesanta Bot
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix signs comparison. Close cesanta/mongoose#774
PUBLISHED_FROM=a875606de6f4b2c202b25ce20efcb1ca33eb75b8
parent
1ae908f6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
mongoose.c
mongoose.c
+3
-3
No files found.
mongoose.c
View file @
2485a8f8
...
@@ -3559,7 +3559,7 @@ void mg_socket_if_remove_conn(struct mg_connection *nc) {
...
@@ -3559,7 +3559,7 @@ void mg_socket_if_remove_conn(struct mg_connection *nc) {
void
mg_add_to_set
(
sock_t
sock
,
fd_set
*
set
,
sock_t
*
max_fd
)
{
void
mg_add_to_set
(
sock_t
sock
,
fd_set
*
set
,
sock_t
*
max_fd
)
{
if
(
sock
!=
INVALID_SOCKET
if
(
sock
!=
INVALID_SOCKET
#ifdef __unix__
#ifdef __unix__
&&
sock
<
FD_SETSIZE
&&
sock
<
(
sock_t
)
FD_SETSIZE
#endif
#endif
)
{
)
{
FD_SET
(
sock
,
set
);
FD_SET
(
sock
,
set
);
...
@@ -3602,9 +3602,9 @@ time_t mg_socket_if_poll(struct mg_iface *iface, int timeout_ms) {
...
@@ -3602,9 +3602,9 @@ time_t mg_socket_if_poll(struct mg_iface *iface, int timeout_ms) {
#ifdef __unix__
#ifdef __unix__
/* A hack to make sure all our file descriptos fit into FD_SETSIZE. */
/* A hack to make sure all our file descriptos fit into FD_SETSIZE. */
if
(
nc
->
sock
>=
FD_SETSIZE
&&
try_dup
)
{
if
(
nc
->
sock
>=
(
sock_t
)
FD_SETSIZE
&&
try_dup
)
{
int
new_sock
=
dup
(
nc
->
sock
);
int
new_sock
=
dup
(
nc
->
sock
);
if
(
new_sock
>=
0
&&
new_sock
<
FD_SETSIZE
)
{
if
(
new_sock
>=
0
&&
new_sock
<
(
sock_t
)
FD_SETSIZE
)
{
closesocket
(
nc
->
sock
);
closesocket
(
nc
->
sock
);
DBG
((
"new sock %d -> %d"
,
nc
->
sock
,
new_sock
));
DBG
((
"new sock %d -> %d"
,
nc
->
sock
,
new_sock
));
nc
->
sock
=
new_sock
;
nc
->
sock
=
new_sock
;
...
...
This diff is collapsed.
Click to expand it.
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