diff libpurple/certificate.c @ 19088:f5802217844d

- Add verify_complete, which should deprecate verify_destroy
author William Ehlhardt <williamehlhardt@gmail.com>
date Fri, 10 Aug 2007 04:59:52 +0000
parents e256e0bf8ae1
children c8962b52579e
line wrap: on
line diff
--- 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)
 {