~ When we get a direct connection in we set up its network address * then call handshake.c to set up the crypto state. */
| 646 | /*~ When we get a direct connection in we set up its network address |
| 647 | * then call handshake.c to set up the crypto state. */ |
| 648 | static struct io_plan *connection_in(struct io_conn *conn, |
| 649 | struct daemon *daemon) |
| 650 | { |
| 651 | struct conn_in conn_in_arg; |
| 652 | |
| 653 | /* Did we fail to accept? */ |
| 654 | if (!conn) { |
| 655 | static bool accept_logged = false; |
| 656 | status_broken_once(&accept_logged, |
| 657 | "accepting incoming fd failed: %s", |
| 658 | strerror(errno)); |
| 659 | /* Maybe free up some fds by closing something. */ |
| 660 | close_random_connection(daemon); |
| 661 | return NULL; |
| 662 | } |
| 663 | |
| 664 | conn_in_arg.addr.u.wireaddr.is_websocket = false; |
| 665 | if (!get_remote_address(conn, &conn_in_arg.addr)) |
| 666 | return io_close(conn); |
| 667 | |
| 668 | /* Don't try to set TCP options on UNIX socket! */ |
| 669 | if (conn_in_arg.addr.itype == ADDR_INTERNAL_WIREADDR) |
| 670 | set_tcp_no_delay(daemon, io_conn_fd(conn)); |
| 671 | |
| 672 | conn_in_arg.daemon = daemon; |
| 673 | conn_in_arg.is_websocket = false; |
| 674 | return conn_in(conn, &conn_in_arg); |
| 675 | } |
| 676 | |
| 677 | /*~ <hello>I speak web socket</hello>. |
| 678 | * |
nothing calls this directly
no test coverage detected