[Openvpn-devel] [S] Change in openvpn[master]: Add mock support for management messages

"plaisthos \(Code Review\) via Openvpn-devel" <[email protected]>
Newsgroups net.sourceforge.lists.openvpn-devel
Message-ID <[email protected]>
plaisthos has uploaded this change for review. ( http://gerrit.openvpn.net/c/openvpn/+/1857?usp=email )


Change subject: Add mock support for management messages
......................................................................

Add mock support for management messages

Change-Id: I432df6c69249b49e9b9a3a904803904d134387a0
Signed-off-by: Arne Schwabe <[email protected]>
---
M tests/unit_tests/openvpn/mock_msg.c
M tests/unit_tests/openvpn/mock_msg.h
2 files changed, 11 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/57/1857/1

diff --git a/tests/unit_tests/openvpn/mock_msg.c b/tests/unit_tests/openvpn/mock_msg.c
index 8176d2a..3e73d19 100644
--- a/tests/unit_tests/openvpn/mock_msg.c
+++ b/tests/unit_tests/openvpn/mock_msg.c
@@ -43,6 +43,7 @@
 
 
 char mock_msg_buf[MOCK_MSG_BUF];
+char mock_managment_buf[MOCK_MSG_BUF];
 
 
 void
@@ -76,6 +77,14 @@
     {
         printf("FATAL ERROR:");
     }
+
+    if (flags & M_MSG_VIRT_OUT)
+    {
+        CLEAR(mock_managment_buf);
+        vsnprintf(mock_managment_buf, sizeof(mock_managment_buf), format, arglist);
+        return;
+    }
+
     CLEAR(mock_msg_buf);
     vsnprintf(mock_msg_buf, sizeof(mock_msg_buf), format, arglist);
 
diff --git a/tests/unit_tests/openvpn/mock_msg.h b/tests/unit_tests/openvpn/mock_msg.h
index da96b212..41ce48f 100644
--- a/tests/unit_tests/openvpn/mock_msg.h
+++ b/tests/unit_tests/openvpn/mock_msg.h
@@ -36,6 +36,8 @@
 
 extern bool fatal_error_triggered;
 extern char mock_msg_buf[MOCK_MSG_BUF];
+extern char mock_managment_buf[MOCK_MSG_BUF];
+
 
 msglvl_t mock_get_debug_level(void);
 

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

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I432df6c69249b49e9b9a3a904803904d134387a0
Gerrit-Change-Number: 1857
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.