Welcome! Log In Create A New Profile

Advanced

[PATCH 5 of 8] Added to process asynchronous accept

SoYun Seong
November 24, 2020 03:46AM
# HG changeset patch
# User SoYun Seong <thdbsdox12@gmail.com>
# Date 1606128989 0
# Mon Nov 23 10:56:29 2020 +0000
# Node ID bdf6d23007d53d9b76a7666c8db7ece864e31038
# Parent d7f0f0b78a24724c362cd0306dc6bbed82c66e62
Added to process asynchronous accept

use a result of a requested accept to ngx_uring_module, instead of calling accept() or accept4() system call.

diff -r d7f0f0b78a24 -r bdf6d23007d5 src/event/ngx_event_accept.c
--- a/src/event/ngx_event_accept.c Mon Nov 23 10:52:02 2020 +0000
+++ b/src/event/ngx_event_accept.c Mon Nov 23 10:56:29 2020 +0000
@@ -55,15 +55,22 @@
do {
socklen = sizeof(ngx_sockaddr_t);

+ if(ngx_event_flags & NGX_USE_URING_EVENT)
+ {
+ s = ev->uring_res;
+ sa.sockaddr = *(lc->sockaddr);
+ socklen = lc->socklen;
+ } else {
#if (NGX_HAVE_ACCEPT4)
- if (use_accept4) {
- s = accept4(lc->fd, &sa.sockaddr, &socklen, SOCK_NONBLOCK);
- } else {
+ if (use_accept4) {
+ s = accept4(lc->fd, &sa.sockaddr, &socklen, SOCK_NONBLOCK);
+ } else {
+ s = accept(lc->fd, &sa.sockaddr, &socklen);
+ }
+#else
s = accept(lc->fd, &sa.sockaddr, &socklen);
+#endif
}
-#else
- s = accept(lc->fd, &sa.sockaddr, &socklen);
-#endif

if (s == (ngx_socket_t) -1) {
err = ngx_socket_errno;
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH 5 of 8] Added to process asynchronous accept

SoYun Seong 82 November 24, 2020 03:46AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 42
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready