Remove default_ports.

* camel-provider.h: Remove default_ports.

	* camel-remote-store.c (remote_connect): Get default_port from
	CamelRemoteStore rather than CamelProvider.

	* providers/{imap,nntp,pop3}/camel-*-store.c: Initialize
	CamelRemoteStore::default_port

	* providers/*/camel-*-provider.c: Remove default_ports.

svn path=/trunk/; revision=5669
This commit is contained in:
Dan Winship
2000-10-02 20:14:57 +00:00
parent bfe2227dd0
commit 853d2b99ff
16 changed files with 24 additions and 20 deletions

View File

@ -1,3 +1,15 @@
2000-10-02 Dan Winship <danw@helixcode.com>
* camel-provider.h: Remove default_ports.
* camel-remote-store.c (remote_connect): Get default_port from
CamelRemoteStore rather than CamelProvider.
* providers/{imap,nntp,pop3}/camel-*-store.c: Initialize
CamelRemoteStore::default_port
* providers/*/camel-*-provider.c: Remove default_ports.
2000-10-02 Dan Winship <danw@helixcode.com>
* camel-folder.[ch]: Remove

View File

@ -79,7 +79,6 @@ typedef struct {
int flags;
CamelType object_types [CAMEL_NUM_PROVIDER_TYPES];
gint default_ports [CAMEL_NUM_PROVIDER_TYPES];
GHashTable *service_cache;

View File

@ -218,13 +218,8 @@ remote_connect (CamelService *service, CamelException *ex)
if (service->url->port)
port = service->url->port;
else {
CamelProvider *prov = camel_service_get_provider (service);
port = prov->default_ports[CAMEL_PROVIDER_STORE];
g_assert (port); /* a remote service MUST define a valid default port */
}
else
port = store->default_port;
sin.sin_port = htons (port);
memcpy (&sin.sin_addr, h->h_addr, sizeof (sin.sin_addr));

View File

@ -42,7 +42,7 @@ typedef struct {
CamelStore parent_object;
CamelStream *istream, *ostream;
guint timeout_id;
guint timeout_id, default_port;
} CamelRemoteStore;

View File

@ -38,7 +38,6 @@ static CamelProvider cache_provider = {
0,
{ 0, 0 },
{ 0, 0 }
};

View File

@ -45,7 +45,6 @@ static CamelProvider imap_provider = {
CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE | CAMEL_PROVIDER_IS_STORAGE,
{ 0, 0 },
{ 143, 0 },
NULL
};

View File

@ -100,12 +100,15 @@ static void
camel_imap_store_init (gpointer object, gpointer klass)
{
CamelService *service = CAMEL_SERVICE (object);
CamelRemoteStore *remote_store = CAMEL_REMOTE_STORE (object);
CamelImapStore *imap_store = CAMEL_IMAP_STORE (object);
service->url_flags |= (CAMEL_SERVICE_URL_NEED_USER |
CAMEL_SERVICE_URL_NEED_HOST |
CAMEL_SERVICE_URL_ALLOW_PATH |
CAMEL_SERVICE_URL_ALLOW_AUTH);
remote_store->default_port = 143;
imap_store->dir_sep = NULL;
imap_store->current_folder = NULL;

View File

@ -40,7 +40,6 @@ static CamelProvider mbox_provider = {
CAMEL_PROVIDER_IS_SOURCE | CAMEL_PROVIDER_IS_STORAGE,
{ 0, 0 },
{ 0, 0 },
NULL

View File

@ -39,7 +39,6 @@ static CamelProvider mh_provider = {
CAMEL_PROVIDER_IS_STORAGE,
{0, 0},
{0, 0},
NULL

View File

@ -39,7 +39,6 @@ static CamelProvider news_provider = {
CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_STORAGE,
{ 0, 0 },
{ 119, 0 },
NULL
};
@ -56,7 +55,6 @@ static CamelProvider nntp_provider = {
CAMEL_PROVIDER_IS_REMOTE,
{ 0, 0 },
{ 119, 0 },
NULL
};

View File

@ -386,8 +386,10 @@ static void
camel_nntp_store_init (gpointer object, gpointer klass)
{
CamelService *service = CAMEL_SERVICE (object);
CamelRemoteStore *remote_store = CAMEL_REMOTE_STORE (object);
service->url_flags = CAMEL_SERVICE_URL_NEED_HOST;
remote_store->default_port = 119;
}
CamelType

View File

@ -42,7 +42,6 @@ static CamelProvider pop3_provider = {
CAMEL_PROVIDER_IS_REMOTE | CAMEL_PROVIDER_IS_SOURCE,
{ 0, 0 },
{ 110, 0 },
NULL
};

View File

@ -113,9 +113,12 @@ static void
camel_pop3_store_init (gpointer object, gpointer klass)
{
CamelService *service = CAMEL_SERVICE (object);
CamelRemoteStore *remote_store = CAMEL_REMOTE_STORE (object);
service->url_flags |= (CAMEL_SERVICE_URL_NEED_USER | CAMEL_SERVICE_URL_NEED_HOST |
service->url_flags |= (CAMEL_SERVICE_URL_NEED_USER |
CAMEL_SERVICE_URL_NEED_HOST |
CAMEL_SERVICE_URL_ALLOW_AUTH);
remote_store->default_port = 110;
}
CamelType

View File

@ -40,7 +40,6 @@ static CamelProvider sendmail_provider = {
0,
{ 0, 0 },
{ 0, 0 },
NULL

View File

@ -40,7 +40,6 @@ static CamelProvider smtp_provider = {
0,
{ 0, 0 },
{ 0, 25 },
NULL
};

View File

@ -35,7 +35,6 @@ static CamelProvider vee_provider = {
0,
{ 0, 0 },
{ 0, 0 },
NULL