Experimental streaming PKCS#7 support.
[openssl.git] / crypto / bio / bss_sock.c
index 76d1387527da2ac3259f457c99e8b7b8733424bb..472dd75821c5e65d4b3cfd93fe777a489a7d449b 100644 (file)
  * [including the GNU Public Licence.]
  */
 
-#ifndef NO_SOCK
-
 #include <stdio.h>
 #include <errno.h>
 #define USE_SOCKETS
 #include "cryptlib.h"
 #include <openssl/bio.h>
 
+#ifdef WATT32
+#define sock_write SockWrite  /* Watt-32 uses same names */
+#define sock_read  SockRead
+#define sock_puts  SockPuts
+#endif
+
 static int sock_write(BIO *h, const char *buf, int num);
 static int sock_read(BIO *h, char *buf, int size);
 static int sock_puts(BIO *h, const char *str);
@@ -228,7 +232,7 @@ int BIO_sock_should_retry(int i)
                {
                err=get_last_socket_error();
 
-#if defined(WINDOWS) && 0 /* more microsoft stupidity? perhaps not? Ben 4/1/99 */
+#if defined(OPENSSL_SYS_WINDOWS) && 0 /* more microsoft stupidity? perhaps not? Ben 4/1/99 */
                if ((i == -1) && (err == 0))
                        return(1);
 #endif
@@ -242,7 +246,7 @@ int BIO_sock_non_fatal_error(int err)
        {
        switch (err)
                {
-#if defined(WINDOWS)
+#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_NETWARE)
 # if defined(WSAEWOULDBLOCK)
        case WSAEWOULDBLOCK:
 # endif
@@ -273,7 +277,7 @@ int BIO_sock_non_fatal_error(int err)
 #endif
 
 #ifdef EAGAIN
-#if EWOULDBLOCK != EAGAIN
+# if EWOULDBLOCK != EAGAIN
        case EAGAIN:
 # endif
 #endif
@@ -296,4 +300,3 @@ int BIO_sock_non_fatal_error(int err)
                }
        return(0);
        }
-#endif