projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f6be8c8
)
Don't close 0-filedescriptors on session killing, its our indicator for not here...
author
Wilfried Goesgens
<dothebart@citadel.org>
Tue, 10 May 2011 22:03:20 +0000
(22:03 +0000)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Tue, 10 May 2011 22:15:21 +0000
(22:15 +0000)
citadel/context.c
patch
|
blob
|
history
diff --git
a/citadel/context.c
b/citadel/context.c
index e6707e679f2ab83185c83dad9158470690c4cd82..c2d739924fd40940d42928033f79bbdf02f618a8 100644
(file)
--- a/
citadel/context.c
+++ b/
citadel/context.c
@@
-331,9
+331,15
@@
void RemoveContext (CitContext *con)
CtdlLogPrintf(CTDL_NOTICE, "[%3d] Session ended.\n", con->cs_pid);
CtdlLogPrintf(CTDL_NOTICE, "[%3d] Session ended.\n", con->cs_pid);
- /* If the client is still connected, blow 'em away. */
+ /*
+ * If the client is still connected, blow 'em away.
+ * if the socket is 0, its already gone or was never there.
+ */
CtdlLogPrintf(CTDL_DEBUG, "Closing socket %d\n", con->client_socket);
CtdlLogPrintf(CTDL_DEBUG, "Closing socket %d\n", con->client_socket);
- close(con->client_socket);
+ if (con->client_socket != 0)
+ {
+ close(con->client_socket);
+ }
/* If using AUTHMODE_LDAP, free the DN */
if (con->ldap_dn) {
/* If using AUTHMODE_LDAP, free the DN */
if (con->ldap_dn) {