You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
This issue exists in 1.1.0, 2.0.0 and master. In __apn_connect function, if connect failed, sock is not set to ctx->sock, application level apn_close() can not close this socket. If application always retry to create connection, it will cause a lot of unclosed socket. Every process used socket is limited, after socket is exhausted, all file/socket operation will be failed. This issue is seen when DNS is ok, but apn traffic is blocked by firewall.
The fix is easy, add close socket in connect() error branch.
@adobkin Can you have a look at this issue? I have created 2 pull requests in both 1.1.0 and 2.0.0. I'm waiting for your acceptance. If you can accept it, I don't use a patch in local build.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
__apn_connect()
...
if (connect(sock, (struct sockaddr *) &socket_address, sizeof (socket_address)) < 0) {
APN_SET_ERROR(error, APN_ERR_COULD_NOT_INITIALIZE_CONNECTION | APN_ERR_CLASS_INTERNAL, __apn_errors[APN_ERR_COULD_NOT_INITIALIZE_CONNECTION]);
APN_RETURN_ERROR;
}
The text was updated successfully, but these errors were encountered: