mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
Changed handling of incoming connections, so that we can send data
from the send hook without worrying about existence of socket buffers. Also, don't forget to copy peer addresses.
This commit is contained in:
@@ -249,7 +249,6 @@ cli_connect(sock *s, int size)
|
||||
s->rx_hook = cli_rx;
|
||||
s->tx_hook = cli_tx;
|
||||
s->err_hook = cli_err;
|
||||
s->rbsize = 1024;
|
||||
s->data = c = cli_new(s);
|
||||
s->pool = c->pool; /* We need to have all the socket buffers allocated in the cli pool */
|
||||
c->rx_pos = c->rx_buf;
|
||||
@@ -266,6 +265,7 @@ cli_init_unix(void)
|
||||
s = cli_sk = sk_new(cli_pool);
|
||||
s->type = SK_UNIX_PASSIVE;
|
||||
s->rx_hook = cli_connect;
|
||||
s->rbsize = 1024;
|
||||
if (sk_open_unix(s, path_control_socket) < 0)
|
||||
die("Unable to create control socket %s", path_control_socket);
|
||||
}
|
||||
|
Reference in New Issue
Block a user