mirror of
https://github.com/moparisthebest/imapfilter
synced 2024-12-21 23:28:49 -05:00
Ignore network errors during logout
In case of a network failure during a logout request, there's no point in restoring the connection, but it is better to just close it.
This commit is contained in:
parent
861aa6fd45
commit
5011966115
@ -151,8 +151,7 @@ ifcore_logout(lua_State *lua)
|
||||
luaL_error(lua, "wrong number of arguments");
|
||||
luaL_checktype(lua, 1, LUA_TLIGHTUSERDATA);
|
||||
|
||||
while ((r = request_logout((session *)(lua_topointer(lua, 1)))) ==
|
||||
STATUS_NONE);
|
||||
r = request_logout((session *)(lua_topointer(lua, 1)));
|
||||
|
||||
lua_pop(lua, 1);
|
||||
|
||||
|
@ -267,13 +267,21 @@ request_logout(session *ssn)
|
||||
{
|
||||
int t, r;
|
||||
|
||||
t = send_request(ssn, "LOGOUT");
|
||||
r = response_generic(ssn, t);
|
||||
if ((t = send_request(ssn, "LOGOUT")) == -1)
|
||||
goto fail;
|
||||
if ((r = response_generic(ssn, t)) == -1)
|
||||
goto fail;
|
||||
|
||||
close_connection(ssn);
|
||||
session_destroy(ssn);
|
||||
if (r == STATUS_OK) {
|
||||
close_connection(ssn);
|
||||
session_destroy(ssn);
|
||||
}
|
||||
|
||||
return r;
|
||||
fail:
|
||||
session_destroy(ssn);
|
||||
|
||||
return STATUS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user