core: Make the status-fd monitor work for all gpgsm commands.
authorWerner Koch <wk@gnupg.org>
Wed, 9 May 2018 14:39:30 +0000 (16:39 +0200)
committerWerner Koch <wk@gnupg.org>
Wed, 9 May 2018 14:39:30 +0000 (16:39 +0200)
* src/engine-gpgsm.c (status_handler): Call the status monitor also
here.

Signed-off-by: Werner Koch <wk@gnupg.org>
src/engine-gpgsm.c

index da7e524..7b22183 100644 (file)
@@ -1013,8 +1013,17 @@ status_handler (void *opaque, int fd)
            *(rest++) = 0;
 
          r = _gpgme_parse_status (line + 2);
+          if (gpgsm->status.mon_cb && r != GPGME_STATUS_PROGRESS)
+            {
+              /* Note that we call the monitor even if we do
+               * not know the status code (r < 0).  */
+              err = gpgsm->status.mon_cb (gpgsm->status.mon_cb_value,
+                                          line + 2, rest);
+            }
+          else
+            err = 0;
 
-         if (r >= 0)
+         if (r >= 0 && !err)
            {
              if (gpgsm->status.fnc)
                 {