FreeStrBuf(&ptr->IO.SendBuf.Buf);
FreeStrBuf(&ptr->IO.RecvBuf.Buf);
DeleteAsyncMsg(&ptr->IO.ReadMsg);
- ((struct CitContext*)ptr->IO.CitContext)->state = CON_IDLE;
- ((struct CitContext*)ptr->IO.CitContext)->kill_me = 1;
+ if (((struct CitContext*)ptr->IO.CitContext)) {
+ ((struct CitContext*)ptr->IO.CitContext)->state = CON_IDLE;
+ ((struct CitContext*)ptr->IO.CitContext)->kill_me = 1;
+ }
FreeAsyncIOContents(&ptr->IO);
free(ptr);
}
return eSendReply;
}
+
+ /*
+ * work around buggy pop3 servers which send
+ * empty lines in their listings.
+ */
+ if ((StrLength(RecvMsg->IO.IOBuf) == 0) ||
+ !isdigit(ChrPtr(RecvMsg->IO.IOBuf)[0]))
+ {
+ return eReadMore;
+ }
+
OneMsg = (FetchItem*) malloc(sizeof(FetchItem));
memset(OneMsg, 0, sizeof(FetchItem));
OneMsg->MSGID = atol(ChrPtr(RecvMsg->IO.IOBuf));
DeletePOP3Aggregator);
pthread_mutex_unlock(&POP3QueueMutex);
+ pLine = pLine->next;
}
}