Reuse TCP connection, still open can be used again. More...
|rbtree node with links in tcp_reuse tree. More...|
|the key for the tcp_reuse tree. More...|
|length of addr |
|also key for tcp_reuse tree, if ssl is used |
|struct reuse_tcp *||lru_next|
|lru chain, so that the oldest can be removed to get a new connection when all are in (re)use. More...|
|struct reuse_tcp *||lru_prev|
|true if the reuse_tcp item is on the lru list with empty items |
|struct pending_tcp *||pending|
|the connection to reuse, the fd is non-1 and is open. More...|
|The more read again value pointed to by the commpoint tcp_more_read_again pointer, so that it exists after commpoint delete. |
|The more write again value pointed to by the commpoint tcp_more_write_again pointer, so that it exists after commpoint delete. |
|rbtree with other queries waiting on the connection, by ID number, of type struct waiting_tcp. More...|
|struct waiting_tcp *||write_wait_first|
|list of queries waiting to be written on the channel, if NULL no queries are waiting to be written and the pending->query is the query currently serviced. More...|
|struct waiting_tcp *||write_wait_last|
|struct outside_network *||outnet|
|the outside network it is part of |
Reuse TCP connection, still open can be used again.
rbtree node with links in tcp_reuse tree.
key is NULL when not in tree. Both active and empty connections are in the tree. key is a pointer to this structure, the members used to compare are the sockaddr and and then is-ssl bool, and then ptr value is used in case the same address exists several times in the tree when there are multiple connections to the same destination to make the rbtree items unique.
|struct sockaddr_storage reuse_tcp::addr|
|struct reuse_tcp* reuse_tcp::lru_next|
lru chain, so that the oldest can be removed to get a new connection when all are in (re)use.
oldest is last in list. The lru only contains empty connections waiting for reuse, the ones with active queries are not on the list because they do not need to be closed to make space for others. They already service a query so the close for another query does not help service a larger number of queries.
|struct pending_tcp* reuse_tcp::pending|
the connection to reuse, the fd is non-1 and is open.
the addr and port determine where the connection is going, and is key to the rbtree. The SSL ptr determines if it is a TLS connection or a plain TCP connection there. And TLS or not is also part of the key to the rbtree. There is a timeout and read event on the fd, to close it.
rbtree with other queries waiting on the connection, by ID number, of type struct waiting_tcp.
It is for looking up received answers to the structure for callback. And also to see if ID numbers are unused and can be used for a new query. The write_wait elements are also in the tree, so that ID numbers can be looked up also for them. They are bool write_wait_queued.
Referenced by decommission_pending_tcp(), outnet_tcp_cb(), reuse_cb_and_decommission(), reuse_tcp_by_id_find(), reuse_tcp_select_id(), reuse_tree_by_id_delete(), reuse_tree_by_id_insert(), tcpid_fillup(), and tcpid_test().
|struct waiting_tcp* reuse_tcp::write_wait_first|
list of queries waiting to be written on the channel, if NULL no queries are waiting to be written and the pending->query is the query currently serviced.
The first is the next in line. They are also in the tree_by_id. Once written, the are removed from this list, but stay in the tree.