X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fip.c;h=633e0c2f9e041026d5e8e4d218168852f60af5f6;hb=624f33dfeab938e907251e3cc3062aa45353384f;hp=555dc2d84bee5bdb6c0109e94f4fdb146b6a82e8;hpb=74f1a42304ce056cf979d22fb970faae161e3ab2;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/ip.c b/src/src/ip.c index 555dc2d84..633e0c2f9 100644 --- a/src/src/ip.c +++ b/src/src/ip.c @@ -173,7 +173,7 @@ int sock, backlog = 5; if ( (sock = socket(SOCK_STREAM, AF_INET, 0)) < 0 && setsockopt(sock, IPPROTO_TCP, TCP_FASTOPEN, &backlog, sizeof(backlog)) ) - tcp_fastopen_ok = TRUE; + f.tcp_fastopen_ok = TRUE; close(sock); # endif } @@ -250,9 +250,13 @@ if (timeout > 0) alarm(timeout); this peer, can send data in the SYN packet. The peer can send data before it gets our ACK of its SYN,ACK - the latter is useful for the SMTP banner. Other (than SMTP) cases of TCP connections can -possibly use the data-on-syn, so support that too. */ +possibly use the data-on-syn, so support that too. -if (fastopen_blob && tcp_fastopen_ok) +This is a Linux implementation. It might be useable on FreeBSD; I have +not checked. I think MacOS has a "connectx" call for this purpose, +rather than using "sendto" ? */ + +if (fastopen_blob && f.tcp_fastopen_ok) { if ((rc = sendto(sock, fastopen_blob->data, fastopen_blob->len, MSG_FASTOPEN | MSG_DONTWAIT, s_ptr, s_len)) >= 0) @@ -262,6 +266,7 @@ if (fastopen_blob && tcp_fastopen_ok) DEBUG(D_transport|D_v) debug_printf("non-TFO mode connection attempt to %s, %lu data\n", address, (unsigned long)fastopen_blob->len); + /*XXX also seen on successful TFO, sigh */ tcp_out_fastopen = fastopen_blob->len > 0 ? 2 : 1; } else if (errno == EINPROGRESS) /* expected if we had no cookie for peer */ @@ -308,7 +313,7 @@ alarm(0); can't think of any other way of doing this. It converts a connection refused into a timeout if the timeout is set to 999999. */ -if (running_in_test_harness && save_errno == ECONNREFUSED && timeout == 999999) +if (f.running_in_test_harness && save_errno == ECONNREFUSED && timeout == 999999) { rc = -1; save_errno = EINTR; @@ -339,7 +344,7 @@ return -1; Arguments: type SOCK_DGRAM or SOCK_STREAM af AF_INET6 or AF_INET for the socket type - address the remote address, in text form + hostname host name, or ip address (as text) portlo,porthi the remote port range timeout a timeout connhost if not NULL, host_item to be filled in with connection details