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
4f01f101
Commit
4f01f101
authored
Sep 16, 2012
by
Igor Okulist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compile on Win32
parent
518b3aa7
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 @
4f01f101
...
@@ -1507,7 +1507,7 @@ int mg_printf(struct mg_connection *conn, const char *fmt, ...) {
...
@@ -1507,7 +1507,7 @@ int mg_printf(struct mg_connection *conn, const char *fmt, ...) {
// vsnprintf() error, give up
// vsnprintf() error, give up
len
=
-
1
;
len
=
-
1
;
cry
(
conn
,
"%s(%s, ...): vsnprintf() error"
,
__func__
,
fmt
);
cry
(
conn
,
"%s(%s, ...): vsnprintf() error"
,
__func__
,
fmt
);
}
else
if
(
len
>
(
int
)
sizeof
(
mem
)
&&
(
buf
=
malloc
(
len
+
1
))
!=
NULL
)
{
}
else
if
(
len
>
(
int
)
sizeof
(
mem
)
&&
(
buf
=
(
char
*
)
malloc
(
len
+
1
))
!=
NULL
)
{
// Local buffer is not large enough, allocate big buffer on heap
// Local buffer is not large enough, allocate big buffer on heap
va_start
(
ap
,
fmt
);
va_start
(
ap
,
fmt
);
vsnprintf
(
buf
,
len
+
1
,
fmt
,
ap
);
vsnprintf
(
buf
,
len
+
1
,
fmt
,
ap
);
...
@@ -3630,7 +3630,7 @@ static int set_ports_option(struct mg_context *ctx) {
...
@@ -3630,7 +3630,7 @@ static int set_ports_option(struct mg_context *ctx) {
// handshake will figure out that the client is down and
// handshake will figure out that the client is down and
// will close the server end.
// will close the server end.
// Thanks to Igor Klopov who suggested the patch.
// Thanks to Igor Klopov who suggested the patch.
setsockopt
(
sock
,
SOL_SOCKET
,
SO_KEEPALIVE
,
(
void
*
)
&
on
,
setsockopt
(
sock
,
SOL_SOCKET
,
SO_KEEPALIVE
,
(
char
*
)
&
on
,
sizeof
(
on
))
!=
0
||
sizeof
(
on
))
!=
0
||
bind
(
sock
,
&
so
.
lsa
.
sa
,
sizeof
(
so
.
lsa
))
!=
0
||
bind
(
sock
,
&
so
.
lsa
.
sa
,
sizeof
(
so
.
lsa
))
!=
0
||
listen
(
sock
,
SOMAXCONN
)
!=
0
)
{
listen
(
sock
,
SOMAXCONN
)
!=
0
)
{
...
@@ -3949,7 +3949,7 @@ static void close_socket_gracefully(struct mg_connection *conn) {
...
@@ -3949,7 +3949,7 @@ static void close_socket_gracefully(struct mg_connection *conn) {
// ephemeral port exhaust problem under high QPS.
// ephemeral port exhaust problem under high QPS.
linger
.
l_onoff
=
1
;
linger
.
l_onoff
=
1
;
linger
.
l_linger
=
1
;
linger
.
l_linger
=
1
;
setsockopt
(
sock
,
SOL_SOCKET
,
SO_LINGER
,
(
void
*
)
&
linger
,
sizeof
(
linger
));
setsockopt
(
sock
,
SOL_SOCKET
,
SO_LINGER
,
(
char
*
)
&
linger
,
sizeof
(
linger
));
// Send FIN to the client
// Send FIN to the client
(
void
)
shutdown
(
sock
,
SHUT_WR
);
(
void
)
shutdown
(
sock
,
SHUT_WR
);
...
...
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