summaryrefslogtreecommitdiff
path: root/zyklonb.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-07-12 05:30:13 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-07-12 05:30:13 +0200
commitd5a153bbe3134a37dc4bcee0ab9a10c4b59f8d2e (patch)
tree3c6844ec247f849111af80dac1bea5959f361e10 /zyklonb.c
parent4ead42f4e351a637e0ffb64a56075d6c5fadeea2 (diff)
downloadxK-d5a153bbe3134a37dc4bcee0ab9a10c4b59f8d2e.tar.gz
xK-d5a153bbe3134a37dc4bcee0ab9a10c4b59f8d2e.tar.xz
xK-d5a153bbe3134a37dc4bcee0ab9a10c4b59f8d2e.zip
Call ERR_clear_error() where necessary
Diffstat (limited to 'zyklonb.c')
-rw-r--r--zyklonb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/zyklonb.c b/zyklonb.c
index e8e0892..88bbc87 100644
--- a/zyklonb.c
+++ b/zyklonb.c
@@ -281,6 +281,7 @@ irc_send (struct bot_context *ctx, const char *format, ...)
if (ctx->ssl)
{
// TODO: call SSL_get_error() to detect if a clean shutdown has occured
+ ERR_clear_error ();
if (SSL_write (ctx->ssl, str.str, str.len) != (int) str.len)
{
print_debug ("%s: %s: %s", __func__, "SSL_write",
@@ -1447,6 +1448,7 @@ irc_fill_read_buffer_ssl (struct bot_context *ctx, struct str *buf)
{
int n_read;
start:
+ ERR_clear_error ();
n_read = SSL_read (ctx->ssl, buf->str + buf->len,
buf->alloc - buf->len - 1 /* null byte */);