diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-12-26 07:50:28 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-12-26 07:50:28 +0000 |
commit | 6d6ada32ff47b1dd63ffbe306621ff27c98f2499 (patch) | |
tree | 69664414686fb7f49568cdabb13aa7e2a6926c14 /libsylph | |
parent | 6daa8a167b8858965f32b1cb0766461de6740ea2 (diff) |
prevent duplicate retrieval after incomplete POP3 session.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@865 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r-- | libsylph/pop.c | 9 | ||||
-rw-r--r-- | libsylph/pop.h | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/libsylph/pop.c b/libsylph/pop.c index b61eb377..f0344957 100644 --- a/libsylph/pop.c +++ b/libsylph/pop.c @@ -374,6 +374,7 @@ static gint pop3_delete_send(Pop3Session *session) static gint pop3_delete_recv(Pop3Session *session) { + session->msg[session->cur_msg].recv_time = RECV_TIME_DELETE; session->msg[session->cur_msg].deleted = TRUE; return PS_SUCCESS; } @@ -518,8 +519,11 @@ gint pop3_write_uidl_list(Pop3Session *session) for (n = 1; n <= session->count; n++) { msg = &session->msg[n]; - if (msg->uidl && msg->received && !msg->deleted) - fprintf(fp, "%s\t%ld\n", msg->uidl, msg->recv_time); + if (!msg->uidl || !msg->received) + continue; + if (session->state == POP3_DONE && msg->deleted) + continue; + fprintf(fp, "%s\t%ld\n", msg->uidl, msg->recv_time); } if (fclose(fp) == EOF) FILE_OP_ERROR(path, "fclose"); @@ -791,6 +795,7 @@ static gint pop3_session_recv_msg(Session *session, const gchar *msg) } break; case POP3_LOGOUT: + pop3_session->state = POP3_DONE; session_disconnect(session); break; case POP3_ERROR: diff --git a/libsylph/pop.h b/libsylph/pop.h index da0f80b7..0ca59e66 100644 --- a/libsylph/pop.h +++ b/libsylph/pop.h @@ -52,6 +52,7 @@ typedef enum { POP3_RETR_RECV, POP3_DELETE, POP3_LOGOUT, + POP3_DONE, POP3_ERROR, N_POP3_STATE |