[Xfce4-commits] <midori:master> Take soup status message into account in finish callback of web cache

Christian Dywan noreply at xfce.org
Mon Nov 23 20:58:03 CET 2009


Updating branch refs/heads/master
         to b8e0143bdc2cb3932b2e43e08c5e7c262bd4418b (commit)
       from c26d1775e9bbd781bf12756458ce0a11027510e8 (commit)

commit b8e0143bdc2cb3932b2e43e08c5e7c262bd4418b
Author: Alexander Butenko <a.butenka at gmail.com>
Date:   Mon Nov 23 20:42:22 2009 +0100

    Take soup status message into account in finish callback of web cache

 extensions/web-cache.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/extensions/web-cache.c b/extensions/web-cache.c
index 74b1691..f669b8e 100644
--- a/extensions/web-cache.c
+++ b/extensions/web-cache.c
@@ -226,8 +226,16 @@ web_cache_message_finished_cb (SoupMessage* msg,
     tmp_headers = g_strdup_printf ("%s.dsc.tmp", filename);
     tmp_data = g_strdup_printf ("%s.tmp", filename);
 
-    g_rename (tmp_data, filename);
-    g_rename (tmp_headers, headers);
+    if (msg->status_code == SOUP_STATUS_OK)
+    {
+        g_rename (tmp_data, filename);
+        g_rename (tmp_headers, headers);
+    }
+    else
+    {
+        g_unlink (tmp_data);
+        g_unlink (tmp_headers);
+    }
 
     g_free (headers);
     g_free (tmp_headers);



More information about the Xfce4-commits mailing list