kike: use read/write rather than recv/send
read/write support non-sockets, otherwise they're the same here. This is in preparation for fuzzing.
This commit is contained in:
parent
529a46ad41
commit
2759c311fa
6
kike.c
6
kike.c
@ -3061,8 +3061,8 @@ irc_try_read (struct client *c)
|
||||
while (true)
|
||||
{
|
||||
str_reserve (buf, 512);
|
||||
n_read = recv (c->socket_fd, buf->str + buf->len,
|
||||
buf->alloc - buf->len - 1 /* null byte */, 0);
|
||||
n_read = read (c->socket_fd, buf->str + buf->len,
|
||||
buf->alloc - buf->len - 1 /* null byte */);
|
||||
|
||||
if (n_read > 0)
|
||||
{
|
||||
@ -3137,7 +3137,7 @@ irc_try_write (struct client *c)
|
||||
|
||||
while (buf->len)
|
||||
{
|
||||
n_written = send (c->socket_fd, buf->str, buf->len, 0);
|
||||
n_written = write (c->socket_fd, buf->str, buf->len);
|
||||
if (n_written >= 0)
|
||||
{
|
||||
str_remove_slice (buf, 0, n_written);
|
||||
|
Loading…
Reference in New Issue
Block a user