Skip to content

Commit

Permalink
using iouring for http coro client
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFreeman committed Dec 7, 2024
1 parent 709a5cd commit 4577e96
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ext-src/swoole_http_client_coro.cc
Original file line number Diff line number Diff line change
Expand Up @@ -523,12 +523,19 @@ static int http_parser_on_body(swoole_http_parser *parser, const char *at, size_
}
http->download_file = fp.release();
}
if (swoole_coroutine_write(http->download_file->get_fd(), SW_STRINGL(http->body)) !=
(ssize_t) http->body->length) {

if (
#ifdef SW_USE_IOURING
swoole_coroutine_iouring_write
#else
swoole_coroutine_write
#endif
(http->download_file->get_fd(), SW_STRINGL(http->body)) != (ssize_t) http->body->length) {
return -1;
}
http->body->clear();
}

return 0;
}

Expand Down

0 comments on commit 4577e96

Please sign in to comment.