changeset 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 7fa5d10969f4
children c8962b52579e
files libpurple/certificate.c libpurple/certificate.h
diffstat 2 files changed, 42 insertions(+), 0 deletions(-) [+]
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)
 {
--- 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);
+
 /*@}*/
 
 /*****************************************************************************/