]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
more error details on failed remote control connection. release-1.4.6
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 22 Jul 2010 11:50:28 +0000 (11:50 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 22 Jul 2010 11:50:28 +0000 (11:50 +0000)
git-svn-id: file:///svn/unbound/trunk@2201 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/remote.c
doc/Changelog

index b9391499f5d9369a66605836e0ced5de147fef65..73e8729ef50218f29b0ddde6503afe88b2576ace 100644 (file)
@@ -1802,8 +1802,8 @@ int remote_control_callback(struct comm_point* c, void* arg, int err,
        ERR_clear_error();
        r = SSL_do_handshake(s->ssl);
        if(r != 1) {
-               r = SSL_get_error(s->ssl, r);
-               if(r == SSL_ERROR_WANT_READ) {
+               int r2 = SSL_get_error(s->ssl, r);
+               if(r2 == SSL_ERROR_WANT_READ) {
                        if(s->shake_state == rc_hs_read) {
                                /* try again later */
                                return 0;
@@ -1811,7 +1811,7 @@ int remote_control_callback(struct comm_point* c, void* arg, int err,
                        s->shake_state = rc_hs_read;
                        comm_point_listen_for_rw(c, 1, 0);
                        return 0;
-               } else if(r == SSL_ERROR_WANT_WRITE) {
+               } else if(r2 == SSL_ERROR_WANT_WRITE) {
                        if(s->shake_state == rc_hs_write) {
                                /* try again later */
                                return 0;
@@ -1820,6 +1820,10 @@ int remote_control_callback(struct comm_point* c, void* arg, int err,
                        comm_point_listen_for_rw(c, 0, 1);
                        return 0;
                } else {
+                       if(r == 0)
+                               log_err("remote control connection closed prematurely");
+                       log_addr(1, "failed connection from",
+                               &s->c->repinfo.addr, s->c->repinfo.addrlen);
                        log_crypto_err("remote control failed ssl");
                        clean_point(rc, s);
                        return 0;
index 6353fd8dab0b5e265d0ed20161d01eca8ab5993e..a5aa2a0ed74cb5acf2bd433f94ae25b9ef59405d 100644 (file)
@@ -1,3 +1,6 @@
+22 July 2010: Wouter
+       - more error details on failed remote control connection.
+
 15 July 2010: Wouter
        - rlimit adjustments for select and ulimit can happen at the same time.