Merge pull request #1525 from dgarske/sockclose
Cleanup of the socket close code
This commit is contained in:
commit
73d85774df
10
src/ssl.c
10
src/ssl.c
@ -11563,16 +11563,6 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
|
||||
return bio;
|
||||
}
|
||||
|
||||
|
||||
#ifdef USE_WINDOWS_API
|
||||
#define CloseSocket(s) closesocket(s)
|
||||
#elif defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET)
|
||||
#define CloseSocket(s) closesocket(s)
|
||||
extern int closesocket(int);
|
||||
#else
|
||||
#define CloseSocket(s) close(s)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Note : If the flag BIO_NOCLOSE is set then freeing memory buffers is up
|
||||
* to the application.
|
||||
|
@ -1337,7 +1337,7 @@ int EmbedOcspLookup(void* ctx, const char* url, int urlSz,
|
||||
HTTP_SCRATCH_BUFFER_SIZE, ctx);
|
||||
}
|
||||
|
||||
close(sfd);
|
||||
CloseSocket(sfd);
|
||||
XFREE(httpBuf, ctx, DYNAMIC_TYPE_OCSP);
|
||||
}
|
||||
}
|
||||
@ -1438,7 +1438,7 @@ int EmbedCrlLookup(WOLFSSL_CRL* crl, const char* url, int urlSz)
|
||||
HTTP_SCRATCH_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
close(sfd);
|
||||
CloseSocket(sfd);
|
||||
XFREE(httpBuf, crl->heap, DYNAMIC_TYPE_CRL);
|
||||
}
|
||||
}
|
||||
|
@ -183,17 +183,6 @@
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef USE_WINDOWS_API
|
||||
#define CloseSocket(s) closesocket(s)
|
||||
#define StartTCP() { WSADATA wsd; WSAStartup(0x0002, &wsd); }
|
||||
#elif defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET)
|
||||
#define CloseSocket(s) closesocket(s)
|
||||
#define StartTCP()
|
||||
#else
|
||||
#define CloseSocket(s) close(s)
|
||||
#define StartTCP()
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef SINGLE_THREADED
|
||||
typedef unsigned int THREAD_RETURN;
|
||||
|
@ -147,7 +147,6 @@
|
||||
#define SOCKET_EPIPE WSAEPIPE
|
||||
#define SOCKET_ECONNREFUSED WSAENOTCONN
|
||||
#define SOCKET_ECONNABORTED WSAECONNABORTED
|
||||
#define close(s) closesocket(s)
|
||||
#elif defined(__PPU)
|
||||
#define SOCKET_EWOULDBLOCK SYS_NET_EWOULDBLOCK
|
||||
#define SOCKET_EAGAIN SYS_NET_EAGAIN
|
||||
@ -210,6 +209,20 @@
|
||||
#endif /* USE_WINDOWS_API */
|
||||
|
||||
|
||||
#ifdef USE_WINDOWS_API
|
||||
#define CloseSocket(s) closesocket(s)
|
||||
#define StartTCP() { WSADATA wsd; WSAStartup(0x0002, &wsd); }
|
||||
#elif defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET)
|
||||
extern int closesocket(int);
|
||||
#define CloseSocket(s) closesocket(s)
|
||||
#define StartTCP()
|
||||
#else
|
||||
#define CloseSocket(s) close(s)
|
||||
#define StartTCP()
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef DEVKITPRO
|
||||
/* from network.h */
|
||||
int net_send(int, const void*, int, unsigned int);
|
||||
|
Loading…
x
Reference in New Issue
Block a user