# HG changeset patch # User William Ehlhardt # Date 1186721992 0 # Node ID f5802217844d349e2ab98eae736a5e4e37992ec7 # Parent 7fa5d10969f4a110f60ab717c5db442ea74bdfdd - Add verify_complete, which should deprecate verify_destroy diff -r 7fa5d10969f4 -r f5802217844d libpurple/certificate.c --- a/libpurple/certificate.c Fri Aug 10 04:30:03 2007 +0000 +++ b/libpurple/certificate.c Fri Aug 10 04:59:52 2007 +0000 @@ -99,6 +99,37 @@ g_free(vrq); } +void +purple_certificate_verify_complete(PurpleCertificateVerificationRequest *vrq, + PurpleCertificateVerificationStatus st) +{ + PurpleCertificateVerifier *vr; + + g_return_if_fail(vrq); + + /* Pass the results on to the request's callback */ + (vrq->cb)(st, vrq->cb_data); + + /* And now to eliminate the request */ + /* Fetch the Verifier responsible... */ + vr = vrq->verifier; + /* ...and order it to KILL */ + (vr->destroy_request)(vrq); + + /* Now the internals have been cleaned up, so clean up the libpurple- + created elements */ + g_free(vrq->subject_name); + purple_certificate_destroy_list(vrq->cert_chain); + + /* A structure born + * to much ado + * and with so much within. + * It reaches now + * its quiet end. */ + g_free(vrq); +} + + PurpleCertificate * purple_certificate_copy(PurpleCertificate *crt) { diff -r 7fa5d10969f4 -r f5802217844d libpurple/certificate.h --- a/libpurple/certificate.h Fri Aug 10 04:30:03 2007 +0000 +++ b/libpurple/certificate.h Fri Aug 10 04:59:52 2007 +0000 @@ -369,6 +369,17 @@ void purple_certificate_verify_destroy (PurpleCertificateVerificationRequest *vrq); +/** + * Completes and destroys a VerificationRequest + * + * @param vrq Request to conclude + * @param st Success/failure code to pass to the request's + * completion callback. + */ +void +purple_certificate_verify_complete(PurpleCertificateVerificationRequest *vrq, + PurpleCertificateVerificationStatus st); + /*@}*/ /*****************************************************************************/