1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-13 07:03:25 +00:00

Fixed the end-close option, it just did not work

This commit is contained in:
Gerhard Rieger 2023-11-06 21:23:27 +01:00
parent e610b14470
commit d605ab57f5
18 changed files with 66 additions and 30 deletions

View file

@ -236,7 +236,8 @@ static int xioopen_socket_connect(
retropt_socket_pf(opts, &pf);
retropt_int(opts, OPT_SO_TYPE, &socktype);
/*retropt_int(opts, OPT_IP_PROTOCOL, &proto);*/
sfd->howtoend = END_SHUTDOWN;
if (sfd->howtoend == END_UNSPEC)
sfd->howtoend = END_SHUTDOWN;
if (applyopts_single(sfd, opts, PH_INIT) < 0)
return -1;
@ -320,7 +321,8 @@ static int xioopen_socket_listen(
retropt_socket_pf(opts, &pf);
retropt_int(opts, OPT_SO_TYPE, &socktype);
/*retropt_int(opts, OPT_IP_PROTOCOL, &proto);*/
sfd->howtoend = END_SHUTDOWN;
if (sfd->howtoend == END_UNSPEC)
sfd->howtoend = END_SHUTDOWN;
socket_init(0, &us);
ussize = 0;
@ -415,7 +417,8 @@ int _xioopen_socket_sendto(const char *pfname, const char *type,
retropt_socket_pf(opts, &pf);
retropt_int(opts, OPT_SO_TYPE, &socktype);
/*retropt_int(opts, OPT_IP_PROTOCOL, &proto);*/
sfd->howtoend = END_SHUTDOWN;
if (sfd->howtoend == END_UNSPEC)
sfd->howtoend = END_SHUTDOWN;
sfd->peersa.soa.sa_family = pf;
themsize = 0;
@ -516,7 +519,8 @@ int xioopen_socket_recvfrom(
retropt_socket_pf(opts, &pf);
retropt_int(opts, OPT_SO_TYPE, &socktype);
/*retropt_int(opts, OPT_IP_PROTOCOL, &proto);*/
sfd->howtoend = END_NONE;
if (sfd->howtoend == END_UNSPEC)
sfd->howtoend = END_NONE;
ussize = 0;
if ((result =
@ -600,7 +604,8 @@ int xioopen_socket_recv(
retropt_socket_pf(opts, &pf);
retropt_int(opts, OPT_SO_TYPE, &socktype);
/*retropt_int(opts, OPT_IP_PROTOCOL, &proto);*/
sfd->howtoend = END_NONE;
if (sfd->howtoend == END_UNSPEC)
sfd->howtoend = END_NONE;
ussize = 0;
if ((result =
@ -673,7 +678,8 @@ static int xioopen_socket_datagram(
retropt_socket_pf(opts, &pf);
/*retropt_int(opts, OPT_IP_PROTOCOL, &proto);*/
sfd->howtoend = END_SHUTDOWN;
if (sfd->howtoend == END_UNSPEC)
sfd->howtoend = END_SHUTDOWN;
sfd->peersa.soa.sa_family = pf;
themsize = 0;