Changeset 1417

Show
Ignore:
Timestamp:
01/16/07 11:07:47
Author:
pvanhoof
Message:

Bugfixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libtinymail-camel/camel-lite/camel/camel-tcp-stream-ssl.c

    r1081 r1417  
    9292        gboolean ssl_mode; 
    9393        guint32 flags; 
     94        gboolean accepted; 
    9495}; 
    9596 
     
    859860        CERTCertificate *cert; 
    860861        SECStatus status = SECFailure; 
     862        struct _CamelTcpStreamSSLPrivate *priv = ssl->priv; 
    861863 
    862864        g_return_val_if_fail (data != NULL, SECFailure); 
     
    907909        camel_certdb_cert_unref(certdb, ccert); 
    908910        camel_object_unref(certdb); 
     911 
     912        priv->accepted = accept; 
    909913 
    910914        return accept ? SECSuccess : SECFailure; 
  • trunk/libtinymail-camel/camel-lite/camel/camel-url.c

    r1027 r1417  
    206206                url->user = g_strdup (base->user); 
    207207                url->authmech = g_strdup (base->authmech); 
    208                 url->passwd = g_strdup (base->passwd); 
     208                if (base->passwd) 
     209                        url->passwd = g_strdup (base->passwd); 
     210                else url->passwd = NULL; 
    209211                url->host = g_strdup (base->host); 
    210212                url->port = base->port; 
     
    414416                g_free (url->query); 
    415417                g_free (url->fragment); 
    416                  
     418 
     419                memset (url, 0, sizeof (CamelURL)); 
    417420                g_free (url); 
    418421        } 
     
    704707        CamelURL *out; 
    705708 
    706         out = g_malloc(sizeof(*out)); 
     709        out = g_malloc0(sizeof(*out)); 
    707710        out->protocol = g_strdup(in->protocol); 
    708711        out->user = g_strdup(in->user); 
    709712        out->authmech = g_strdup(in->authmech); 
    710         out->passwd = g_strdup(in->passwd); 
     713        if (in->passwd) 
     714                out->passwd = g_strdup(in->passwd); 
    711715        out->host = g_strdup(in->host); 
    712716        out->port = in->port; 
  • trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-command.c

    r1096 r1417  
    786786                                string = camel_utf8_utf7(string); 
    787787                        } 
    788                                  
    789                         arglen = strlen (string); 
     788 
     789                        if (string) 
     790                                arglen = strlen (string); 
    790791                        g_ptr_array_add (args, string); 
    791792                        if (imap_is_atom (string)) { 
  • trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c

    r1406 r1417  
    14151415                        authenticated = try_auth (store, authtype->authproto, ex); 
    14161416                else { 
     1417 
     1418                        if (!service->url->passwd) 
     1419                        { 
     1420                                camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, 
     1421                                                     _("You did not enter a password.")); 
     1422                                return FALSE; 
     1423                        } 
     1424 
    14171425                        response = camel_imap_command (store, NULL, ex, 
    14181426                                                       "LOGIN %S %S", 
  • trunk/libtinymail-camel/camel-lite/camel/providers/smtp/camel-smtp-transport.c

    r1287 r1417  
    531531                                 
    532532                                service->url->passwd = camel_session_get_password (session, service, NULL, 
    533                                                                                   prompt, "password", CAMEL_SESSION_PASSWORD_SECRET, ex); 
     533                                                prompt, "password", CAMEL_SESSION_PASSWORD_SECRET, ex); 
    534534                                 
    535535                                g_free (prompt); 
  • trunk/libtinymail-camel/tny-session-camel-priv.h

    r1400 r1417  
    1212        gboolean in_auth_function; 
    1313        TnyLockable *ui_lock; 
     14        GMutex *colock; 
    1415}; 
    1516 
  • trunk/libtinymail-camel/tny-session-camel.c

    r1408 r1417  
    250250        gchar *retval = NULL, *prmpt = (gchar*)prompt; 
    251251        GetPassWaitResults results; 
    252         GThread *thread; 
     252        GThread *thread; gboolean inf; 
    253253 
    254254        while (G_LIKELY (copy)) 
     
    281281                                tny_session_camel_forget_password (session, service, domain, item, ex); 
    282282                } 
     283 
     284 
     285 
     286                inf = priv->in_auth_function; 
     287                if (inf) return; 
     288 
     289                g_mutex_lock (priv->colock); 
    283290 
    284291                priv->in_auth_function = TRUE; 
     
    303310                g_thread_join (thread); 
    304311 
    305  
    306                 tny_lockable_unlock (priv->ui_lock); 
    307                 tny_lockable_lock (priv->ui_lock); 
    308  
    309312                retval = results.data; 
    310313                cancel = results.cancel; 
     
    312315                priv->in_auth_function = FALSE; 
    313316 
     317                g_mutex_unlock (priv->colock); 
     318 
    314319                if (freeprmpt) 
    315320                        g_free (prmpt); 
    316         } 
    317  
    318         if (cancel) 
     321 
     322        } 
     323 
     324        if (cancel || retval == NULL) { 
    319325                camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, 
    320326                        _("You cancelled when you had to enter a password")); 
     327                retval = NULL; 
     328        } 
    321329 
    322330        return retval; 
     
    383391        gboolean found = FALSE; 
    384392        ForGetPassWaitResults results; 
    385         GThread *thread; 
     393        GThread *thread; gboolean inf; 
    386394 
    387395        while (G_LIKELY (copy)) 
     
    401409        if (G_LIKELY (found)) 
    402410        { 
     411 
     412                inf = priv->in_auth_function; 
     413                if (inf) return; 
     414 
     415                g_mutex_lock (priv->colock); 
     416 
    403417                priv->in_auth_function = TRUE; 
    404418 
     
    419433 
    420434                priv->in_auth_function = FALSE; 
     435 
     436                g_mutex_unlock (priv->colock); 
     437 
    421438        } 
    422439 
     
    467484        TnySessionCamel *self = (TnySessionCamel *)session; 
    468485        TnySessionCamelPriv *priv = self->priv; 
    469         GThread *thread; 
     486        GThread *thread; gboolean inf; 
    470487 
    471488        if (priv->account_store) 
     
    489506                } 
    490507 
     508                inf = priv->in_auth_function; 
     509                if (inf) return; 
     510 
     511                g_mutex_lock (priv->colock); 
     512 
    491513                priv->in_auth_function = TRUE; 
    492514 
     
    508530 
    509531                priv->in_auth_function = FALSE; 
     532 
     533                g_mutex_unlock (priv->colock); 
    510534 
    511535                g_free (results.prompt); 
     
    602626 
    603627static void  
    604 my_cancel_func (struct _CamelOperation *op, const char *what, int pc, void *data) 
     628my_cancel_func (struct _CamelOperation *op, const char *what, int sofar, int oftotal, void *data) 
    605629{ 
    606630        return; 
     
    643667        priv = instance->priv; 
    644668 
     669        priv->colock = g_mutex_new (); 
    645670        priv->prev_constat = FALSE; 
    646671        priv->device = NULL; 
     
    763788        TnySessionCamelPriv *priv = self->priv; 
    764789        BackgroundConnectInfo *info; 
    765  
    766         if (priv->in_auth_function) 
    767                 return; 
     790        gboolean inf; 
     791 
     792        inf = priv->in_auth_function; 
     793        if (inf) return; 
    768794 
    769795        info = g_slice_new (BackgroundConnectInfo); 
     
    890916        if (priv->camel_dir) 
    891917                g_free (priv->camel_dir); 
     918 
     919        g_mutex_free (priv->colock); 
    892920 
    893921        g_slice_free (TnySessionCamelPriv, self->priv); 
  • trunk/libtinymail-gnome-desktop/tny-gnome-account-store.c

    r1398 r1417  
    132132                                        "PLAIN", 0, retval, &item_id); 
    133133                        } 
    134                 } 
     134                } else retval = NULL; 
    135135 
    136136                *cancel = (!canc);