fixed win32 hostname resolve;

v0.5.xx
Alexander Vdolainen 9 years ago
parent a40133f23a
commit c9cdd56060

@ -513,7 +513,9 @@ static void __connection_destroy(conn_t *co)
if(co->pctx->login) free(co->pctx->login);
if(co->pctx->passwd) free(co->pctx->passwd);
SSL_shutdown(co->ssl);
while((fd = SSL_shutdown(co->ssl)) != 1) {
if(fd < 0) break;
}
fd = SSL_get_fd(co->ssl);
SSL_free(co->ssl);
SSL_CTX_free(co->ctx);
@ -1085,13 +1087,17 @@ conn_t *connection_link(conn_sys_t *ssys, const char *host,
/* resolve host */
#ifdef WIN32
host_ = gethostbyname(host);
if(!host_) {
r = SNE_FAILED;
goto __fail;
}
#else
r = __resolvehost(host, hostbuf, 2048, &host_);
#endif
if(r) {
r = SNE_FAILED;
goto __fail;
}
#endif
/* create a socket */
sck = socket(PF_INET, SOCK_STREAM, 0);

Loading…
Cancel
Save