Document extension clash.
[openssl.git] / apps / s_socket.c
index f73f1931e50529a0495b354aab8dac9410c25acf..a04b990540c94750a28bfb1f50fa720c0212b6dd 100644 (file)
@@ -280,7 +280,7 @@ static int init_client_ip(int *sock, const unsigned char ip[4], int port,
        return(1);
        }
 
-int do_server(int port, int type, int *ret, int (*cb)(char *hostname, int s, unsigned char *context), unsigned char *context, int naccept)
+int do_server(int port, int type, int *ret, int (*cb)(char *hostname, int s, int stype, unsigned char *context), unsigned char *context, int naccept)
        {
        int sock;
        char *name = NULL;
@@ -298,7 +298,11 @@ int do_server(int port, int type, int *ret, int (*cb)(char *hostname, int s, uns
                {
                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);
@@ -306,7 +310,7 @@ int do_server(int port, int type, int *ret, int (*cb)(char *hostname, int s, uns
                        }
                else
                        sock = accept_socket;
-               i=(*cb)(name,sock, context);
+               i=(*cb)(name,sock, type, context);
                if (name != NULL) OPENSSL_free(name);
                if (type==SOCK_STREAM)
                        SHUTDOWN2(sock);