|
From: Narasimha S. <nsh...@us...> - 2012-04-13 16:49:05
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SFCB - Small Footprint CIM Broker".
The branch, master has been updated
via 208c2c055317d633843041e023904a5de383f9be (commit)
from e75d7ec2dc8927f5bbf937d1e543f220c401ef09 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 208c2c055317d633843041e023904a5de383f9be
Author: Narasimha Sharoff <nsh...@us...>
Date: Fri Apr 13 09:47:33 2012 -0700
[ 3516184 ] commClose close socket when file hndl is null
Signed-off-by: Narasimha Sharoff <nsh...@us...>
-----------------------------------------------------------------------
Summary of changes:
diff --git a/ChangeLog b/ChangeLog
index a16b4d7..ec61cb2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-04-13 Narasimha Sharoff <nsh...@us...>
+
+ * httpAdapter.c, httpComm.c:
+ [ 3516184 ] commClose close socket when file hndl is null
+
2012-04-10 Michael Chase-Salerno <br...@li...>
* ABTScript:
diff --git a/NEWS b/NEWS
index 2bb04e4..a544450 100644
--- a/NEWS
+++ b/NEWS
@@ -93,6 +93,7 @@ Changes in 1.3.15
Bugs Fixed:
- 3514627 unsupported sfcb.cfg param - use exit call
+- 3516184 commClose close socket when file hndl is null
Changes in 1.3.14
diff --git a/httpAdapter.c b/httpAdapter.c
index d0ca581..188502d 100644
--- a/httpAdapter.c
+++ b/httpAdapter.c
@@ -655,6 +655,7 @@ writeChunkResponse(BinRequestContext * ctx, BinResponseHdr * rh)
RespSegments rs;
rs = genFirstChunkErrorResponse(ctx, rh->rc - 1, NULL);
writeResponse(*ctx->commHndl, rs);
+ commFlush(*(ctx->commHndl));
_SFCB_EXIT();
}
writeChunkHeaders(ctx);
@@ -1300,6 +1301,7 @@ handleHttpRequest(int connFd, int sslMode)
if (r < 0) {
char *emsg = strerror(errno);
mlogf(M_ERROR, M_SHOW, "--- fork handler: %s\n", emsg);
+ close(connFd);
exit(1);
}
diff --git a/httpComm.c b/httpComm.c
index 3bdb568..64b060e 100644
--- a/httpComm.c
+++ b/httpComm.c
@@ -152,6 +152,7 @@ commClose(CommHndl hndl)
{
_SFCB_ENTER(TRACE_HTTPDAEMON, "commClose");
+ if (hndl.socket == -1) return; /* socket was closed already */
#if defined USE_SSL
if (hndl.ssl) {
if ((SSL_get_shutdown(hndl.ssl) & SSL_RECEIVED_SHUTDOWN))
@@ -159,16 +160,16 @@ commClose(CommHndl hndl)
else
SSL_clear(hndl.ssl);
SSL_free(hndl.ssl);
- } else
+ }
#endif
- if (hndl.file == NULL) {
- close(hndl.socket);
- } else {
+ if (hndl.file != NULL) {
fclose(hndl.file);
if (hndl.buf) {
free(hndl.buf);
}
}
+ close(hndl.socket);
+ hndl.socket = -1;
_SFCB_EXIT();
}
/* MODELINES */
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|