[mirrorbrain-commits] r8018 - /trunk/mod_mirrorbrain/mod_mirrorbrain.c

From: <poeml_at_mirrorbrain.org>
Date: Sat, 27 Mar 2010 03:22:37 -0000
Author: poeml
Date: Sat Mar 27 04:22:36 2010
New Revision: 8018

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8018&view=rev
Log:
mod_mirrorbrain:
- handle zero-length files, which correcty have zero zsync checksums

Modified:
    trunk/mod_mirrorbrain/mod_mirrorbrain.c

Modified: trunk/mod_mirrorbrain/mod_mirrorbrain.c
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mod_mirrorbrain/mod_mirrorbrain.c?rev=8018&r1=8017&r2=8018&view=diff
==============================================================================
--- trunk/mod_mirrorbrain/mod_mirrorbrain.c (original)
+++ trunk/mod_mirrorbrain/mod_mirrorbrain.c Sat Mar 27 04:22:36 2010
_at_@ -2644,6 +2644,10 @@
         ap_rprintf(r, "URL: http://%s%s\n", r->hostname, r->uri);
         ap_rprintf(r, "SHA-1: %s\n\n", hashbag->sha1hex);
 
+        if (!hashbag->zsumshex || !hashbag->zsumshex[0]) {
+            /* A zero-length file will correctly have zero zsync checksums */
+            return OK;
+        }
         int l = strlen(hashbag->zsumshex);
         ap_rwrite(hex_decode(r, hashbag->zsumshex, l/2), 
                   l/2, r);




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Sat Mar 27 2010 - 03:22:38 GMT

This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT