projects
/
claws.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sync with sylpheed 0.6.3 release
[claws.git]
/
src
/
pop.c
diff --git
a/src/pop.c
b/src/pop.c
index 50614833a6d38655fc942330aa495fc18931a794..ab4de2562b1a97a94287c56b7ede35af9be67a4c 100644
(file)
--- a/
src/pop.c
+++ b/
src/pop.c
@@
-1,6
+1,6
@@
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999
,2000
Hiroyuki Yamamoto
+ * Copyright (C) 1999
-2001
Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-71,10
+71,16
@@
gint pop3_getauth_user_send(SockInfo *sock, gpointer data)
gint pop3_getauth_user_recv(SockInfo *sock, gpointer data)
{
gint pop3_getauth_user_recv(SockInfo *sock, gpointer data)
{
+ Pop3State *state = (Pop3State *)data;
+
if (pop3_ok(sock, NULL) == PS_SUCCESS)
return POP3_GETAUTH_PASS_SEND;
if (pop3_ok(sock, NULL) == PS_SUCCESS)
return POP3_GETAUTH_PASS_SEND;
- else
+ else {
+ log_warning(_("error occurred on authentication\n"));
+ state->error_val = PS_AUTHFAIL;
+ state->inc_state = INC_AUTH_FAILED;
return -1;
return -1;
+ }
}
gint pop3_getauth_pass_send(SockInfo *sock, gpointer data)
}
gint pop3_getauth_pass_send(SockInfo *sock, gpointer data)
@@
-95,8
+101,9
@@
gint pop3_getauth_pass_recv(SockInfo *sock, gpointer data)
if (pop3_ok(sock, NULL) == PS_SUCCESS)
return POP3_GETRANGE_STAT_SEND;
else {
if (pop3_ok(sock, NULL) == PS_SUCCESS)
return POP3_GETRANGE_STAT_SEND;
else {
- log_warning(_("error occurred on auth
oriz
ation\n"));
+ log_warning(_("error occurred on auth
entic
ation\n"));
state->error_val = PS_AUTHFAIL;
state->error_val = PS_AUTHFAIL;
+ state->inc_state = INC_AUTH_FAILED;
return -1;
}
}
return -1;
}
}
@@
-142,8
+149,9
@@
gint pop3_getauth_apop_recv(SockInfo *sock, gpointer data)
if (pop3_ok(sock, NULL) == PS_SUCCESS)
return POP3_GETRANGE_STAT_SEND;
else {
if (pop3_ok(sock, NULL) == PS_SUCCESS)
return POP3_GETRANGE_STAT_SEND;
else {
- log_warning(_("error occurred on auth
oriz
ation\n"));
+ log_warning(_("error occurred on auth
entic
ation\n"));
state->error_val = PS_AUTHFAIL;
state->error_val = PS_AUTHFAIL;
+ state->inc_state = INC_AUTH_FAILED;
return -1;
}
}
return -1;
}
}
@@
-296,18
+304,25
@@
gint pop3_getsize_list_recv(SockInfo *sock, gpointer data)
state->cur_total_bytes = 0;
while (sock_gets(sock, buf, sizeof(buf)) >= 0) {
state->cur_total_bytes = 0;
while (sock_gets(sock, buf, sizeof(buf)) >= 0) {
- gint num, size;
+ g
u
int num, size;
if (buf[0] == '.') break;
if (buf[0] == '.') break;
- if (sscanf(buf, "%
d %d
", &num, &size) != 2)
-
break
;
+ if (sscanf(buf, "%
u %u
", &num, &size) != 2)
+
return -1
;
- if (num <= state->count)
+ if (num
> 0 && num
<= state->count)
state->sizes[num] = size;
state->sizes[num] = size;
- if (num < state->cur_msg)
+ if (num
> 0 && num
< state->cur_msg)
state->cur_total_bytes += size;
}
state->cur_total_bytes += size;
}
+ while (state->sizes[state->cur_msg] == 0) {
+ if (state->cur_msg == state->count)
+ return POP3_LOGOUT_SEND;
+ else
+ state->cur_msg++;
+ }
+
return POP3_RETR_SEND;
}
return POP3_RETR_SEND;
}
@@
-334,12
+349,14
@@
gint pop3_retr_recv(SockInfo *sock, gpointer data)
return -1;
}
return -1;
}
- state->cur_total_bytes += state->sizes[state->cur_msg];
-
if ((drop_ok = inc_drop_message(file, state)) < 0) {
state->inc_state = INC_ERROR;
return -1;
}
if ((drop_ok = inc_drop_message(file, state)) < 0) {
state->inc_state = INC_ERROR;
return -1;
}
+
+ state->cur_total_bytes += state->sizes[state->cur_msg];
+ state->cur_total_num++;
+
if (drop_ok == 0 && state->ac_prefs->rmmail)
return POP3_DELETE_SEND;
if (drop_ok == 0 && state->ac_prefs->rmmail)
return POP3_DELETE_SEND;
@@
-353,6
+370,12
@@
gint pop3_retr_recv(SockInfo *sock, gpointer data)
if (state->cur_msg < state->count) {
state->cur_msg++;
if (state->cur_msg < state->count) {
state->cur_msg++;
+ while (state->sizes[state->cur_msg] == 0) {
+ if (state->cur_msg == state->count)
+ return POP3_LOGOUT_SEND;
+ else
+ state->cur_msg++;
+ }
return POP3_RETR_SEND;
} else
return POP3_LOGOUT_SEND;
return POP3_RETR_SEND;
} else
return POP3_LOGOUT_SEND;
@@
-366,7
+389,7
@@
gint pop3_delete_send(SockInfo *sock, gpointer data)
{
Pop3State *state = (Pop3State *)data;
{
Pop3State *state = (Pop3State *)data;
- /
/inc_progress_update(state, POP3_DELETE_SEND);
+ /
*inc_progress_update(state, POP3_DELETE_SEND);*/
pop3_gen_send(sock, "DELE %d", state->cur_msg);
pop3_gen_send(sock, "DELE %d", state->cur_msg);
@@
-381,6
+404,12
@@
gint pop3_delete_recv(SockInfo *sock, gpointer data)
if ((ok = pop3_ok(sock, NULL)) == PS_SUCCESS) {
if (state->cur_msg < state->count) {
state->cur_msg++;
if ((ok = pop3_ok(sock, NULL)) == PS_SUCCESS) {
if (state->cur_msg < state->count) {
state->cur_msg++;
+ while (state->sizes[state->cur_msg] == 0) {
+ if (state->cur_msg == state->count)
+ return POP3_LOGOUT_SEND;
+ else
+ state->cur_msg++;
+ }
return POP3_RETR_SEND;
} else
return POP3_LOGOUT_SEND;
return POP3_RETR_SEND;
} else
return POP3_LOGOUT_SEND;