提交 5fb66093 authored 作者: William King's avatar William King

ESL-82 --resolve

Previously any esl_connect_timeout() failures would not return to the calling application the reason for the failure.
This commit now allows for calling applications to know why the connection attempt fails, but it is now the calling
applications responsiblity to call esl_disconnect() on the esl handle after the failure. Failing to call disconnect after
a failed connection attempt would result in memory being leaked.
上级 199a64bf
......@@ -967,7 +967,7 @@ ESL_DECLARE(esl_status_t) esl_connect_timeout(esl_handle_t *handle, const char *
int err = WSAStartup(wVersionRequested, &wsaData);
if (err != 0) {
snprintf(handle->err, sizeof(handle->err), "WSAStartup Error");
return ESL_FAIL;
goto fail;
}
#endif
......@@ -1009,7 +1009,7 @@ ESL_DECLARE(esl_status_t) esl_connect_timeout(esl_handle_t *handle, const char *
if (handle->sock == ESL_SOCK_INVALID) {
snprintf(handle->err, sizeof(handle->err), "Socket Error");
return ESL_FAIL;
goto fail;
}
if (timeout) {
......@@ -1110,7 +1110,6 @@ ESL_DECLARE(esl_status_t) esl_connect_timeout(esl_handle_t *handle, const char *
fail:
handle->connected = 0;
esl_disconnect(handle);
return ESL_FAIL;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论