Changeset 1417
- Timestamp:
- 01/16/07 11:07:47
- Files:
-
- trunk/libtinymail-camel/camel-lite/camel/camel-tcp-stream-ssl.c (modified) (3 diffs)
- trunk/libtinymail-camel/camel-lite/camel/camel-url.c (modified) (3 diffs)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-command.c (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/providers/smtp/camel-smtp-transport.c (modified) (1 diff)
- trunk/libtinymail-camel/tny-session-camel-priv.h (modified) (1 diff)
- trunk/libtinymail-camel/tny-session-camel.c (modified) (14 diffs)
- trunk/libtinymail-gnome-desktop/tny-gnome-account-store.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libtinymail-camel/camel-lite/camel/camel-tcp-stream-ssl.c
r1081 r1417 92 92 gboolean ssl_mode; 93 93 guint32 flags; 94 gboolean accepted; 94 95 }; 95 96 … … 859 860 CERTCertificate *cert; 860 861 SECStatus status = SECFailure; 862 struct _CamelTcpStreamSSLPrivate *priv = ssl->priv; 861 863 862 864 g_return_val_if_fail (data != NULL, SECFailure); … … 907 909 camel_certdb_cert_unref(certdb, ccert); 908 910 camel_object_unref(certdb); 911 912 priv->accepted = accept; 909 913 910 914 return accept ? SECSuccess : SECFailure; trunk/libtinymail-camel/camel-lite/camel/camel-url.c
r1027 r1417 206 206 url->user = g_strdup (base->user); 207 207 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; 209 211 url->host = g_strdup (base->host); 210 212 url->port = base->port; … … 414 416 g_free (url->query); 415 417 g_free (url->fragment); 416 418 419 memset (url, 0, sizeof (CamelURL)); 417 420 g_free (url); 418 421 } … … 704 707 CamelURL *out; 705 708 706 out = g_malloc (sizeof(*out));709 out = g_malloc0(sizeof(*out)); 707 710 out->protocol = g_strdup(in->protocol); 708 711 out->user = g_strdup(in->user); 709 712 out->authmech = g_strdup(in->authmech); 710 out->passwd = g_strdup(in->passwd); 713 if (in->passwd) 714 out->passwd = g_strdup(in->passwd); 711 715 out->host = g_strdup(in->host); 712 716 out->port = in->port; trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-command.c
r1096 r1417 786 786 string = camel_utf8_utf7(string); 787 787 } 788 789 arglen = strlen (string); 788 789 if (string) 790 arglen = strlen (string); 790 791 g_ptr_array_add (args, string); 791 792 if (imap_is_atom (string)) { trunk/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-store.c
r1406 r1417 1415 1415 authenticated = try_auth (store, authtype->authproto, ex); 1416 1416 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 1417 1425 response = camel_imap_command (store, NULL, ex, 1418 1426 "LOGIN %S %S", trunk/libtinymail-camel/camel-lite/camel/providers/smtp/camel-smtp-transport.c
r1287 r1417 531 531 532 532 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); 534 534 535 535 g_free (prompt); trunk/libtinymail-camel/tny-session-camel-priv.h
r1400 r1417 12 12 gboolean in_auth_function; 13 13 TnyLockable *ui_lock; 14 GMutex *colock; 14 15 }; 15 16 trunk/libtinymail-camel/tny-session-camel.c
r1408 r1417 250 250 gchar *retval = NULL, *prmpt = (gchar*)prompt; 251 251 GetPassWaitResults results; 252 GThread *thread; 252 GThread *thread; gboolean inf; 253 253 254 254 while (G_LIKELY (copy)) … … 281 281 tny_session_camel_forget_password (session, service, domain, item, ex); 282 282 } 283 284 285 286 inf = priv->in_auth_function; 287 if (inf) return; 288 289 g_mutex_lock (priv->colock); 283 290 284 291 priv->in_auth_function = TRUE; … … 303 310 g_thread_join (thread); 304 311 305 306 tny_lockable_unlock (priv->ui_lock);307 tny_lockable_lock (priv->ui_lock);308 309 312 retval = results.data; 310 313 cancel = results.cancel; … … 312 315 priv->in_auth_function = FALSE; 313 316 317 g_mutex_unlock (priv->colock); 318 314 319 if (freeprmpt) 315 320 g_free (prmpt); 316 } 317 318 if (cancel) 321 322 } 323 324 if (cancel || retval == NULL) { 319 325 camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL, 320 326 _("You cancelled when you had to enter a password")); 327 retval = NULL; 328 } 321 329 322 330 return retval; … … 383 391 gboolean found = FALSE; 384 392 ForGetPassWaitResults results; 385 GThread *thread; 393 GThread *thread; gboolean inf; 386 394 387 395 while (G_LIKELY (copy)) … … 401 409 if (G_LIKELY (found)) 402 410 { 411 412 inf = priv->in_auth_function; 413 if (inf) return; 414 415 g_mutex_lock (priv->colock); 416 403 417 priv->in_auth_function = TRUE; 404 418 … … 419 433 420 434 priv->in_auth_function = FALSE; 435 436 g_mutex_unlock (priv->colock); 437 421 438 } 422 439 … … 467 484 TnySessionCamel *self = (TnySessionCamel *)session; 468 485 TnySessionCamelPriv *priv = self->priv; 469 GThread *thread; 486 GThread *thread; gboolean inf; 470 487 471 488 if (priv->account_store) … … 489 506 } 490 507 508 inf = priv->in_auth_function; 509 if (inf) return; 510 511 g_mutex_lock (priv->colock); 512 491 513 priv->in_auth_function = TRUE; 492 514 … … 508 530 509 531 priv->in_auth_function = FALSE; 532 533 g_mutex_unlock (priv->colock); 510 534 511 535 g_free (results.prompt); … … 602 626 603 627 static void 604 my_cancel_func (struct _CamelOperation *op, const char *what, int pc, void *data)628 my_cancel_func (struct _CamelOperation *op, const char *what, int sofar, int oftotal, void *data) 605 629 { 606 630 return; … … 643 667 priv = instance->priv; 644 668 669 priv->colock = g_mutex_new (); 645 670 priv->prev_constat = FALSE; 646 671 priv->device = NULL; … … 763 788 TnySessionCamelPriv *priv = self->priv; 764 789 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; 768 794 769 795 info = g_slice_new (BackgroundConnectInfo); … … 890 916 if (priv->camel_dir) 891 917 g_free (priv->camel_dir); 918 919 g_mutex_free (priv->colock); 892 920 893 921 g_slice_free (TnySessionCamelPriv, self->priv); trunk/libtinymail-gnome-desktop/tny-gnome-account-store.c
r1398 r1417 132 132 "PLAIN", 0, retval, &item_id); 133 133 } 134 } 134 } else retval = NULL; 135 135 136 136 *cancel = (!canc);
