Skip to content

Commit

Permalink
misc: code cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: He Xian <hexian000@outlook.com>
  • Loading branch information
hexian000 committed Jun 8, 2024
1 parent 15ee896 commit faccd21
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/event_pkt.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,9 @@ static size_t pkt_send(struct server *restrict s, const int fd)

static void pkt_flush(struct server *restrict s)
{
struct ev_io *restrict w_write = &s->pkt.w_write;
for (;;) {
const size_t ret = pkt_send(s, w_write->fd);
if (ret == 0) {
break;
}
const int fd = s->pkt.w_write.fd;
while (pkt_send(s, fd) > 0) {
;
}
}

Expand Down

0 comments on commit faccd21

Please sign in to comment.