aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2020-10-12 04:02:55 +0200
committerPřemysl Eric Janouch <p@janouch.name>2020-10-12 04:04:06 +0200
commit2759c311faeab339e52fcecaf52cd04885a5a54c (patch)
tree5900eeb9c80336086258476add7c255a8e8d75ba
parent529a46ad415ad42d6e4a1ac1f85dd72a1993398c (diff)
downloadxK-2759c311faeab339e52fcecaf52cd04885a5a54c.tar.gz
xK-2759c311faeab339e52fcecaf52cd04885a5a54c.tar.xz
xK-2759c311faeab339e52fcecaf52cd04885a5a54c.zip
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.
-rw-r--r--kike.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kike.c b/kike.c
index 1708d2c..8c77a7b 100644
--- a/kike.c
+++ b/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);