[Gpa-commits] r910 - trunk/src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Oct 15 18:35:38 CEST 2008


Author: werner
Date: 2008-10-15 18:35:37 +0200 (Wed, 15 Oct 2008)
New Revision: 910

Modified:
   trunk/src/ChangeLog
   trunk/src/server.c
Log:
Support --protocol option for command SENDER.


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2008-10-04 13:24:23 UTC (rev 909)
+++ trunk/src/ChangeLog	2008-10-15 16:35:37 UTC (rev 910)
@@ -1,3 +1,8 @@
+2008-10-15  Werner Koch  <wk at g10code.com>
+
+	* server.c (struct conn_ctrl_s): Add SENDER_PROTOCOL_HINT.
+	(cmd_sender): Parse --protocol option.
+
 2008-09-19  Moritz  <moritz at gnu.org>
 
 	* siglist.c (gpa_siglist_set_userid): Call gtk_list_store_clear

Modified: trunk/src/server.c
===================================================================
--- trunk/src/server.c	2008-10-04 13:24:23 UTC (rev 909)
+++ trunk/src/server.c	2008-10-15 16:35:37 UTC (rev 910)
@@ -96,6 +96,7 @@
      the sender ist just informational. */
   gchar *sender;
   int sender_just_info;
+  gpgme_protocol_t sender_protocol_hint;
 
   /* Session information:  A session number and a malloced title or NULL.  */
   unsigned int session_number;
@@ -817,15 +818,24 @@
 cmd_sender (assuan_context_t ctx, char *line)
 {
   conn_ctrl_t ctrl = assuan_get_pointer (ctx);
-  gpg_error_t err = 0;
+  gpg_error_t err;
+  gpgme_protocol_t protocol;
 
+  err = parse_protocol_option (ctx, line, 0, &protocol);
+  if (err)
+    goto leave;
+
   ctrl->sender_just_info = has_option (line, "--info");
+
   line = skip_options (line);
 
   xfree (ctrl->sender);
   ctrl->sender = NULL;
   if (*line)
     ctrl->sender = xstrdup (line);
+  
+  if (!err)
+    ctrl->sender_protocol_hint = protocol;
 
   return assuan_process_done (ctx, err);
 }
@@ -846,6 +856,7 @@
     {
       xfree (ctrl->sender);
       ctrl->sender = NULL;
+      ctrl->sender_protocol_hint = GPGME_PROTOCOL_UNKNOWN;
     }
   assuan_process_done (ctx, err);
 }
@@ -1599,6 +1610,7 @@
   release_files (ctrl);
   xfree (ctrl->sender);
   ctrl->sender = NULL;
+  ctrl->sender_protocol_hint = GPGME_PROTOCOL_UNKNOWN;
   finish_io_streams (ctx, NULL, NULL, NULL);
   close_message_fd (ctrl);
   assuan_close_input_fd (ctx);



More information about the Gpa-commits mailing list