]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Send push reply right after async auth complete
authorLev Stipakov <lstipakov@gmail.com>
Sat, 10 Oct 2015 16:04:25 +0000 (19:04 +0300)
committerDavid Sommerseth <davids@redhat.com>
Sun, 11 Oct 2015 09:05:09 +0000 (11:05 +0200)
commit0d1a75bfe241466230c41a52c6013494135c5935
treee432b2ffd5f0933aeca0d1a7366e273e56459896
parent9403e3f4b510fbc4187044f31be8f7dccbde1cf1
Send push reply right after async auth complete

v3:
* better comments
* better variable naming
* include sys/inotify.h if HAVE_SYS_INOTIFY_H is defined

v2:
More careful inotify_watchers handling
* Ensure that same multi_instance is added only once
* Ensure that multi_instance is always removed

v1:
This feature speeds up connection establishment in cases when async
authentication result is not ready when first push request arrives. At
the moment server sends push reply only when it receives next push
request, which comes 5 seconds later.

Implementation overview.

Add new configure option ENABLE_ASYNC_PUSH, which can be enabled if
system supports inotify.

Add inotify descriptor to an event loop. Add inotify watch for a
authentication control file. Store mapping between watch descriptor and
multi_instance in a dictionary. When file is closed, inotify fires an
event and we continue with connection establishment - call client-
connect etc and send push reply.

Inotify watch descriptor got automatically deleted after file is closed
or when file is removed. We catch that event and remove it from the
dictionary.

Feature is easily tested with sample "defer" plugin and following settings:

auth-user-pass-optional
setenv test_deferred_auth 3
plugin simple.so

Signed-off-by: Lev Stipakov <lstipakov@gmail.com>
Add doxygen comment
Acked-by: David Sommerseth <davids@redhat.com>
Message-Id: <1444493065-13506-1-git-send-email-lstipakov@gmail.com>
URL: http://article.gmane.org/gmane.network.openvpn.devel/10248
Signed-off-by: David Sommerseth <davids@redhat.com>
configure.ac
src/openvpn/forward.c
src/openvpn/mtcp.c
src/openvpn/mudp.c
src/openvpn/multi.c
src/openvpn/multi.h
src/openvpn/openvpn.h
src/openvpn/push.c
src/openvpn/push.h