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

From: <poeml_at_mirrorbrain.org>
Date: Tue, 16 Feb 2010 22:09:26 -0000
Author: poeml
Date: Tue Feb 16 23:09:24 2010
New Revision: 7962

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=7962&view=rev
Log:
mod_mirrorbrain: remove obsolete support for generation of
application/mirrorlist-txt mirror lists in plaintext

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=7962&r1=7961&r2=7962&view=diff
==============================================================================
--- trunk/mod_mirrorbrain/mod_mirrorbrain.c (original)
+++ trunk/mod_mirrorbrain/mod_mirrorbrain.c Tue Feb 16 23:09:24 2010
_at_@ -673,7 +673,7 @@
     const char *query_country = NULL;
     char *query_asn = NULL;
     char fakefile = 0, newmirror = 0;
-    char mirrorlist = 0, mirrorlist_txt = 0;
+    char mirrorlist = 0;
     char metalink_forced = 0;                   /* metalink was explicitely requested */
     char metalink = 0;                          /* metalink was negotiated */ 
                                                 /* for negotiated metalinks, the exceptions are observed. */
_at_@ -780,13 +780,11 @@
         query_asn[i] = '\0';
     }
 
-    if (!mirrorlist_txt && !metalink_forced && !mirrorlist) {
+    if (!metalink_forced && !mirrorlist) {
         const char *accepts;
         accepts = apr_table_get(r->headers_in, "Accept");
         if (accepts != NULL) {
-            if (ap_strstr_c(accepts, "mirrorlist-txt")) {
-                mirrorlist_txt = 1;
-            } else if (ap_strstr_c(accepts, "metalink+xml")) {
+            if (ap_strstr_c(accepts, "metalink+xml")) {
                 metalink = 1;
             } 
         }
_at_@ -1476,7 +1474,7 @@
     *
     * => best to sort the mirrors_same_country et al. individually, right?
     */
-    if (mirrorlist_txt || metalink || metalink_forced || mirrorlist) {
+    if (metalink || metalink_forced || mirrorlist) {
         qsort(mirrors_same_prefix->elts, mirrors_same_prefix->nelts, 
               mirrors_same_prefix->elt_size, cmp_mirror_rank);
         qsort(mirrors_same_as->elts, mirrors_same_as->nelts, 
_at_@ -1545,80 +1543,6 @@
                 mirrors_elsewhere->nelts);
     }
 
-    /* return a mirrorlist_txt instead of doing a redirect? */
-    if (mirrorlist_txt) {
-        debugLog(r, cfg, "Sending mirrorlist-txt");
-
-        /* tell caches that this is negotiated response and that not every client will take it */
-        apr_table_mergen(r->headers_out, "Vary", "accept");
-
-        ap_set_content_type(r, "application/mirrorlist-txt; charset=UTF-8");
-
-        ap_rputs("# mirrorlist-txt version=1.0\n", r);
-        ap_rputs("# url baseurl_len mirrorid region:country power\n", r);
-
-        mirrorp = (mirror_entry_t **)mirrors_same_prefix->elts;
-        for (i = 0; i < mirrors_same_prefix->nelts; i++) {
-            mirror = mirrorp[i];
-            ap_rprintf(r, "%s%s %d %d %s:%s %d\n", 
-                       mirror->baseurl, filename,
-                       (int) strlen(mirror->baseurl),
-                       mirror->id,
-                       mirror->region,
-                       mirror->country_code,
-                       mirror->score);
-        }
-
-        mirrorp = (mirror_entry_t **)mirrors_same_as->elts;
-        for (i = 0; i < mirrors_same_as->nelts; i++) {
-            mirror = mirrorp[i];
-            ap_rprintf(r, "%s%s %d %d %s:%s %d\n", 
-                       mirror->baseurl, filename,
-                       (int) strlen(mirror->baseurl),
-                       mirror->id,
-                       mirror->region,
-                       mirror->country_code,
-                       mirror->score);
-        }
-
-        mirrorp = (mirror_entry_t **)mirrors_same_country->elts;
-        for (i = 0; i < mirrors_same_country->nelts; i++) {
-            mirror = mirrorp[i];
-            ap_rprintf(r, "%s%s %d %d %s:%s %d\n", 
-                       mirror->baseurl, filename,
-                       (int) strlen(mirror->baseurl),
-                       mirror->id,
-                       mirror->region,
-                       mirror->country_code,
-                       mirror->score);
-        }
-
-        mirrorp = (mirror_entry_t **)mirrors_same_region->elts;
-        for (i = 0; i < mirrors_same_region->nelts; i++) {
-            mirror = mirrorp[i];
-            ap_rprintf(r, "%s%s %d %d %s:%s %d\n", 
-                       mirror->baseurl, filename,
-                       (int) strlen(mirror->baseurl),
-                       mirror->id,
-                       mirror->region,
-                       mirror->country_code,
-                       mirror->score);
-        }
-
-        mirrorp = (mirror_entry_t **)mirrors_elsewhere->elts;
-        for (i = 0; i < mirrors_elsewhere->nelts; i++) {
-            mirror = mirrorp[i];
-            ap_rprintf(r, "%s%s %d %d %s:%s %d\n", 
-                       mirror->baseurl, filename,
-                       (int) strlen(mirror->baseurl),
-                       mirror->id,
-                       mirror->region,
-                       mirror->country_code,
-                       mirror->score);
-        }
-
-        return OK;
-    } /* end mirrorlist-txt */
 
     /* return a metalink instead of doing a redirect? */
     if (metalink || metalink_forced) {




_______________________________________________
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 Tue Feb 16 2010 - 22:09:30 GMT

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