Eek! So the service's URL isn't set until after this is initialized. This
authorJeffrey Stedfast <fejj@ximian.com>
Thu, 15 Mar 2001 00:51:09 +0000 (00:51 +0000)
committerJeffrey Stedfast <fejj@src.gnome.org>
Thu, 15 Mar 2001 00:51:09 +0000 (00:51 +0000)
2001-03-14  Jeffrey Stedfast  <fejj@ximian.com>

* providers/imap/camel-imap-store.c (camel_imap_store_init): Eek!
So the service's URL isn't set until after this is
initialized. This means we can't check for SSL here.
(imap_connect): Set the SSL options here instead.

camel/ChangeLog
camel/camel-tcp-stream-ssl.c
camel/camel.c
camel/providers/imap/camel-imap-store.c

index 43c70ba..5413446 100644 (file)
@@ -1,5 +1,12 @@
 2001-03-14  Jeffrey Stedfast  <fejj@ximian.com>
 
+       * providers/imap/camel-imap-store.c (camel_imap_store_init): Eek!
+       So the service's URL isn't set until after this is
+       initialized. This means we can't check for SSL here.
+       (imap_connect): Set the SSL options here instead.
+
+2001-03-14  Jeffrey Stedfast  <fejj@ximian.com>
+
        * camel-tcp-stream-ssl.c: Numerous fixes to get it to build
        correctly with NSS enabled.
 
index 42c50ec..e34cef0 100644 (file)
@@ -182,7 +182,7 @@ static ssize_t
 stream_write (CamelStream *stream, const char *buffer, size_t n)
 {
        CamelTcpStreamSSL *tcp_stream_ssl = CAMEL_TCP_STREAM_SSL (stream);
-       ssize_t written;
+       ssize_t written = 0;
        
        do {
                written = PR_Write (tcp_stream_ssl->sockfd, buffer, n);
index 4aa4512..38ad4a9 100644 (file)
@@ -54,7 +54,7 @@ camel_init (const char *certdb)
 #ifdef HAVE_NSS
        PR_Init (PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 10);
        
-       if (NSS_Init (certdb) == SECFailure) {
+       if (NSS_Init ("/home/fejj/.mozilla/default") == SECFailure) {
                g_warning ("Failed to initialize NSS");
                return -1;
        }
index db1c1f9..dd25bea 100644 (file)
@@ -144,17 +144,9 @@ camel_imap_store_init (gpointer object, gpointer klass)
        CamelRemoteStore *remote_store = CAMEL_REMOTE_STORE (object);
        CamelImapStore *imap_store = CAMEL_IMAP_STORE (object);
        CamelStore *store = CAMEL_STORE (object);
-       CamelURL *url;
        
-       url = CAMEL_SERVICE (store)->url;
-       
-       if (!g_strcasecmp (url->protocol, "imaps")) {
-               remote_store->default_port = 993;
-               remote_store->use_ssl = TRUE;
-       } else {
-               remote_store->default_port = 143;
-               remote_store->use_ssl = FALSE;
-       }
+       remote_store->default_port = 143;
+       remote_store->use_ssl = FALSE;
        
        imap_store->dir_sep = '\0';
        imap_store->current_folder = NULL;
@@ -401,12 +393,19 @@ imap_connect (CamelService *service, CamelException *ex)
 {
        CamelImapStore *store = CAMEL_IMAP_STORE (service);
        CamelSession *session = camel_service_get_session (service);
+       CamelServiceAuthType *authtype = NULL;
        char *result, *errbuf = NULL, *name;
-       CamelImapResponse *response;
        gboolean authenticated = FALSE;
+       CamelImapResponse *response;
        int len, i, flags;
-       CamelServiceAuthType *authtype = NULL;
-
+       
+       if (!g_strcasecmp (service->url->protocol, "imaps")) {
+               CamelRemoteStore *rstore = CAMEL_REMOTE_STORE (service);
+               
+               rstore->default_port = 993;
+               rstore->use_ssl = TRUE;
+       }
+       
        if (connect_to_server (service, ex) == 0)
                return FALSE;