summaryrefslogtreecommitdiffstats
path: root/runtime/nsd_gtls.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-12-04 12:11:58 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2008-12-04 12:11:58 +0100
commit2dd15ac57327603307c0ae2f5f96fd1392d6f897 (patch)
treeed15becd6ebc0d6ce3e5ee5d38d7dc211ce5785e /runtime/nsd_gtls.c
parent56f338f1b4f5f6c428f7aa3fa3f82a13e63e49e7 (diff)
parentd74b4fef35e8a2c3a58fe66720840ae2ee77a02d (diff)
downloadrsyslog-2dd15ac57327603307c0ae2f5f96fd1392d6f897.tar.gz
rsyslog-2dd15ac57327603307c0ae2f5f96fd1392d6f897.tar.xz
rsyslog-2dd15ac57327603307c0ae2f5f96fd1392d6f897.zip
Merge branch 'v3-stable' into beta
Conflicts: ChangeLog configure.ac doc/manual.html
Diffstat (limited to 'runtime/nsd_gtls.c')
-rw-r--r--runtime/nsd_gtls.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/runtime/nsd_gtls.c b/runtime/nsd_gtls.c
index 08623da8..3a79a015 100644
--- a/runtime/nsd_gtls.c
+++ b/runtime/nsd_gtls.c
@@ -1229,7 +1229,6 @@ SetAuthMode(nsd_t *pNsd, uchar *mode)
/* TODO: clear stored IDs! */
finalize_it:
-dbgprintf("gtls auth mode %d set\n", pThis->authMode);
RETiRet;
}
@@ -1342,6 +1341,20 @@ GetRemoteHName(nsd_t *pNsd, uchar **ppszHName)
}
+/* Provide access to the sockaddr_storage of the remote peer. This
+ * is needed by the legacy ACL system. --- gerhards, 2008-12-01
+ */
+static rsRetVal
+GetRemAddr(nsd_t *pNsd, struct sockaddr_storage **ppAddr)
+{
+ DEFiRet;
+ nsd_gtls_t *pThis = (nsd_gtls_t*) pNsd;
+ ISOBJ_TYPE_assert(pThis, nsd_gtls);
+ iRet = nsd_ptcp.GetRemAddr(pThis->pTcp, ppAddr);
+ RETiRet;
+}
+
+
/* get the remote host's IP address. The returned string must be freed by the
* caller. -- rgerhards, 2008-04-25
*/
@@ -1477,6 +1490,13 @@ Rcv(nsd_t *pNsd, uchar *pBuf, ssize_t *pLenBuf)
if(pThis->lenRcvBuf == 0) { /* EOS */
*pLenBuf = 0;
+ /* in this case, we also need to free the receive buffer, if we
+ * allocated one. -- rgerhards, 2008-12-03
+ */
+ if(pThis->pszRcvBuf != NULL) {
+ free(pThis->pszRcvBuf);
+ pThis->pszRcvBuf = NULL;
+ }
ABORT_FINALIZE(RS_RET_CLOSED);
}
@@ -1646,6 +1666,7 @@ CODESTARTobjQueryInterface(nsd_gtls)
pIf->CheckConnection = CheckConnection;
pIf->GetRemoteHName = GetRemoteHName;
pIf->GetRemoteIP = GetRemoteIP;
+ pIf->GetRemAddr = GetRemAddr;
finalize_it:
ENDobjQueryInterface(nsd_gtls)