summaryrefslogtreecommitdiffstats
path: root/rfc3195d.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2005-10-18 16:10:18 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2005-10-18 16:10:18 +0000
commit2c7187de39b1e731057b47752e3989a954acffb8 (patch)
treea4e4b208f5e5fb590dc970b0ec0e00885e728711 /rfc3195d.c
parentbb0d1da6daeede6fc1236bff37814353ef5480ee (diff)
downloadrsyslog-2c7187de39b1e731057b47752e3989a954acffb8.tar.gz
rsyslog-2c7187de39b1e731057b47752e3989a954acffb8.tar.xz
rsyslog-2c7187de39b1e731057b47752e3989a954acffb8.zip
begin implementing BSD-style program blocks
Diffstat (limited to 'rfc3195d.c')
-rw-r--r--rfc3195d.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/rfc3195d.c b/rfc3195d.c
index aa5da7b5..25662047 100644
--- a/rfc3195d.c
+++ b/rfc3195d.c
@@ -51,7 +51,7 @@ static char* pPathLogname = "/dev/log3195";
static char *PidFile;
static int NoFork = 0;
static int Debug = 0;
-static int listenPort = 0;
+static int listenPort = 601;
/* we use a global API object below, because this listener is
* not very complex. As such, this hack should not harm anything.
@@ -167,8 +167,13 @@ void OnReceive(srAPIObj* pAPI, srSLMGObj* pSLMG)
}
}
- if(Debug)
- printf("Msg:%s\n\n", pszRawMsg);
+ if(Debug) {
+ static int largest = 0;
+ int sz = strlen(pszRawMsg);
+ if(sz > largest)
+ largest = sz;
+ printf("Msg(%d/%d):%s\n\n", largest, sz, pszRawMsg);
+ }
}
@@ -183,6 +188,8 @@ void doShutdown(int i)
srAPIShutdownListener(pAPI);
}
+
+/* on the the real program ;) */
int main(int argc, char* argv[])
{
srRetVal iRet;
@@ -235,7 +242,6 @@ int main(int argc, char* argv[])
exit(1);
}
-printf("Setting listen port %d\n", listenPort);
if((iRet = srAPISetOption(pAPI, srOPTION_BEEP_LISTENPORT, listenPort)) != SR_RET_OK)
{
printf("Error %d setting listen port - aborting\n", iRet);