Browse Source

systems without fastopen support return EPIPE

master
Felix von Leitner 3 years ago
parent
commit
d4adc803fe
  1. 5
      socket/socket_fastopen_connect4.c
  2. 2
      socket/socket_fastopen_connect6.c

5
socket/socket_fastopen_connect4.c

@ -9,16 +9,15 @@
#include <errno.h>
ssize_t socket_fastopen_connect4(int s,const char* ip,uint16 port,const char* buf,size_t len) {
#ifndef MSG_FASTOPEN
int r;
#ifndef MSG_FASTOPEN
{
#else
int r;
if (len)
r=socket_send4_flag(s,buf,len,ip,port,MSG_FASTOPEN);
else
r=socket_connect4(s,ip,port);
if (r==-1 && errno==ENOTCONN) {
if (r==-1 && (errno==ENOTCONN || errno==EPIPE)) {
#endif
/* apparently the kernel does not support TCP fast open */
r=socket_connect4(s,ip,port);

2
socket/socket_fastopen_connect6.c

@ -18,7 +18,7 @@ ssize_t socket_fastopen_connect6(int s,const char* ip,uint16 port,uint32_t scope
r=socket_send6_flag(s,buf,len,ip,port,scope_id,MSG_FASTOPEN);
else
r=socket_connect6(s,ip,port,scope_id);
if (r==-1 && errno==ENOTCONN) {
if (r==-1 && (errno==ENOTCONN || errno==EPIPE)) {
#endif
/* apparently the kernel does not support TCP fast open */
r=socket_connect6(s,ip,port,scope_id);

Loading…
Cancel
Save