mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-08 16:11:18 +00:00
Fixed -DNO_SSL build
This commit is contained in:
1 parent
2fd7191836
commit
224d18589f
4 files changed
+18
-6
No files matched your search
@@ -3,14 +3,18 @@
|
||||
static SOCKET conn2(const char *host, int port, int use_ssl,
|
||||
char *ebuf, size_t ebuf_len) {
|
||||
struct sockaddr_in sin;
|
||||
struct hostent *he;
|
||||
struct hostent *he = NULL;
|
||||
SOCKET sock = INVALID_SOCKET;
|
||||
|
||||
(void) use_ssl; // Prevent warning for -DNO_SSL case
|
||||
|
||||
if (host == NULL) {
|
||||
snprintf(ebuf, ebuf_len, "%s", "NULL host");
|
||||
#ifndef NO_SSL
|
||||
} else if (use_ssl && SSLv23_client_method == NULL) {
|
||||
snprintf(ebuf, ebuf_len, "%s", "SSL is not initialized");
|
||||
// TODO(lsm): use something threadsafe instead of gethostbyname()
|
||||
#endif
|
||||
} else if ((he = gethostbyname(host)) == NULL) {
|
||||
snprintf(ebuf, ebuf_len, "gethostbyname(%s): %s", host, strerror(ERRNO));
|
||||
} else if ((sock = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) {
|
||||
|
||||
Reference in new issue
Block a user