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

From: <poeml_at_mirrorbrain.org>
Date: Thu, 19 Apr 2012 21:40:04 -0000
Author: poeml
Date: Thu Apr 19 23:40:04 2012
New Revision: 8285

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8285&view=rev
Log:
mod_mirrorbrain: rename hex_decode() function to hex_to_bin() for clarity

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=8285&r1=8284&r2=8285&view=diff
==============================================================================
--- trunk/mod_mirrorbrain/mod_mirrorbrain.c	(original)
+++ trunk/mod_mirrorbrain/mod_mirrorbrain.c	Thu Apr 19 23:40:04 2012
_at_@ -32,7 +32,7 @@
  * apr_memcache, ssl_scache_memcache.c */
 
 
-/* Copyright notice for the hex_decode() function
+/* Copyright notice for the hex_to_bin() function (hex_decode())
  *
  * Copyright (c) 2001-2009, PostgreSQL Global Development Group
  *
_at_@ -1118,7 +1118,7 @@
     return (char) res;
 }
 
-static char *hex_decode(apr_pool_t *p, const char *src, unsigned dstlen)
+static char *hex_to_bin(apr_pool_t *p, const char *src, unsigned dstlen)
 {
     const char *s, *srcend;
     char *dst;
_at_@ -1150,7 +1150,7 @@
 {
     char *bin, *encoded;
 
-    bin = hex_decode(p, src, binlen);
+    bin = hex_to_bin(p, src, binlen);
 
     encoded = (char *) apr_palloc(p, 1 + apr_base64_encode_len(binlen));
     binlen = apr_base64_encode(encoded, bin, binlen);
_at_@ -3293,15 +3293,15 @@
                                              (hashbag->sha1pieceshex->nelts * SHA1_DIGESTSIZE));
         char **p = (char **)hashbag->sha1pieceshex->elts;
         for (i = 0; i < hashbag->sha1pieceshex->nelts; i++) {
-            ap_rwrite(hex_decode(r->pool, p[i], SHA1_DIGESTSIZE), SHA1_DIGESTSIZE, r);
+            ap_rwrite(hex_to_bin(r->pool, p[i], SHA1_DIGESTSIZE), SHA1_DIGESTSIZE, r);
         }
         ap_rprintf(r,             "4:sha1"
                                       "%d:", SHA1_DIGESTSIZE);
-        ap_rwrite(                    hex_decode(r->pool, hashbag->sha1hex, SHA1_DIGESTSIZE), 
+        ap_rwrite(                    hex_to_bin(r->pool, hashbag->sha1hex, SHA1_DIGESTSIZE), 
                 SHA1_DIGESTSIZE, r);
         ap_rprintf(r,             "6:sha256"
                                       "%d:", SHA256_DIGESTSIZE);
-        ap_rwrite(                    hex_decode(r->pool, hashbag->sha256hex, SHA256_DIGESTSIZE), 
+        ap_rwrite(                    hex_to_bin(r->pool, hashbag->sha256hex, SHA256_DIGESTSIZE), 
                 SHA256_DIGESTSIZE, r);
 
         /* end of info hash: */
_at_@ -3487,7 +3487,7 @@
             return OK;
         }
         int l = strlen(hashbag->zsumshex);
-        ap_rwrite(hex_decode(r->pool, hashbag->zsumshex, l/2), 
+        ap_rwrite(hex_to_bin(r->pool, hashbag->zsumshex, l/2), 
                   l/2, r);
         return OK;
 




_______________________________________________
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 Thu Apr 19 2012 - 21:40:04 GMT

This archive was generated by hypermail 2.3.0 : Thu Apr 19 2012 - 21:47:04 GMT