X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/910e279ce7871bd35b90e558de7a0d0b17471b49..1ed08ad2184ac38d0a80e9a8146f378fb297c6a9:/sbr/netsec.c diff --git a/sbr/netsec.c b/sbr/netsec.c index ab490467..01c25f5f 100644 --- a/sbr/netsec.c +++ b/sbr/netsec.c @@ -30,7 +30,7 @@ static int netsec_get_user(void *context, int id, const char **result, static int netsec_get_password(sasl_conn_t *conn, void *context, int id, sasl_secret_t **psecret); -static int sasl_initialized = 0; +static bool sasl_initialized; #define SASL_MAXRECVBUF 65536 #endif /* CYRUS_SASL */ @@ -39,7 +39,7 @@ static int sasl_initialized = 0; #include #include -static int tls_initialized = 0; +static bool tls_initialized; static SSL_CTX *sslctx = NULL; /* SSL Context */ #endif /* TLS_SUPPORT */ @@ -288,7 +288,8 @@ netsec_set_snoop(netsec_context *nsc, int snoop) * Set the snoop callback for this connection. */ -void netsec_set_snoop_callback(netsec_context *nsc, +void +netsec_set_snoop_callback(netsec_context *nsc, netsec_snoop_callback callback, void *context) { nsc->ns_snoop_cb = callback; @@ -1032,7 +1033,7 @@ netsec_set_sasl_params(netsec_context *nsc, const char *service, sasl_errstring(retval, NULL, NULL)); return NOTOK; } - sasl_initialized++; + sasl_initialized = true; } /* @@ -1103,7 +1104,8 @@ netsec_set_sasl_params(netsec_context *nsc, const char *service, * library when asked. */ -int netsec_get_user(void *context, int id, const char **result, +int +netsec_get_user(void *context, int id, const char **result, unsigned int *len) { netsec_context *nsc = (netsec_context *) context; @@ -1550,7 +1552,7 @@ netsec_set_tls(netsec_context *nsc, int tls, int noverify, char **errstr) return NOTOK; } - tls_initialized++; + tls_initialized = true; } if (nsc->ns_readfd == -1 || nsc->ns_writefd == -1) {