summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-06-23 10:29:15 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-06-23 10:29:15 +0200
commit7b1a570d54ac4c82325aeeee70d7a8871ecd688a (patch)
tree68b2ab1fc7f85f7eca8d9d0d8270074c6cfb6bce /runtime
parent716ab25446cd45ec8117264e51b5018f9a813d4e (diff)
downloadrsyslog-7b1a570d54ac4c82325aeeee70d7a8871ecd688a.tar.gz
rsyslog-7b1a570d54ac4c82325aeeee70d7a8871ecd688a.tar.xz
rsyslog-7b1a570d54ac4c82325aeeee70d7a8871ecd688a.zip
changed Rcv-Interface in tcpsrv subsystem
It is now iRet based. This enables us to communicate more in-depth information to the upper peers. This is needed to handle the EGAIN case on rcv (not yet implemented)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/nsd_gtls.c12
-rw-r--r--runtime/nsd_gtls.h3
-rw-r--r--runtime/rsyslog.h3
3 files changed, 14 insertions, 4 deletions
diff --git a/runtime/nsd_gtls.c b/runtime/nsd_gtls.c
index fad84689..75887913 100644
--- a/runtime/nsd_gtls.c
+++ b/runtime/nsd_gtls.c
@@ -1388,9 +1388,15 @@ Rcv(nsd_t *pNsd, uchar *pBuf, ssize_t *pLenBuf)
/* in TLS mode now */
lenRcvd = gnutls_record_recv(pThis->sess, pBuf, *pLenBuf);
if(lenRcvd < 0) {
- int gnuRet; /* TODO: build a specific function for GnuTLS error reporting */
- *pLenBuf = -1;
- CHKgnutls(lenRcvd); /* this will abort the function */
+ if(lenRcvd == GNUTLS_E_AGAIN || lenRcvd == GNUTLS_E_INTERRUPTED) {
+ pThis->rtryCall = gtlsRtry_recv;
+ dbgprintf("GnuTLS receive requires a retry (this most probably is OK and no error condition)\n");
+ iRet = RS_RET_RETRY;
+ } else {
+ int gnuRet; /* TODO: build a specific function for GnuTLS error reporting */
+ *pLenBuf = -1;
+ CHKgnutls(lenRcvd); /* this will abort the function */
+ }
}
*pLenBuf = lenRcvd;
diff --git a/runtime/nsd_gtls.h b/runtime/nsd_gtls.h
index bbd650a2..d6821dce 100644
--- a/runtime/nsd_gtls.h
+++ b/runtime/nsd_gtls.h
@@ -28,7 +28,8 @@
typedef enum {
gtlsRtry_None = 0, /**< no call needs to be retried */
- gtlsRtry_handshake = 1
+ gtlsRtry_handshake = 1,
+ gtlsRtry_recv = 2
} gtlsRtryCall_t; /**< IDs of calls that needs to be retried */
typedef nsd_if_t nsd_gtls_if_t; /* we just *implement* this interface */
diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h
index f296a608..5364a87a 100644
--- a/runtime/rsyslog.h
+++ b/runtime/rsyslog.h
@@ -238,6 +238,9 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth
RS_RET_FILE_NO_STAT = -2096, /**< can not stat() a file */
RS_RET_FILE_TOO_LARGE = -2097, /**< a file is larger than permitted */
RS_RET_INVALID_WILDCARD = -2098, /**< a wildcard entry is invalid */
+ RS_RET_CLOSED = -2099, /**< connection was closed */
+ RS_RET_RETRY = -2100, /**< call should be retried (e.g. EGAIN on recv) */
+ RS_RET_GSS_ERR = -2101, /**< generic error occured in GSSAPI subsystem */
/* RainerScript error messages (range 1000.. 1999) */
RS_RET_SYSVAR_NOT_FOUND = 1001, /**< system variable could not be found (maybe misspelled) */