]> www.dolda2000.com Git - ashd.git/commitdiff
call[fs]cgi: Fix handler connect blocking bug.
authorFredrik Tolf <fredrik@dolda2000.com>
Mon, 12 May 2025 15:37:31 +0000 (17:37 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Mon, 12 May 2025 15:37:31 +0000 (17:37 +0200)
src/callfcgi.c
src/callscgi.c

index 8d33eef1d3c8f9d00758a178cbefc3cb4fd85f7d..83a6c7ca88f2fd9fad2fe17cfdc2784950fe0167 100644 (file)
@@ -253,7 +253,7 @@ static int sconnect(void)
     fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
     while(1) {
        if(connect(fd, curaddr, caddrlen)) {
-           if(errno == EINPROGRESS) {
+           if((errno == EINPROGRESS) || (errno == EAGAIN)) {
                block(fd, EV_WRITE, 30);
                errlen = sizeof(err);
                if(getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &errlen) || ((errno = err) != 0)) {
index 2483c49bd603a13ce549a6cc2569c5e2c79f9e00..60c72acdaee2c70d06c608f3f528b86d8fcad3b7 100644 (file)
@@ -240,7 +240,7 @@ static int sconnect(void)
     fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
     while(1) {
        if(connect(fd, curaddr, caddrlen)) {
-           if(errno == EINPROGRESS) {
+           if((errno == EINPROGRESS) || (errno == EAGAIN)) {
                block(fd, EV_WRITE, 30);
                errlen = sizeof(err);
                if(getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &errlen) || ((errno = err) != 0)) {