Mercurial > pidgin
comparison libpurple/connection.c @ 20115:a68d51d60177
Create purple_connection_ssl_error(), which converts a PurpleSslErrorType
to a PurpleDisconnectReason then calls purple_connection_error_reason().
author | Will Thompson <will.thompson@collabora.co.uk> |
---|---|
date | Wed, 19 Sep 2007 15:00:48 +0000 |
parents | a465779350aa |
children | ec3471ab96d6 |
comparison
equal
deleted
inserted
replaced
20114:a465779350aa | 20115:a68d51d60177 |
---|---|
523 | 523 |
524 gc->disconnect_timeout = purple_timeout_add(0, purple_connection_disconnect_cb, | 524 gc->disconnect_timeout = purple_timeout_add(0, purple_connection_disconnect_cb, |
525 purple_connection_get_account(gc)); | 525 purple_connection_get_account(gc)); |
526 } | 526 } |
527 | 527 |
528 void | |
529 purple_connection_ssl_error (PurpleConnection *gc, | |
530 PurpleSslErrorType ssl_error) | |
531 { | |
532 PurpleDisconnectReason reason; | |
533 | |
534 switch (ssl_error) { | |
535 case PURPLE_SSL_HANDSHAKE_FAILED: | |
536 case PURPLE_SSL_CONNECT_FAILED: | |
537 reason = PURPLE_REASON_ENCRYPTION_ERROR; | |
538 break; | |
539 case PURPLE_SSL_CERTIFICATE_INVALID: | |
540 /* TODO: maybe PURPLE_SSL_* should be more specific? */ | |
541 reason = PURPLE_REASON_CERT_OTHER_ERROR; | |
542 break; | |
543 default: | |
544 g_assert_not_reached (); | |
545 reason = PURPLE_REASON_ENCRYPTION_ERROR; | |
546 } | |
547 | |
548 purple_connection_error_reason (gc, reason, purple_ssl_strerror(ssl_error)); | |
549 } | |
550 | |
528 gboolean | 551 gboolean |
529 purple_connection_reason_is_fatal (PurpleDisconnectReason reason) | 552 purple_connection_reason_is_fatal (PurpleDisconnectReason reason) |
530 { | 553 { |
531 switch (reason) | 554 switch (reason) |
532 { | 555 { |