added tcp_conn_txqsz()
This commit is contained in:
parent
6365e93c73
commit
0992146f6a
2 changed files with 14 additions and 0 deletions
|
@ -73,6 +73,7 @@ void tcp_conn_txqsz_set(struct tcp_conn *tc, size_t txqsz);
|
|||
int tcp_conn_local_get(const struct tcp_conn *tc, struct sa *local);
|
||||
int tcp_conn_peer_get(const struct tcp_conn *tc, struct sa *peer);
|
||||
int tcp_conn_fd(const struct tcp_conn *tc);
|
||||
size_t tcp_conn_txqsz(const struct tcp_conn *tc);
|
||||
|
||||
|
||||
/* High-level API */
|
||||
|
|
|
@ -1324,6 +1324,19 @@ int tcp_conn_fd(const struct tcp_conn *tc)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the current length of the transmit queue on a TCP Connection
|
||||
*
|
||||
* @param tc TCP-Connection
|
||||
*
|
||||
* @return Current transmit queue length, or 0 if errors
|
||||
*/
|
||||
size_t tcp_conn_txqsz(const struct tcp_conn *tc)
|
||||
{
|
||||
return tc ? tc->txqsz : 0;
|
||||
}
|
||||
|
||||
|
||||
static bool sort_handler(struct le *le1, struct le *le2, void *arg)
|
||||
{
|
||||
struct tcp_helper *th1 = le1->data, *th2 = le2->data;
|
||||
|
|
Loading…
Add table
Reference in a new issue