Author: poeml Date: Fri Apr 23 02:47:38 2010 New Revision: 8039 URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8039&view=rev Log: mod_mirrorbrain: - if zsync data is available, the mirrorlist displays a zsync link now - the checks for availability of zsync data that were done before generating a zsync were broken (a misplaced variable name) - a stray dot was removed in the log message related to the previous commit - in .md5, .sha1, .sha256 links, the delimiter between the hash and the filename is now a single space, and not two of them, as the "md5sum" tool writes (for which I don't understand the reason) 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=8039&r1=8038&r2=8039&view=diff ============================================================================== --- trunk/mod_mirrorbrain/mod_mirrorbrain.c (original) +++ trunk/mod_mirrorbrain/mod_mirrorbrain.c Fri Apr 23 02:47:38 2010 _at_@ -898,7 +898,7 @@ const char *errmsg = apr_dbd_error(dbd->driver, dbd->handle, rv); ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r, "[mod_mirrorbrain] Could not retrieve row from database for %s " - "(size: %s, mtime %s): %s. Likely cause: there are no hashes in " + "(size: %s, mtime %s): %s Likely cause: there are no hashes in " "the database (yet).", filename, apr_off_t_toa(r->pool, r->finfo.size), _at_@ -1468,7 +1468,7 @@ if (h && h[0]) { ap_set_content_type(r, "text/plain; charset=UTF-8"); - ap_rprintf(r, "%s %s\n", h, basename); + ap_rprintf(r, "%s %s\n", h, basename); return OK; } return HTTP_NOT_FOUND; _at_@ -2474,6 +2474,12 @@ r->hostname, r->uri, r->hostname, r->uri); ap_rprintf(r, " <br/><a href=\"http://%s%s.magnet\">http://%s%s.magnet</a> (Magnet)\n", r->hostname, r->uri, r->hostname, r->uri); + if (hashbag->sha1hex && (hashbag->zblocksize > 0) + && hashbag->zhashlens && hashbag->zsumshex) { + ap_rprintf(r, " <br/>zsync Link:\n<br/>" + " <a href=\"http://%s%s.zsync\">http://%s%s.zsync</a>\n", + r->hostname, r->uri, r->hostname, r->uri); + } } ap_rputs(" </blockquote>", r); _at_@ -2718,10 +2724,11 @@ case ZSYNC: - if (!hashbag || (hashbag->sha1hex <= 0) || !hashbag->zhashlens - || (hashbag->zblocksize == 0) || !hashbag->zhashlens) { + if (!hashbag || !hashbag->sha1hex || (hashbag->zblocksize == 0) + || !hashbag->zhashlens || !hashbag->zsumshex) { debugLog(r, cfg, "zsync requested, but required data is missing"); break; + /* FIXME: we should return a 404 here maybe, no? */ } debugLog(r, cfg, "Sending zsync"); _______________________________________________ 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.orgReceived on Fri Apr 23 2010 - 00:47:42 GMT
This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT