CamelGpgContext: Fix broken debugging statements.
authorMatthew Barnes <mbarnes@redhat.com>
Fri, 6 Dec 2013 17:05:50 +0000 (12:05 -0500)
committerMatthew Barnes <mbarnes@redhat.com>
Fri, 6 Dec 2013 17:09:45 +0000 (12:09 -0500)
Camel likes to use this debugging idiom:

  #define d(x)

and then wraps debugging statements like so:

  d (printf (...));

One is supposed to enable debugging by changing the macro to:

  #define d(x) x

This idiom makes debugging statements hard to grep for, but moreover
they don't get compiled regularly and so they tend to bit rot.

As was the case in CamelGpgContext, where the debugging statements
didn't build because they were still written for Camel's old home-
grown object system.

camel/camel-gpg-context.c

index 7878cb8..36b6937 100644 (file)
@@ -1667,10 +1667,11 @@ gpg_sign_sync (CamelCipherContext *context,
                CamelStream *out;
 
                name = g_strdup_printf ("camel-gpg.%d.sign-data", logid++);
-               out = camel_stream_fs_new_with_name (name, O_CREAT | O_TRUNC | O_WRONLY, 0666);
+               out = camel_stream_fs_new_with_name (
+                       name, O_CREAT | O_TRUNC | O_WRONLY, 0666, NULL);
                if (out) {
                        printf ("Writing gpg signing data to '%s'\n", name);
-                       camel_stream_write_to_stream (istream, out);
+                       camel_stream_write_to_stream (istream, out, NULL, NULL);
                        g_seekable_seek (
                                G_SEEKABLE (istream), 0,
                                G_SEEK_SET, NULL, NULL);
@@ -1837,10 +1838,11 @@ gpg_verify_sync (CamelCipherContext *context,
                CamelStream *out;
 
                name = g_strdup_printf ("camel-gpg.%d.verify.data", logid);
-               out = camel_stream_fs_new_with_name (name, O_CREAT | O_TRUNC | O_WRONLY, 0666);
+               out = camel_stream_fs_new_with_name (
+                       name, O_CREAT | O_TRUNC | O_WRONLY, 0666, NULL);
                if (out) {
                        printf ("Writing gpg verify data to '%s'\n", name);
-                       camel_stream_write_to_stream (istream, out);
+                       camel_stream_write_to_stream (istream, out, NULL, NULL);
                        g_seekable_seek (
                                G_SEEKABLE (istream),
                                0, G_SEEK_SET, NULL, NULL);
@@ -1851,10 +1853,13 @@ gpg_verify_sync (CamelCipherContext *context,
 
                if (sigpart) {
                        name = g_strdup_printf ("camel-gpg.%d.verify.signature", logid++);
-                       out = camel_stream_fs_new_with_name (name, O_CREAT | O_TRUNC | O_WRONLY, 0666);
+                       out = camel_stream_fs_new_with_name (
+                               name, O_CREAT | O_TRUNC | O_WRONLY, 0666, NULL);
                        if (out) {
                                printf ("Writing gpg verify signature to '%s'\n", name);
-                               camel_data_wrapper_write_to_stream ((CamelDataWrapper *) sigpart, out);
+                               camel_data_wrapper_write_to_stream_sync (
+                                       CAMEL_DATA_WRAPPER (sigpart),
+                                       out, NULL, NULL);
                                g_object_unref (out);
                        }
                        g_free (name);