Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37552640
en ru br
ALT Linux repos
S:1.9.4-alt3
5.0: 0.57-alt1.1
4.1: 0.57-alt0.M41.2
4.0: 0.57-alt0.M40.1
3.0: 0.38-alt1

Group :: Development/C
RPM: libetpan

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: Fixed-return-code-of-mailimap_logout-327.patch
Download


From 27d6f41d3bdfd9178ad309bd0ece7aaaabbaceb1 Mon Sep 17 00:00:00 2001
From: Dan-Fraser <46791348+Dan-Fraser@users.noreply.github.com>
Date: Fri, 22 Feb 2019 10:27:14 -0800
Subject: [PATCH 1/3] Fixed return code of mailimap_logout (#327)
The function mailimap_logout() would return MAILIMAP_STREAM_ERROR even
after successful logout commands. This patch fixes that by detecting
that specific error code in mailimap_logout() and returning the code
MAILIMAP_NO_ERROR instead.
---
 src/low-level/imap/mailimap.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/low-level/imap/mailimap.c b/src/low-level/imap/mailimap.c
index 989e20a..0921a7f 100644
--- a/src/low-level/imap/mailimap.c
+++ b/src/low-level/imap/mailimap.c
@@ -749,7 +749,13 @@ int mailimap_logout(mailimap * session)
   }
 
   r = mailimap_parse_response(session, &response);
-  if (r != MAILIMAP_NO_ERROR) {
+  if (r == MAILIMAP_ERROR_STREAM) {
+    // the response is expected to be MAILIMAP_ERROR_STREAM
+    // because the server responds with BYE so the stream
+    // is immediately closed
+    res = MAILIMAP_NO_ERROR;
+    goto close;
+  } else if (r != MAILIMAP_NO_ERROR) {
     res = r;
     goto close;
   }
-- 
2.21.0
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin