summaryrefslogtreecommitdiff
path: root/chat/jabberd/patches/patch-ad
blob: 03519a07697654e1aac52bf2ccb1b1ac02b4f177 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$NetBSD: patch-ad,v 1.3 2005/03/20 18:50:09 salo Exp $

--- jabberd/mio_ssl.c.orig	2002-02-08 08:39:27.000000000 +0100
+++ jabberd/mio_ssl.c	2005-03-20 19:38:42.000000000 +0100
@@ -219,6 +219,15 @@
     SSL_CTX *ctx = NULL;
     int fd;
     int sret;
+    int flags;
+
+    fd = accept(m->fd, serv_addr, addrlen);
+
+    /* set the socket to non-blocking as this is not
+       inherited */
+    flags =  fcntl(fd, F_GETFL, 0);
+    flags |= O_NONBLOCK;
+    fcntl(fd, F_SETFL, flags);
 
     if(m->ip == NULL)
     {
@@ -226,8 +235,6 @@
         return -1;
     }
 
-    fd = accept(m->fd, serv_addr, addrlen);
-    
     ctx = ghash_get(ssl__ctxs, m->ip);
     if(ctx == NULL)
     {