* Fixed filling the log in ReceiveLine() - ie. it's not done anymore there.
* Fixed error message in Open() when the server didn't return anything. * Made the pop3.h header self contained. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21804 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
171d3a85cb
commit
25c969f5a8
@ -7,28 +7,22 @@
|
|||||||
|
|
||||||
//! POP3Protocol - implementation of the POP3 protocol
|
//! POP3Protocol - implementation of the POP3 protocol
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include "pop3.h"
|
||||||
#include <stdio.h>
|
|
||||||
#include <DataIO.h>
|
|
||||||
#include <Alert.h>
|
|
||||||
#include <Debug.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <netdb.h>
|
||||||
#include <sys/time.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#ifndef HAIKU_TARGET_PLATFORM_BEOS // These headers don't exist in BeOS R5.
|
#include <sys/time.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#ifndef HAIKU_TARGET_PLATFORM_BEOS
|
||||||
|
// These headers don't exist in BeOS R5.
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <status.h>
|
|
||||||
#include <StringList.h>
|
|
||||||
#include <ProtocolConfigView.h>
|
|
||||||
#include <ChainRunner.h>
|
|
||||||
|
|
||||||
#include <MDRLanguage.h>
|
|
||||||
|
|
||||||
#if USESSL
|
#if USESSL
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
@ -37,7 +31,16 @@
|
|||||||
#include "md5.h"
|
#include "md5.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "pop3.h"
|
#include <DataIO.h>
|
||||||
|
#include <Alert.h>
|
||||||
|
#include <Debug.h>
|
||||||
|
|
||||||
|
#include <status.h>
|
||||||
|
#include <StringList.h>
|
||||||
|
#include <ProtocolConfigView.h>
|
||||||
|
#include <ChainRunner.h>
|
||||||
|
|
||||||
|
#include <MDRLanguage.h>
|
||||||
|
|
||||||
#define POP3_RETRIEVAL_TIMEOUT 60000000
|
#define POP3_RETRIEVAL_TIMEOUT 60000000
|
||||||
#define CRLF "\r\n"
|
#define CRLF "\r\n"
|
||||||
@ -206,8 +209,12 @@ POP3Protocol::Open(const char *server, int port, int)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (strncmp(line.String(), "+OK", 3) != 0) {
|
if (strncmp(line.String(), "+OK", 3) != 0) {
|
||||||
error_msg << MDR_DIALECT_CHOICE(". The server said:\n",
|
if (line.Length() > 0) {
|
||||||
"サーバのメッセージです\n") << line.String();
|
error_msg << MDR_DIALECT_CHOICE(". The server said:\n",
|
||||||
|
"サーバのメッセージです\n") << line.String();
|
||||||
|
} else
|
||||||
|
error_msg << ": No reply.\n";
|
||||||
|
|
||||||
runner->ShowError(error_msg.String());
|
runner->ShowError(error_msg.String());
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
@ -623,14 +630,8 @@ POP3Protocol::ReceiveLine(BString &line)
|
|||||||
line += (char)c;
|
line += (char)c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else
|
||||||
status_t error = errno;
|
return errno;
|
||||||
fLog = "POP3 ";
|
|
||||||
fLog << strerror(error) << ".";
|
|
||||||
|
|
||||||
runner->Stop(true);
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,23 @@
|
|||||||
#ifndef ZOIDBERG_POP3_H
|
/*
|
||||||
#define ZOIDBERG_POP3_H
|
* Copyright 2001-2002 Dr. Zoidberg Enterprises. All rights reserved.
|
||||||
/* POP3Protocol - implementation of the POP3 protocol
|
* Copyright 2007, Haiku Inc. All Rights Reserved.
|
||||||
**
|
*
|
||||||
** Copyright 2001-2002 Dr. Zoidberg Enterprises. All rights reserved.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
#ifndef POP3_H
|
||||||
|
#define POP3_H
|
||||||
|
|
||||||
|
|
||||||
#include <String.h>
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
#include <List.h>
|
||||||
|
#include <String.h>
|
||||||
|
|
||||||
#include "SimpleMailProtocol.h"
|
#include "SimpleMailProtocol.h"
|
||||||
|
|
||||||
|
|
||||||
class POP3Protocol : public SimpleMailProtocol {
|
class POP3Protocol : public SimpleMailProtocol {
|
||||||
public:
|
public:
|
||||||
POP3Protocol(BMessage *settings, BMailChainRunner *status);
|
POP3Protocol(BMessage *settings, BMailChainRunner *status);
|
||||||
~POP3Protocol();
|
~POP3Protocol();
|
||||||
|
|
||||||
@ -50,4 +56,4 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* ZOIDBERG_POP3_H */
|
#endif /* POP3_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user