int imap_command(int sockfd, const char *command, char *response, const char *verify)
{
- struct timeval timeout;
+ struct timeval fetchtimeout;
fd_set fdset;
int res, numbytes = 0;
if (send(sockfd, command, strlen(command), 0) == -1) {
perror("send");
return -1;
}
- timeout.tv_sec = 60; // 60 second timeout i guess
- timeout.tv_usec = 0;
+ fetchtimeout.tv_sec = 60; // 60 second timeout i guess
+ fetchtimeout.tv_usec = 0;
FD_ZERO(&fdset);
FD_SET(sockfd, &fdset);
- res = select(sockfd + 1, &fdset, NULL, NULL, &timeout);
+ res = select(sockfd + 1, &fdset, NULL, NULL, &fetchtimeout);
if (res > 0) {
if ((numbytes = recv(sockfd, response, MAXDATASIZE - 1, 0)) == -1) {
perror("recv");
}
#endif /* HAVE_GETHOSTBYNAME_R */
while (fail < mail->retries) {
- struct timeval timeout;
+ struct timeval fetchtimeout;
int res;
fd_set fdset;
break;
}
- timeout.tv_sec = 60; // 60 second timeout i guess
- timeout.tv_usec = 0;
+ fetchtimeout.tv_sec = 60; // 60 second timeout i guess
+ fetchtimeout.tv_usec = 0;
FD_ZERO(&fdset);
FD_SET(sockfd, &fdset);
- res = select(sockfd + 1, &fdset, NULL, NULL, &timeout);
+ res = select(sockfd + 1, &fdset, NULL, NULL, &fetchtimeout);
if (res > 0) {
if ((numbytes = recv(sockfd, recvbuf, MAXDATASIZE - 1, 0)) == -1) {
perror("recv");
* RFC 2177 says we have to re-idle every 29 minutes.
* We'll do it every 20 minutes to be safe.
*/
- timeout.tv_sec = 1200;
- timeout.tv_usec = 0;
+ fetchtimeout.tv_sec = 1200;
+ fetchtimeout.tv_usec = 0;
DBGP2("idling...");
FD_ZERO(&fdset);
FD_SET(sockfd, &fdset);
* something other than 0, or we had a timeout
*/
buf = recvbuf;
- if (recent > 0 || (buf && strstr(buf, " FETCH ")) || timeout.tv_sec == 0 || force_check) {
+ if (recent > 0 || (buf && strstr(buf, " FETCH ")) || fetchtimeout.tv_sec == 0 || force_check) {
// re-check messages and unseen
if (imap_command(sockfd, "DONE\r\n", recvbuf, "a5 OK")) {
fail++;
fail++;
break;
}
- timeout.tv_sec = 60; // 60 second timeout i guess
- timeout.tv_usec = 0;
+ fetchtimeout.tv_sec = 60; // 60 second timeout i guess
+ fetchtimeout.tv_usec = 0;
FD_ZERO(&fdset);
FD_SET(sockfd, &fdset);
- res = select(sockfd + 1, &fdset, NULL, NULL, &timeout);
+ res = select(sockfd + 1, &fdset, NULL, NULL, &fetchtimeout);
if (res > 0) {
if ((numbytes = recv(sockfd, recvbuf, MAXDATASIZE - 1, 0)) == -1) {
perror("recv a3");
int pop3_command(int sockfd, const char *command, char *response, const char *verify)
{
- struct timeval timeout;
+ struct timeval fetchtimeout;
fd_set fdset;
int res, numbytes = 0;
if (send(sockfd, command, strlen(command), 0) == -1) {
perror("send");
return -1;
}
- timeout.tv_sec = 60; // 60 second timeout i guess
- timeout.tv_usec = 0;
+ fetchtimeout.tv_sec = 60; // 60 second timeout i guess
+ fetchtimeout.tv_usec = 0;
FD_ZERO(&fdset);
FD_SET(sockfd, &fdset);
- res = select(sockfd + 1, &fdset, NULL, NULL, &timeout);
+ res = select(sockfd + 1, &fdset, NULL, NULL, &fetchtimeout);
if (res > 0) {
if ((numbytes = recv(sockfd, response, MAXDATASIZE - 1, 0)) == -1) {
perror("recv");
}
#endif /* HAVE_GETHOSTBYNAME_R */
while (fail < mail->retries) {
- struct timeval timeout;
+ struct timeval fetchtimeout;
int res;
fd_set fdset;
break;
}
- timeout.tv_sec = 60; // 60 second timeout i guess
- timeout.tv_usec = 0;
+ fetchtimeout.tv_sec = 60; // 60 second timeout i guess
+ fetchtimeout.tv_usec = 0;
FD_ZERO(&fdset);
FD_SET(sockfd, &fdset);
- res = select(sockfd + 1, &fdset, NULL, NULL, &timeout);
+ res = select(sockfd + 1, &fdset, NULL, NULL, &fetchtimeout);
if (res > 0) {
if ((numbytes = recv(sockfd, recvbuf, MAXDATASIZE - 1, 0)) == -1) {
perror("recv");