lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev Bugs in SHOW_KB_RATE [PATCH]


From: Doug Kaufman
Subject: lynx-dev Bugs in SHOW_KB_RATE [PATCH]
Date: Tue, 28 Nov 2000 23:34:42 -0800 (PST)

I finally compiled and tested dev.14 in regard to the recent changes
in SHOW_KB_RATE, which added the NONE option and allowed control of
the ETA display. There appear to be two problems. The first is that
many of the changes were made #ifdef EXP_READPROGRESS, which made
control of expression of KB rate nonfunctional if EXP_READPROGRESS was
not defined. It had functioned before the recent change. The other
problem is that it appears to be implemented backwards. TRUE or KB
leads to showing bytes, while FALSE or BYTES leads to showing KB. I
have made some changes which I think restore the intent. I have not
compiled with EXP_READPROGRESS, however, so I have not been able to
check those functions, but they seem to be OK. Please let me know if
these changes are not what was intended.
                           Doug

--- lynx2-8-4/src/HTAlert.c     Tue Nov 28 22:51:12 2000
+++ lynx2-8-4/src/HTAlert.c.new Tue Nov 28 22:53:26 2000
@@ -145,9 +145,9 @@
     }
 
     u = kbunits;
-    if ((LYTransferRate == rateBYTES) && (n >= 10 * kb_units))
+    if ((LYTransferRate == rateKB) && (n >= 10 * kb_units))
        sprintf(s, "%ld", n/kb_units);
-    else if ((LYTransferRate == rateBYTES) && (n >= kb_units))
+    else if ((LYTransferRate == rateKB) && (n >= kb_units))
        sprintf(s, "%.2g", ((double)n)/kb_units);
     else {
        sprintf(s, "%ld", n);
--- lynx2-8-4/src/LYMain.c      Fri Nov 24 19:01:46 2000
+++ lynx2-8-4/src/LYMain.c.new  Tue Nov 28 22:56:40 2000
@@ -432,7 +432,7 @@
 PUBLIC char *LYCookieFile = NULL;      /* cookie read file */
 PUBLIC char *LYCookieSaveFile = NULL;  /* cookie save file */
 #endif /* EXP_PERSISTENT_COOKIES */
-PUBLIC int LYTransferRate = rateBYTES;
+PUBLIC int LYTransferRate = rateKB;
 PUBLIC char *XLoadImageCommand = NULL; /* Default image viewer for X */
 PUBLIC BOOLEAN LYNoISMAPifUSEMAP = FALSE; /* Omit ISMAP link if MAP present? */
 PUBLIC int LYHiddenLinks = HIDDENLINKS_SEPARATE; /* Show hidden links? */
--- lynx2-8-4/src/LYOptions.c   Wed Oct 25 17:59:24 2000
+++ lynx2-8-4/src/LYOptions.c.new       Tue Nov 28 07:47:04 2000
@@ -2343,6 +2343,13 @@
        { rateEtaBYTES,         "Show Bytes/sec, ETA",  "rate_eta_bytes" },
        { rateEtaKB,            "Show KB/sec, ETA",     "rate_eta_kb" },
        { 0, 0, 0 }};
+#else
+static char * show_rate_string         = "show_rate";
+static OptValues rate_values[] = {
+       { rateOFF,              "Do not show rate",     "rate_off" },
+       { rateBYTES,            "Show Bytes/sec rate",  "rate_bytes" },
+       { rateKB,               "Show KB/sec rate",     "rate_kb" },
+       { 0, 0, 0 }};
 #endif /* EXP_READPROGRESS */
 
 /*
@@ -2901,12 +2908,10 @@
        }
 
        /* Show Transfer Rate: enumerated value */
-#ifdef EXP_READPROGRESS
        if (!strcmp(data[i].tag, show_rate_string)
         && GetOptValues(rate_values, data[i].value, &code)) {
            LYTransferRate = code;
        }
-#endif
 
        /* Preferred Document Character Set: INPUT */
        if (!strcmp(data[i].tag, preferred_doc_char_string)) {
--- lynx2-8-4/src/LYReadCFG.c   Mon Nov 27 23:19:10 2000
+++ lynx2-8-4/src/LYReadCFG.c.new       Mon Nov 27 23:20:32 2000
@@ -1126,6 +1126,21 @@
     config_enum(table, value, &LYTransferRate);
     return 0;
 }
+#else
+static int transfer_rate_fun ARGS1(
+       char *,         value)
+{
+    static Config_Enum table[] = {
+       { "NONE",       rateOFF },
+       { "KB",         rateKB },
+       { "TRUE",       rateKB },
+       { "BYTES",      rateBYTES },
+       { "FALSE",      rateBYTES },
+       { NULL,         -1 },
+    };
+    config_enum(table, value, &LYTransferRate);
+    return 0;
+}
 #endif
 static int viewer_fun ARGS1(
        char *,         value)
@@ -1584,9 +1599,7 @@
      PARSE_SET("seek_frag_map_in_cur", CONF_BOOL, &LYSeekFragMAPinCur),
      PARSE_SET("set_cookies", CONF_BOOL, &LYSetCookies),
      PARSE_SET("show_cursor", CONF_BOOL, &LYShowCursor),
-#ifdef EXP_READPROGRESS
      PARSE_SET("show_kb_rate", CONF_FUN, transfer_rate_fun),
-#endif
      PARSE_ENV("snews_proxy", CONF_ENV, 0 ),
      PARSE_ENV("snewspost_proxy", CONF_ENV, 0 ),
      PARSE_ENV("snewsreply_proxy", CONF_ENV, 0 ),

__ 
Doug Kaufman
Internet: address@hidden


; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]