mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-15 12:13:24 +00:00
close and shutdown utp socket on timeout
This commit is contained in:
parent
c6b3fa25ff
commit
22b63fba38
@ -337,7 +337,9 @@ namespace llarp
|
|||||||
link->HandleTimeout(session);
|
link->HandleTimeout(session);
|
||||||
llarp::LogError(utp_error_code_names[arg->error_code], " via ",
|
llarp::LogError(utp_error_code_names[arg->error_code], " via ",
|
||||||
session->remoteAddr);
|
session->remoteAddr);
|
||||||
if(arg->error_code != UTP_ETIMEDOUT)
|
if(arg->error_code == UTP_ETIMEDOUT)
|
||||||
|
utp_close(arg->socket);
|
||||||
|
else
|
||||||
session->Close();
|
session->Close();
|
||||||
link->RemovePending(session);
|
link->RemovePending(session);
|
||||||
}
|
}
|
||||||
@ -872,6 +874,7 @@ namespace llarp
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
llarp::LogWarn("utp_socket got data with no underlying session");
|
llarp::LogWarn("utp_socket got data with no underlying session");
|
||||||
|
utp_shutdown(arg->socket, SHUT_RDWR);
|
||||||
utp_close(arg->socket);
|
utp_close(arg->socket);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user