gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] branch master updated: epoll: immediately notice when ot


From: gnunet
Subject: [libmicrohttpd] branch master updated: epoll: immediately notice when other side closes the socket, instead of waiting for timeout (fixes #7192)
Date: Wed, 08 Feb 2023 15:26:22 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository libmicrohttpd.

The following commit(s) were added to refs/heads/master by this push:
     new 08f933a6 epoll: immediately notice when other side closes the socket, 
instead of waiting for timeout (fixes #7192)
08f933a6 is described below

commit 08f933a6ad2138ad0fad86496eb3ba88eaf3f173
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Feb 8 15:26:19 2023 +0100

    epoll: immediately notice when other side closes the socket, instead of 
waiting for timeout (fixes #7192)
---
 src/microhttpd/connection.c |  2 +-
 src/microhttpd/daemon.c     | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index ddf62d77..a154da45 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -3146,7 +3146,7 @@ parse_cookie_header (struct MHD_Connection *connection)
 /**
  * The valid length of any HTTP version string
  */
-#define HTTP_VER_LEN (MHD_STATICSTR_LEN_(MHD_HTTP_VERSION_1_1))
+#define HTTP_VER_LEN (MHD_STATICSTR_LEN_ (MHD_HTTP_VERSION_1_1))
 
 /**
  * Detect HTTP version, send error response if version is not supported
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index c98e0b09..97054e59 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -2848,7 +2848,7 @@ new_connection_process_ (struct MHD_Daemon *daemon,
           {
             struct epoll_event event;
 
-            event.events = EPOLLIN | EPOLLOUT | EPOLLPRI | EPOLLET;
+            event.events = EPOLLIN | EPOLLOUT | EPOLLPRI | EPOLLET | 
EPOLLRDHUP;
             event.data.ptr = connection;
             if (0 != epoll_ctl (daemon->epoll_fd,
                                 EPOLL_CTL_ADD,
@@ -5214,7 +5214,7 @@ MHD_epoll (struct MHD_Daemon *daemon,
        (! daemon->listen_socket_in_epoll) &&
        (! daemon->at_limit) )
   {
-    event.events = EPOLLIN;
+    event.events = EPOLLIN | EPOLLRDHUP;
     event.data.ptr = daemon;
     if (0 != epoll_ctl (daemon->epoll_fd,
                         EPOLL_CTL_ADD,
@@ -5247,7 +5247,7 @@ MHD_epoll (struct MHD_Daemon *daemon,
   if ( ( (! daemon->upgrade_fd_in_epoll) &&
          (-1 != daemon->epoll_upgrade_fd) ) )
   {
-    event.events = EPOLLIN | EPOLLOUT;
+    event.events = EPOLLIN | EPOLLOUT | EPOLLRDHUP;
     event.data.ptr = _MHD_DROP_CONST (upgrade_marker);
     if (0 != epoll_ctl (daemon->epoll_fd,
                         EPOLL_CTL_ADD,
@@ -6956,7 +6956,7 @@ setup_epoll_to_listen (struct MHD_Daemon *daemon)
   if ( (MHD_INVALID_SOCKET != (ls = daemon->listen_fd)) &&
        (! daemon->was_quiesced) )
   {
-    event.events = EPOLLIN;
+    event.events = EPOLLIN | EPOLLRDHUP;
     event.data.ptr = daemon;
     if (0 != epoll_ctl (daemon->epoll_fd,
                         EPOLL_CTL_ADD,
@@ -6975,7 +6975,7 @@ setup_epoll_to_listen (struct MHD_Daemon *daemon)
 
   if (MHD_ITC_IS_VALID_ (daemon->itc))
   {
-    event.events = EPOLLIN;
+    event.events = EPOLLIN | EPOLLRDHUP;
     event.data.ptr = _MHD_DROP_CONST (epoll_itc_marker);
     if (0 != epoll_ctl (daemon->epoll_fd,
                         EPOLL_CTL_ADD,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]