From 603c56df70d5d2af073e001a1c80a233ae1faaed Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 25 Jun 2024 18:14:13 +0200 Subject: [PATCH] http: print proper log message on empty response The same log message was used for both an error HTTP status and an empty HTTP response. Use different messages for each case. Signed-off-by: Simon Ser --- http.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/http.c b/http.c index 5656e9bf..702b6ffa 100644 --- a/http.c +++ b/http.c @@ -979,9 +979,13 @@ int do_https_request(struct openconnect_info *vpninfo, const char *method, const goto out; } if (!buf->pos || result != 200) { - vpn_progress(vpninfo, PRG_ERR, - _("Unexpected %d result from server\n"), - result); + if (!buf->pos) + vpn_progress(vpninfo, PRG_ERR, + _("Unexpected empty response body from server\n")); + else + vpn_progress(vpninfo, PRG_ERR, + _("Unexpected %d result from server\n"), + result); if (result == 401 || result == 403) result = -EPERM; else if (result == 512) /* GlobalProtect invalid username/password */ -- 2.49.0