htparser: Handle ECONNABORTED correctly.
[ashd.git] / src / ssl-gnutls.c
index 1ab040d..9aa2f19 100644 (file)
@@ -364,7 +364,7 @@ static void listenloop(struct muth *muth, va_list args)
     struct sockaddr_storage name;
     socklen_t namelen;
     
-    fcntl(pd->fd, F_SETFL, fcntl(tcp->fd, F_GETFL) | O_NONBLOCK);
+    fcntl(pd->fd, F_SETFL, fcntl(pd->fd, F_GETFL) | O_NONBLOCK);
     while(1) {
        namelen = sizeof(name);
        if(block(pd->fd, EV_READ, 0) == 0)
@@ -375,6 +375,8 @@ static void listenloop(struct muth *muth, va_list args)
            if(ns < 0) {
                if(errno == EAGAIN)
                    break;
+               if(errno == ECONNABORTED)
+                   continue;
                flog(LOG_ERR, "accept: %s", strerror(errno));
                goto out;
            }