All pastes #165945 Raw Edit

Stuff

public text v1 · immutable
·published 2006-09-10 11:20 UTC
rendered paste body
diff -ruN busybox-1.1.3.orig/networking/httpd.c busybox-1.1.3/networking/httpd.c
--- busybox-1.1.3.orig/networking/httpd.c       2006-09-10 21:03:25.000000000 +1000
+++ busybox-1.1.3/networking/httpd.c    2006-09-10 21:06:00.000000000 +1000
@@ -1029,9 +1029,10 @@

   /* emit the current date */
   strftime(timeStr, sizeof(timeStr), RFC1123FMT, gmtime(&timer));
+  /* Add Cache control to remove cache problems with redirects */
   len = sprintf(buf,
        "HTTP/1.0 %d %s\r\nContent-type: %s\r\n"
-       "Date: %s\r\nConnection: close\r\n",
+       "Date: %s\r\nConnection: close\r\nCache-Control: no-cache, max-age=1\r\n",
          responseNum, responseString, mime_type, timeStr);

 #ifdef CONFIG_FEATURE_HTTPD_BASIC_AUTH
@@ -1041,7 +1042,8 @@
   }
 #endif
   if(responseNum == HTTP_MOVED_TEMPORARILY) {
-       len += sprintf(buf+len, "Location: %s/%s%s\r\n",
+       /* Changed redirect to / for MW hotspot */
+       len += sprintf(buf+len, "Location: /\r\n",
                config->httpd_found.found_moved_temporarily,
                (config->query ? "?" : ""),
                (config->query ? config->query : ""));
@@ -1450,7 +1452,8 @@
 #if DEBUG
        bb_perror_msg("Unable to open '%s'", url);
 #endif
-       sendHeaders(HTTP_NOT_FOUND);
+       /* Changed below from HTTP_NOT_FOUND to a redirect for MW Hotspot */
+       sendHeaders(HTTP_MOVED_TEMPORARILY);
   }

   return 0;




$ cat httpd.c.rej
***************
*** 1029,1037 ****

    /* emit the current date */
    strftime(timeStr, sizeof(timeStr), RFC1123FMT, gmtime(&timer));
    len = sprintf(buf,
         "HTTP/1.0 %d %s\r\nContent-type: %s\r\n"
-        "Date: %s\r\nConnection: close\r\n",
           responseNum, responseString, mime_type, timeStr);

  #ifdef CONFIG_FEATURE_HTTPD_BASIC_AUTH
--- 1029,1038 ----

    /* emit the current date */
    strftime(timeStr, sizeof(timeStr), RFC1123FMT, gmtime(&timer));
+   /* Add Cache control to remove cache problems with redirects */
    len = sprintf(buf,
         "HTTP/1.0 %d %s\r\nContent-type: %s\r\n"
+        "Date: %s\r\nConnection: close\r\nCache-Control: no-cache, max-age=1\r\n",
           responseNum, responseString, mime_type, timeStr);

  #ifdef CONFIG_FEATURE_HTTPD_BASIC_AUTH
***************
*** 1041,1047 ****
    }
  #endif
    if(responseNum == HTTP_MOVED_TEMPORARILY) {
-        len += sprintf(buf+len, "Location: %s/%s%s\r\n",
                 config->httpd_found.found_moved_temporarily,
                 (config->query ? "?" : ""),
                 (config->query ? config->query : ""));
--- 1042,1049 ----
    }
  #endif
    if(responseNum == HTTP_MOVED_TEMPORARILY) {
+        /* Changed redirect to / for MW hotspot */
+        len += sprintf(buf+len, "Location: /\r\n",
                 config->httpd_found.found_moved_temporarily,
                 (config->query ? "?" : ""),
                 (config->query ? config->query : ""));
***************
*** 1450,1456 ****
  #if DEBUG
         bb_perror_msg("Unable to open '%s'", url);
  #endif
-        sendHeaders(HTTP_NOT_FOUND);
    }

    return 0;
--- 1452,1459 ----
  #if DEBUG
         bb_perror_msg("Unable to open '%s'", url);
  #endif
+        /* Changed below from HTTP_NOT_FOUND to a redirect for MW Hotspot */
+        sendHeaders(HTTP_MOVED_TEMPORARILY);
    }

    return 0;