summaryrefslogtreecommitdiffstats
path: root/manage.c
diff options
context:
space:
mode:
authorJames Yonan <james@openvpn.net>2011-09-02 23:49:45 +0000
committerDavid Sommerseth <dazo@users.sourceforge.net>2011-09-05 12:06:03 +0200
commitc21b73f251f76e84f789484587e7c82735977549 (patch)
tree2926a2393fb9d327c331f473c94c2ec026720c3f /manage.c
parent8cfa4ebddcfa46ba04705b0291a91d2ac88ab27e (diff)
downloadopenvpn-c21b73f251f76e84f789484587e7c82735977549.tar.gz
openvpn-c21b73f251f76e84f789484587e7c82735977549.tar.xz
openvpn-c21b73f251f76e84f789484587e7c82735977549.zip
Fixed management interface bug where >FATAL notifications were
not being output properly because the management interface socket was being closed before the >FATAL notification could be transmitted. Version 2.1.14 git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@7587 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'manage.c')
-rw-r--r--manage.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/manage.c b/manage.c
index c6632cd..ce6fae7 100644
--- a/manage.c
+++ b/manage.c
@@ -283,7 +283,10 @@ virtual_output_callback_func (void *arg, const unsigned int flags, const char *s
{
struct management *man = (struct management *) arg;
static int recursive_level = 0; /* GLOBAL */
- bool did_push = false;
+
+# define AF_DID_PUSH (1<<0)
+# define AF_DID_RESET (1<<1)
+ unsigned int action_flags = 0;
if (!recursive_level) /* don't allow recursion */
{
@@ -317,7 +320,7 @@ virtual_output_callback_func (void *arg, const unsigned int flags, const char *s
if (out)
{
man_output_list_push_str (man, out);
- did_push = true;
+ action_flags |= AF_DID_PUSH;
}
if (flags & M_FATAL)
{
@@ -325,8 +328,7 @@ virtual_output_callback_func (void *arg, const unsigned int flags, const char *s
if (out)
{
man_output_list_push_str (man, out);
- did_push = true;
- man_reset_client_socket (man, true);
+ action_flags |= (AF_DID_PUSH|AF_DID_RESET);
}
}
}
@@ -335,8 +337,10 @@ virtual_output_callback_func (void *arg, const unsigned int flags, const char *s
gc_free (&gc);
}
- if (did_push)
+ if (action_flags & AF_DID_PUSH)
man_output_list_push_finalize (man);
+ if (action_flags & AF_DID_RESET)
+ man_reset_client_socket (man, true);
}
/*