+ for (;;)
+ {
+ if (type==SOCK_STREAM)
+ {
+#ifdef OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL
+ if (do_accept(accept_socket,&sock,NULL) == 0)
+#else
+ if (do_accept(accept_socket,&sock,&name) == 0)
+#endif
+ {
+ SHUTDOWN(accept_socket);
+ return(0);
+ }
+ }
+ else
+ sock = accept_socket;
+ i=(*cb)(name,sock, type, context);
+ if (name != NULL) OPENSSL_free(name);
+ if (type==SOCK_STREAM)
+ SHUTDOWN2(sock);
+ if (naccept != -1)
+ naccept--;
+ if (i < 0 || naccept == 0)
+ {
+ SHUTDOWN2(accept_socket);
+ return(i);
+ }
+ }
+ }
+
+#ifndef NO_SYS_UN_H
+int do_server_unix(const char *path, int *ret,
+ int (*cb)(char *hostname, int s, int stype, unsigned char *context),
+ unsigned char *context, int naccept)
+ {
+ int sock;
+ int accept_socket = 0;
+ int i;
+
+ if (!init_server_unix(&accept_socket, path)) return(0);
+
+ if (ret != NULL)
+ *ret=accept_socket;