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 4b3fed45722f43c1ec901251205a3628eaa094b4 (commit)
from 2fd9b09d6dd874ee1dc222260753b9648acfe043 (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 4b3fed45722f43c1ec901251205a3628eaa094b4
Author: Dave Heller <hel...@us...>
Date: Mon Nov 4 00:54:03 2013 -0500
[sfcb-tix:#76] Label Req Handlers too
-----------------------------------------------------------------------
Summary of changes:
httpAdapter.c | 10 ++++++++++
sfcbproc.c | 15 ++++++++++++++-
2 files changed, 24 insertions(+), 1 deletions(-)
diff --git a/httpAdapter.c b/httpAdapter.c
index 1c6003c..b3ef7d8 100644
--- a/httpAdapter.c
+++ b/httpAdapter.c
@@ -1475,6 +1475,16 @@ handleHttpRequest(int connFd, int __attribute__ ((unused)) sslMode)
atexit(releaseAuthHandle);
atexit(uninitGarbageCollector);
atexit(sunsetControl);
+
+ /* Label the process by modifying the cmdline */
+ extern void append2Argv(char *appendstr);
+ extern unsigned int labelProcs;
+ if (labelProcs) {
+ append2Argv(" -reqhandler: ");
+ char handlerId[8];
+ sprintf(handlerId, "%d", httpProcIdX + 1);
+ append2Argv(handlerId);
+ }
}
/*
* parent's thread of execution
diff --git a/sfcbproc.c b/sfcbproc.c
index a332462..dfcde72 100644
--- a/sfcbproc.c
+++ b/sfcbproc.c
@@ -336,8 +336,21 @@ static int getProcStat(int pid, ProcStat *p) {
}
int pass = 0;
*p->cmd = '\0';
+ /*
+ * Note getdelim() will normally return 0 if there is no data to be read
+ * other than a delim char. But when the delim char is NULL, getdelim()
+ * will always return at least one. Therefore, read=1 => no more data.
+ */
while ((read = getdelim(&line, &len, 0, fp)) != -1) {
- if (strlen(p->cmd) + strlen(line) > MAX_CMD_SZ-2) {
+ if ((read <= 1) || strlen(p->cmd) + (read-1) > MAX_CMD_SZ-2) {
+ /*
+ * Breaking when no data has been read is akin to breaking on the first
+ * occurrence of a double-null. The intent is to clean up --raw output
+ * by discarding the trailing nulls in argv when labelProcs is in effect
+ * [sfcb-tix:#76]. If for some strange reason there is an occurrence of
+ * a double-null somewhere in argv and there is additional data beyond
+ * that, this would hide the additional data.
+ */
break;
}
else {
hooks/post-receive
--
sfcb - Small Footprint CIM Broker
|