#endif
#include "fetchmail.h"
+#include "socket.h"
#define PROTOCOL_ERROR {error(0, 0, "protocol error"); return(PS_ERROR);}
char buf [POPBUFSIZE+1];
char *bufp;
- if (fgets(buf, sizeof(buf), sockfp)) {
+ if (SockGets(buf, sizeof(buf), sockfp)) {
if (buf[strlen(buf)-1] == '\n')
buf[strlen(buf)-1] = '\0';
if (buf[strlen(buf)-1] == '\r')
int num;
*newp = 0;
- while (fgets(buf, sizeof(buf), sockfp))
+ while (SockGets(buf, sizeof(buf), sockfp))
{
if (buf[strlen(buf)-1] == '\n')
buf[strlen(buf)-1] = '\0';
else if (sscanf(buf, "%d %s", &num, id) == 2)
{
save_str(&ctl->newsaved, num, id);
+
+ /* note: ID comparison is caseblind */
if (!str_in_list(&ctl->oldsaved, id))
(*newp)++;
}
{
char buf [POPBUFSIZE+1];
- while (fgets(buf, sizeof(buf), sockfp))
+ while (SockGets(buf, sizeof(buf), sockfp))
{
int num, size;
if (!ctl->oldsaved)
return (num <= last);
else
+ /* note: ID comparison is caseblind */
return (str_in_list(&ctl->oldsaved,
str_find (&ctl->newsaved, num)));
}