[Pkg-nagios-changes] [SCM] Debian packaging for mod gearman. branch, master, updated. f5edd3e88aa2138dcf6d044c835fbd0ada944168
Sven Nierlein
sven at nierlein.org
Fri Feb 11 11:18:25 UTC 2011
The following commit has been merged in the master branch:
commit 1c475d2d2b4da94a36f045d2edafa482e83e27a2
Author: Sven Nierlein <sven at nierlein.org>
Date: Mon Jan 31 15:55:07 2011 +0100
added encryption test in debug mode
diff --git a/common/gearman.c b/common/gearman.c
index 91fe02d..99a15f5 100644
--- a/common/gearman.c
+++ b/common/gearman.c
@@ -171,6 +171,20 @@ int add_job_to_queue( gearman_client_st *client, char ** server_list, char * que
size = mod_gm_encrypt(&crypted_data, data, transport_mode);
gm_log( GM_LOG_TRACE, "%d +++>\n%s\n<+++\n", size, crypted_data );
+#ifdef GM_DEBUG
+ /* verify decrypted string is equal to the original */
+ char * test;
+ test = malloc(GM_BUFFERSIZE);
+ mod_gm_decrypt(&test, crypted_data, transport_mode);
+ gm_log( GM_LOG_TRACE, "%d ===>\n%s\n<===\n", size, test );
+ if(strcmp(test, data)) {
+ gm_log( GM_LOG_ERROR, "%d --->%s<---\n", strlen(data), data );
+ gm_log( GM_LOG_ERROR, "%d ===>\n%s\n<===\n", size, test );
+ fprintf(stderr, "encrypted string does not match\n");
+ exit(EXIT_FAILURE);
+ }
+#endif
+
if( priority == GM_JOB_PRIO_LOW ) {
task = gearman_client_add_task_low_background( client, NULL, NULL, queue, uniq, ( void * )crypted_data, ( size_t )size, &ret1 );
gearman_task_give_workload(task,crypted_data,size);
--
Debian packaging for mod gearman.
More information about the Pkg-nagios-changes
mailing list