Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
2dab5015
Commit
2dab5015
authored
Mar 22, 2020
by
Yossi Gottlieb
Browse files
Fix crashes related to failed/rejected accepts.
parent
4c08ae3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/networking.c
View file @
2dab5015
...
@@ -786,7 +786,7 @@ void clientAcceptHandler(connection *conn) {
...
@@ -786,7 +786,7 @@ void clientAcceptHandler(connection *conn) {
serverLog
(
LL_WARNING
,
serverLog
(
LL_WARNING
,
"Error accepting a client connection: %s"
,
"Error accepting a client connection: %s"
,
connGetLastError
(
conn
));
connGetLastError
(
conn
));
freeClient
(
c
);
freeClient
Async
(
c
);
return
;
return
;
}
}
...
@@ -828,7 +828,7 @@ void clientAcceptHandler(connection *conn) {
...
@@ -828,7 +828,7 @@ void clientAcceptHandler(connection *conn) {
/* Nothing to do, Just to avoid the warning... */
/* Nothing to do, Just to avoid the warning... */
}
}
server
.
stat_rejected_conn
++
;
server
.
stat_rejected_conn
++
;
freeClient
(
c
);
freeClient
Async
(
c
);
return
;
return
;
}
}
}
}
...
@@ -887,9 +887,10 @@ static void acceptCommonHandler(connection *conn, int flags, char *ip) {
...
@@ -887,9 +887,10 @@ static void acceptCommonHandler(connection *conn, int flags, char *ip) {
*/
*/
if
(
connAccept
(
conn
,
clientAcceptHandler
)
==
C_ERR
)
{
if
(
connAccept
(
conn
,
clientAcceptHandler
)
==
C_ERR
)
{
char
conninfo
[
100
];
char
conninfo
[
100
];
serverLog
(
LL_WARNING
,
if
(
connGetState
(
conn
)
==
CONN_STATE_ERROR
)
"Error accepting a client connection: %s (conn: %s)"
,
serverLog
(
LL_WARNING
,
connGetLastError
(
conn
),
connGetInfo
(
conn
,
conninfo
,
sizeof
(
conninfo
)));
"Error accepting a client connection: %s (conn: %s)"
,
connGetLastError
(
conn
),
connGetInfo
(
conn
,
conninfo
,
sizeof
(
conninfo
)));
freeClient
(
connGetPrivateData
(
conn
));
freeClient
(
connGetPrivateData
(
conn
));
return
;
return
;
}
}
...
...
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