Attention is currently required from: Arne Schwabe, Gianmarco De Gregori, 
Răzvan Cojocaru.

Hello Arne Schwabe, Răzvan Cojocaru,

I'd like you to reexamine a change. Please visit

    https://gerrit.openvpn.net/c/openvpn/+/2047?usp=email

to look at the new patch set (#3).

The following approvals got outdated and were removed:
Code-Review+2 by Răzvan Cojocaru


Change subject: multi: resume deferred auth through multi_io_action()
......................................................................

multi: resume deferred auth through multi_io_action()

multi_process_file_closed() is the last place where multi_process_post()
runs without a multi_io_action() following it, so any output it produces
stays in m->pending across event_wait().

Add TA_INSTANCE_POST, which only runs multi_process_post() on the given
instance, and use it so pending output is flushed as for every other
event. Likewise, an instance signalled during this post-processing is
now closed right away instead of on its next event. This is needed
before m->pending can be removed.

Change-Id: I49777902951d3a05c48cddd0d33c14e028e5d706
Signed-off-by: Gianmarco De Gregori <[email protected]>
---
M src/openvpn/multi.c
M src/openvpn/multi.h
M src/openvpn/multi_io.c
M src/openvpn/multi_io.h
4 files changed, 13 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/47/2047/3

diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c
index 3f82052..b1a648b 100644
--- a/src/openvpn/multi.c
+++ b/src/openvpn/multi.c
@@ -2841,7 +2841,7 @@
  * (or be deferred again by client-connect)
  */
 void
-multi_process_file_closed(struct multi_context *m, const unsigned int 
mpp_flags)
+multi_process_file_closed(struct multi_context *m)
 {
     char buffer[INOTIFY_EVENT_BUFFER_SIZE];
     ssize_t buffer_i = 0;
@@ -2869,7 +2869,7 @@
             if (mi)
             {
                 /* continue authentication, perform NCP negotiation and send 
push_reply */
-                multi_process_post(m, mi, mpp_flags);
+                multi_io_action(m, mi, TA_INSTANCE_POST, false);
             }
             else
             {
diff --git a/src/openvpn/multi.h b/src/openvpn/multi.h
index 3d2e932..4a93971 100644
--- a/src/openvpn/multi.h
+++ b/src/openvpn/multi.h
@@ -382,9 +382,8 @@
  * Continues authentication and sends push_repl
  *
  * @param m multi_context
- * @param mpp_flags
  */
-void multi_process_file_closed(struct multi_context *m, const unsigned int 
mpp_flags);
+void multi_process_file_closed(struct multi_context *m);

 #endif

diff --git a/src/openvpn/multi_io.c b/src/openvpn/multi_io.c
index fb4810b..a6e97af 100644
--- a/src/openvpn/multi_io.c
+++ b/src/openvpn/multi_io.c
@@ -85,6 +85,9 @@
         case TA_TUN_WRITE_TIMEOUT:
             return "TA_TUN_WRITE_TIMEOUT";

+        case TA_INSTANCE_POST:
+            return "TA_INSTANCE_POST";
+
         default:
             return "?";
     }
@@ -492,6 +495,11 @@
             multi_process_post(m, mi, mpp_flags);
             break;

+        case TA_INSTANCE_POST:
+            ASSERT(mi);
+            multi_process_post(m, mi, mpp_flags);
+            break;
+
         default:
             msg(M_FATAL, "MULTI IO: multi_io_dispatch, unhandled action=%d", 
action);
     }
@@ -659,7 +667,7 @@
 #ifdef ENABLE_ASYNC_PUSH
                 else if (e->arg == MULTI_IO_FILE_CLOSE_WRITE)
                 {
-                    multi_process_file_closed(m, MPP_PRE_SELECT | 
MPP_RECORD_TOUCH);
+                    multi_process_file_closed(m);
                 }
 #endif
         }
diff --git a/src/openvpn/multi_io.h b/src/openvpn/multi_io.h
index c7f8f89..4d56e25 100644
--- a/src/openvpn/multi_io.h
+++ b/src/openvpn/multi_io.h
@@ -44,6 +44,7 @@
 #define TA_INITIAL               8
 #define TA_TIMEOUT               9
 #define TA_TUN_WRITE_TIMEOUT     10
+#define TA_INSTANCE_POST         11

 /*
  * I/O state and events tracker

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2047?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I49777902951d3a05c48cddd0d33c14e028e5d706
Gerrit-Change-Number: 2047
Gerrit-PatchSet: 3
Gerrit-Owner: Gianmarco De Gregori <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Răzvan Cojocaru <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Răzvan Cojocaru <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
Gerrit-Attention: Gianmarco De Gregori <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to