diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2012-11-14 01:19:06 -0500 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2012-11-14 01:19:06 -0500 |
commit | 2352039c35ba8754f60ca45c24d46e253766b4e0 (patch) | |
tree | 31d9037b3b90ef000fe2a42bc56fcf679cca9b79 | |
parent | 9eebe49d8e59d0fed4ea8b2b3ef40d6221e9fea3 (diff) | |
download | lynx-snapshots-2352039c35ba8754f60ca45c24d46e253766b4e0.tar.gz |
snapshot of project "lynx", label v2-8-8dev_14e
-rw-r--r-- | CHANGES | 8 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTTCP.c | 10 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTTP.c | 9 | ||||
-rw-r--r-- | lynx.cfg | 4 | ||||
-rw-r--r-- | src/HTAlert.c | 45 | ||||
-rw-r--r-- | src/LYGlobalDefs.h | 8 | ||||
-rw-r--r-- | src/LYOptions.c | 4 | ||||
-rw-r--r-- | src/LYrcFile.c | 4 |
8 files changed, 67 insertions, 25 deletions
diff --git a/CHANGES b/CHANGES index 48cfa599..c8ce5d4b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,10 +1,14 @@ --- $LynxId: CHANGES,v 1.626 2012/11/13 09:35:51 tom Exp $ +-- $LynxId: CHANGES,v 1.628 2012/11/14 01:15:50 tom Exp $ =============================================================================== Changes since Lynx 2.8 release =============================================================================== 2012-11-13 (2.8.8dev.15) -* correct typo for -bibhost option in manpage (Redhat #854574). +* provide more readable ETA message as an option (prompted by patch by Joerg + Hahn) -TD +* add GNUTLS call to enable SNI (Server Name Indication) extension (Ubuntu + #732177) -TD +* correct typo for -bibhost option in manpage (Redhat #854574) -TD * revise nsl-fork logic for passing addrinfo and hostent data back to eliminate fixed limit on the number of records to return -TD * correct problem with loop logic in fill_addrinfo() exposed by multiple diff --git a/WWW/Library/Implementation/HTTCP.c b/WWW/Library/Implementation/HTTCP.c index 8add800c..01b52674 100644 --- a/WWW/Library/Implementation/HTTCP.c +++ b/WWW/Library/Implementation/HTTCP.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTTCP.c,v 1.122 2012/11/13 10:49:38 tom Exp $ + * $LynxId: HTTCP.c,v 1.123 2012/11/13 21:35:01 tom Exp $ * * Generic Communication Code HTTCP.c * ========================== @@ -464,9 +464,9 @@ static unsigned read_hostent(int fd, char *buffer, size_t length) unsigned have = read_bytes(fd, buffer, length); if (have) { - LYNX_HOSTENT *data = (LYNX_HOSTENT *) buffer; + LYNX_HOSTENT *data = (LYNX_HOSTENT *) (void *) buffer; char *next_char = (char *) data + sizeof(*data); - char **next_ptr = (char **) next_char; + char **next_ptr = (char **) (void *) next_char; long offset = 0; int n; int num_addrs = 0; @@ -572,13 +572,13 @@ static size_t fill_rehostent(void **rehostent, outofmem(__FILE__, "fill_rehostent"); *rehostent = result; - data = (LYNX_HOSTENT *) result; + data = (LYNX_HOSTENT *) (void *) result; data->h_addrtype = phost->h_addrtype; data->h_length = phost->h_length; p_next_char = result + sizeof(LYNX_HOSTENT); - p_next_charptr = (char **) p_next_char; + p_next_charptr = (char **) (void *) p_next_char; if (phost->h_addr_list) p_next_char += (size_t) (num_addrs + 1) * sizeof(phost->h_addr_list[0]); if (phost->h_aliases) diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c index b265e11e..0a8f7411 100644 --- a/WWW/Library/Implementation/HTTP.c +++ b/WWW/Library/Implementation/HTTP.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTTP.c,v 1.125 2012/11/08 09:37:42 Jamie.Strandboge Exp $ + * $LynxId: HTTP.c,v 1.126 2012/11/13 22:49:46 tom Exp $ * * HyperText Tranfer Protocol - Client implementation HTTP.c * ========================== @@ -710,7 +710,12 @@ static int HTLoadHTTP(const char *arg, /* get host we're connecting to */ ssl_host = HTParse(url, "", PARSE_HOST); ssl_host = StripIpv6Brackets(ssl_host); -#if SSLEAY_VERSION_NUMBER >= 0x0900 +#if defined(USE_GNUTLS_FUNCS) + ret = gnutls_server_name_set(handle->gnutls_state, + GNUTLS_NAME_DNS, + ssl_host, strlen(ssl_host)); + CTRACE((tfp, "...called gnutls_server_name_set(%s) ->%d\n", ssl_host, ret)); +#elif SSLEAY_VERSION_NUMBER >= 0x0900 #ifndef USE_NSS_COMPAT_INCL if (!try_tls) { handle->options |= SSL_OP_NO_TLSv1; diff --git a/lynx.cfg b/lynx.cfg index 46a09f1a..2742afb5 100644 --- a/lynx.cfg +++ b/lynx.cfg @@ -1,4 +1,4 @@ -# $LynxId: lynx.cfg,v 1.220 2012/08/22 11:11:26 tom Exp $ +# $LynxId: lynx.cfg,v 1.222 2012/11/14 01:18:19 tom Exp $ # lynx.cfg file. # The default placement for this file is /usr/local/lib/lynx.cfg (Unix) # or Lynx_Dir:lynx.cfg (VMS) @@ -699,6 +699,8 @@ DEFAULT_INDEX_FILE:http://scout.wisc.edu/ # FALSE or BYTES for bytes/second. # KB,ETA to show Kilobytes/second with estimated completion time. # BYTES,ETA to show BYTES/second with estimated completion time. +# KB2,ETA to show Kilobytes/second with estimated completion time using 2-digits. +# BYTES2,ETA to show BYTES/second with estimated completion time using 2-digits. # Note that the "ETA" values are available if USE_READPROGRESS was defined. #SHOW_KB_RATE:TRUE diff --git a/src/HTAlert.c b/src/HTAlert.c index 4d7be6fc..a3e36dd5 100644 --- a/src/HTAlert.c +++ b/src/HTAlert.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTAlert.c,v 1.95 2012/02/08 01:45:28 tom Exp $ + * $LynxId: HTAlert.c,v 1.96 2012/11/14 01:19:06 tom Exp $ * * Displaying messages and getting input for Lynx Browser * ========================================================== @@ -167,6 +167,7 @@ const char *HTProgressUnits(int rate) return ((rate == rateKB) #ifdef USE_READPROGRESS || (rate == rateEtaKB) + || (rate == rateEtaKB2) #endif )? kbunits : bunits; } @@ -176,7 +177,7 @@ static const char *sprint_bytes(char *s, off_t n, const char *was_units) static off_t kb_units = 1024; const char *u = HTProgressUnits(LYTransferRate); - if (LYTransferRate == rateKB || LYTransferRate == rateEtaKB_maybe) { + if (isRateInKB(LYTransferRate)) { if (n >= 10 * kb_units) { sprintf(s, "%" PRI_off_t, CAST_off_t (n / kb_units)); } else if (n > 999) { /* Avoid switching between 1016b/s and 1K/s */ @@ -196,16 +197,40 @@ static const char *sprint_bytes(char *s, off_t n, const char *was_units) } #ifdef USE_READPROGRESS -#define TIME_HMS_LENGTH (16) +#define TIME_HMS_LENGTH (36) static char *sprint_tbuf(char *s, long t) { - if (t > 3600) - sprintf(s, "%ldh%ldm%lds", t / 3600, (t / 60) % 60, t % 60); - else if (t > 60) - sprintf(s, "%ldm%lds", t / 60, t % 60); - else - sprintf(s, "%ld sec", t); - return s; + const char *format = ((LYTransferRate == rateEtaBYTES2 || + LYTransferRate == rateEtaKB2) + ? "% 2ld%c" + : "%ld%c"); + char *base = s; + + if (t < 0) { + strcpy(s, "forever"); + } else { + if (t > (3600 * 24)) { + sprintf(s, format, t / (3600 * 24), 'd'); + s += strlen(s); + t %= (3600 * 24); + } + if (t > 3600) { + sprintf(s, format, t / 3600, 'h'); + s += strlen(s); + t %= 3600; + } + if (t > 60) { + sprintf(s, format, t / 60, 'm'); + s += strlen(s); + t %= 60; + } + if (s == base) { + sprintf(s, "% 2ld sec", t); + } else if (t != 0) { + sprintf(s, format, t, 's'); + } + } + return base; } #endif /* USE_READPROGRESS */ diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h index b352f91a..1fe79b0d 100644 --- a/src/LYGlobalDefs.h +++ b/src/LYGlobalDefs.h @@ -1,5 +1,5 @@ /* - * $LynxId: LYGlobalDefs.h,v 1.132 2012/07/04 23:34:06 tom Exp $ + * $LynxId: LYGlobalDefs.h,v 1.133 2012/11/14 01:09:44 tom Exp $ * * global variable definitions */ @@ -192,6 +192,8 @@ extern "C" { #ifdef USE_READPROGRESS ,rateEtaBYTES ,rateEtaKB + ,rateEtaBYTES2 + ,rateEtaKB2 #endif #ifdef USE_PROGRESSBAR ,rateBAR @@ -199,9 +201,9 @@ extern "C" { } TransferRate; #ifdef USE_READPROGRESS -# define rateEtaKB_maybe rateEtaKB +# define isRateInKB(n) ((n) == rateKB || (n) == rateEtaKB || (n) == rateEtaKB2) #else -# define rateEtaKB_maybe rateKB +# define isRateInKB(n) ((n) == rateKB) #endif #define TITLE_LINES 1 diff --git a/src/LYOptions.c b/src/LYOptions.c index 6d1822bb..d533a3dc 100644 --- a/src/LYOptions.c +++ b/src/LYOptions.c @@ -1,4 +1,4 @@ -/* $LynxId: LYOptions.c,v 1.149 2012/02/10 18:36:39 tom Exp $ */ +/* $LynxId: LYOptions.c,v 1.150 2012/11/14 01:07:12 tom Exp $ */ #include <HTUtils.h> #include <HTFTP.h> #include <HTTP.h> /* 'reloading' flag */ @@ -2381,6 +2381,8 @@ static OptValues rate_values[] = #ifdef USE_READPROGRESS {rateEtaBYTES, N_("Show %s/sec, ETA"), "rate_eta_bytes"}, {rateEtaKB, N_("Show %s/sec, ETA"), "rate_eta_kb"}, + {rateEtaBYTES2, N_("Show %s/sec (2-digits), ETA"), "rate_eta_bytes2"}, + {rateEtaKB2, N_("Show %s/sec (2-digits), ETA"), "rate_eta_kb2"}, #endif #ifdef USE_PROGRESSBAR {rateBAR, N_("Show progressbar"), "rate_bar"}, diff --git a/src/LYrcFile.c b/src/LYrcFile.c index db361455..67126ed0 100644 --- a/src/LYrcFile.c +++ b/src/LYrcFile.c @@ -1,4 +1,4 @@ -/* $LynxId: LYrcFile.c,v 1.89 2012/08/13 00:30:44 tom Exp $ */ +/* $LynxId: LYrcFile.c,v 1.90 2012/11/14 01:06:06 tom Exp $ */ #include <HTUtils.h> #include <HTFTP.h> #include <LYUtils.h> @@ -130,6 +130,8 @@ Config_Enum tbl_transfer_rate[] = { #ifdef USE_READPROGRESS { "KB,ETA", rateEtaKB }, { "BYTES,ETA", rateEtaBYTES }, + { "KB2,ETA", rateEtaKB2 }, + { "BYTES2,ETA", rateEtaBYTES2 }, #endif #ifdef USE_PROGRESSBAR { "METER", rateBAR }, |