Skip to contentSkip to conversation

Remove useless empty line from CR_RESPONSE message

PATCH In review Arne Schwabe 2 participants 2 messages May 30, 2022 – May 31, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove useless empty line from CR_RESPONSE message

The out buffer is not filled and this adds an extra empty line for CR_RESPONSE outputs. Also make minor style fixes.

---
 src/openvpn/manage.c | 5 +----
 src/openvpn/push.c   | 1 -
 2 files changed, 1 insertion(+), 5 deletions(-)
src/openvpn/manage.c +1 -4
index 9c07bf298..edcf0f202 100644
@@ -2883,17 +2883,14 @@ management_notify_client_cr_response(unsigned mda_key_id,
     {
         gc = gc_new();
 
-        struct buffer out = alloc_buf_gc(256, &gc);
         msg(M_CLIENT, ">CLIENT:CR_RESPONSE,%lu,%u,%s",
             mdac->cid, mda_key_id, response);
         man_output_extra_env(management, "CLIENT");
-        if (management->connection.env_filter_level>0)
+        if (management->connection.env_filter_level > 0)
         {
             man_output_peer_info_env(management, mdac);
         }
         man_output_env(es, true, management->connection.env_filter_level, "CLIENT");
-        management_notify_generic(management, BSTR(&out));
-
         gc_free(&gc);
     }
 }
src/openvpn/push.c +0 -1
index 7cf882d11..2332bc464 100644
@@ -249,7 +249,6 @@ receive_cr_response(struct context *c, const struct buffer *buffer)
     struct env_set *es = session->opt->es;
     int key_id = get_primary_key(c->c2.tls_multi)->key_id;
 
-
     management_notify_client_cr_response(key_id, mda, es, m);
 #endif
 #if ENABLE_PLUGIN
Signature · 1 line
2.32.0 (Apple Git-132)
Acked-by on v1 1/1
#1 lore raw

"Obviously correct". Didn't want to go in (the push.c hunk has an ENABLE_PLUGIN in the context, which is not in master), but that was easy to fix.

Lightly "make check" tested.

Your patch has been applied to the master and release/2.5 branch.

commit 0dbcaba4f301c21e68a5cd032a4b56eb75c17c37 (master) commit 400da02714abd36218954c988a2ef81dade0b59d (release/2.5)

Author: Arne Schwabe
Date:   Tue May 31 00:41:49 2022 +0200
     Remove useless empty line from CR_RESPONSE message

     Signed-off-by: Arne Schwabe <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg24447.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering