aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/pop3
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-04-06 11:52:39 +0800
committerDan Winship <danw@src.gnome.org>2000-04-06 11:52:39 +0800
commit2e4a5463075e387151afcdf61b74202a729944db (patch)
tree451716a6b189f11de18346a86716cbedf010f609 /camel/providers/pop3
parent080049ac37387efd71551bfdb661e15c0e1ce8ce (diff)
downloadgsoc2013-evolution-2e4a5463075e387151afcdf61b74202a729944db.tar.gz
gsoc2013-evolution-2e4a5463075e387151afcdf61b74202a729944db.tar.zst
gsoc2013-evolution-2e4a5463075e387151afcdf61b74202a729944db.zip
the URL RFC says the port must be numeric, so we don't want to do
* g_url_new really wanted to take a CamelException. So, rename Gurl to CamelURL, g_url_* to camel_url_* (with camel_url_new taking an exception), and url-util.[ch] to camel-url.[ch]. Also force url->port to be numeric and remove camel_service_getport. (I was confused before: the URL RFC says the port must be numeric, so we don't want to do getportbyname.) svn path=/trunk/; revision=2300
Diffstat (limited to 'camel/providers/pop3')
-rw-r--r--camel/providers/pop3/camel-pop3-store.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
index 543a6ce532..f14ed1dc55 100644
--- a/camel/providers/pop3/camel-pop3-store.c
+++ b/camel/providers/pop3/camel-pop3-store.c
@@ -40,8 +40,8 @@
#include "camel-stream-fs.h"
#include "camel-session.h"
#include "camel-exception.h"
+#include "camel-url.h"
#include "md5-utils.h"
-#include "url-util.h"
/* Specified in RFC 1939 */
#define POP3_PORT 110
@@ -205,7 +205,7 @@ pop3_connect (CamelService *service, CamelException *ex)
{
struct hostent *h;
struct sockaddr_in sin;
- int port, fd, status, apoplen;
+ int fd, status, apoplen;
char *buf, *apoptime, *pass;
CamelPop3Store *store = CAMEL_POP3_STORE (service);
@@ -215,9 +215,6 @@ pop3_connect (CamelService *service, CamelException *ex)
h = camel_service_gethost (service, ex);
if (!h)
return FALSE;
- port = camel_service_getport (service, "pop3", POP3_PORT, "tcp", ex);
- if (port == -1)
- return FALSE;
pass = g_strdup (service->url->passwd);
if (!pass) {
@@ -233,7 +230,7 @@ pop3_connect (CamelService *service, CamelException *ex)
}
sin.sin_family = h->h_addrtype;
- sin.sin_port = port;
+ sin.sin_port = htons (service->url->port ? service->url->port : POP3_PORT);
memcpy (&sin.sin_addr, h->h_addr, sizeof (sin.sin_addr));
fd = socket (h->h_addrtype, SOCK_STREAM, 0);