]> www.infradead.org Git - users/dwmw2/openconnect.git/commit
Skip dump_buf_hex() when the log level is low enough
authorDimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
Sat, 26 Mar 2022 20:12:56 +0000 (21:12 +0100)
committerDimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
Sat, 9 Apr 2022 10:02:55 +0000 (12:02 +0200)
commit76eae4aef7c10412c18a73ff702595809f9fffb2
treee072f5e93c273f3e6e48b29a537efcc414973ff3
parentb688b0a3e24e9f86f30fe24c5b9e41ad715c7cba
Skip dump_buf_hex() when the log level is low enough

This is a performance fix.

Indeed, dump_buf_hex() is heavy enough to significantly slow down
OpenConnect. So avoid calling dump_buf_hex() when the log level does
not require it.

Before this patch, the whole body of dump_buf_hex() was executed,
even when vpn_progress() wouldn't print anything.

Same for dump_buf(), although the performance hit is less important.

Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
http.c
openconnect-internal.h