[Pkg-privacy-commits] [irssi-plugin-otr] 165/267: Fix: key.c comments and add asserts

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 12:41:39 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository irssi-plugin-otr.

commit 1f2eecb4b48f2ef00aed81fcde46d53c256deb64
Author: David Goulet <dgoulet at ev0ke.net>
Date:   Sat Dec 1 21:17:12 2012 -0500

    Fix: key.c comments and add asserts
    
    Signed-off-by: David Goulet <dgoulet at ev0ke.net>
---
 src/key.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/key.c b/src/key.c
index addf3b9..45f8aa4 100644
--- a/src/key.c
+++ b/src/key.c
@@ -39,6 +39,9 @@ static struct key_gen_data key_gen_state = {
 
 static pthread_t keygen_thread;
 
+/*
+ * Build file path concatenate to the irssi config dir.
+ */
 static char *file_path_build(const char *path)
 {
 	int ret;
@@ -78,6 +81,12 @@ static void reset_key_gen_state(void)
 	key_gen_state.gcry_error = GPG_ERR_NO_ERROR;
 }
 
+/*
+ * Generate OTR key. Thread in the background.
+ *
+ * NOTE: NO irssi interaction should be done here like emitting signals or else
+ * it causes a segfaults of libperl.
+ */
 static void *generate_key(void *data)
 {
 	gcry_error_t err;
@@ -99,6 +108,9 @@ error:
 	return NULL;
 }
 
+/*
+ * Check key generation state and print message to user according to state.
+ */
 void key_gen_check(void)
 {
 	gcry_error_t err;
@@ -140,6 +152,9 @@ void key_gen_run(struct otr_user_state *ustate, const char *account_name)
 	int ret;
 	gcry_error_t err;
 
+	assert(ustate);
+	assert(account_name);
+
 	if (key_gen_state.status != KEY_GEN_IDLE) {
 		IRSSI_INFO(NULL, NULL, "Key generation for %s is still in progress. ",
 				"Please wait until completion before creating a new key.",

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/irssi-plugin-otr.git



More information about the Pkg-privacy-commits mailing list