summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2020-09-30 14:02:26 (GMT)
committerdgp <dgp@users.sourceforge.net>2020-09-30 14:02:26 (GMT)
commit4d4d50dc93778fa2443c61b728ae30620ccc73be (patch)
treecf4e39c2c2cef27da73454ad9524016d75a5797f
parent0188c9979dd99659c8a1c8507af1d33f648dc422 (diff)
parentaccd2800ecceb527ff9315ec011511b30f32a980 (diff)
downloadtcl-4d4d50dc93778fa2443c61b728ae30620ccc73be.zip
tcl-4d4d50dc93778fa2443c61b728ae30620ccc73be.tar.gz
tcl-4d4d50dc93778fa2443c61b728ae30620ccc73be.tar.bz2
merge 8.6
-rw-r--r--generic/tclZlib.c16
-rw-r--r--library/http/http.tcl6
-rw-r--r--tests/http.test3
3 files changed, 15 insertions, 10 deletions
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index 604ce64..bdda9bc 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -205,7 +205,7 @@ static void ZlibTransformTimerRun(ClientData clientData);
static const Tcl_ChannelType zlibChannelType = {
"zlib",
- TCL_CHANNEL_VERSION_3,
+ TCL_CHANNEL_VERSION_5,
ZlibTransformClose,
ZlibTransformInput,
ZlibTransformOutput,
@@ -2664,21 +2664,21 @@ ZlibStreamAddCmd(
switch ((enum addOptions) index) {
case ao_flush: /* -flush */
- if (flush > -1) {
+ if (flush >= 0) {
flush = -2;
} else {
flush = Z_SYNC_FLUSH;
}
break;
case ao_fullflush: /* -fullflush */
- if (flush > -1) {
+ if (flush >= 0) {
flush = -2;
} else {
flush = Z_FULL_FLUSH;
}
break;
case ao_finalize: /* -finalize */
- if (flush > -1) {
+ if (flush >= 0) {
flush = -2;
} else {
flush = Z_FINISH;
@@ -2788,21 +2788,21 @@ ZlibStreamPutCmd(
switch ((enum putOptions) index) {
case po_flush: /* -flush */
- if (flush > -1) {
+ if (flush >= 0) {
flush = -2;
} else {
flush = Z_SYNC_FLUSH;
}
break;
case po_fullflush: /* -fullflush */
- if (flush > -1) {
+ if (flush >= 0) {
flush = -2;
} else {
flush = Z_FULL_FLUSH;
}
break;
case po_finalize: /* -finalize */
- if (flush > -1) {
+ if (flush >= 0) {
flush = -2;
} else {
flush = Z_FINISH;
@@ -3683,7 +3683,7 @@ ZlibStackChannelTransform(
if (cd->inAllocated < cd->readAheadLimit) {
cd->inAllocated = cd->readAheadLimit;
}
- cd->inBuffer = ckalloc(cd->inAllocated);
+ cd->inBuffer = (char *)ckalloc(cd->inAllocated);
if (cd->flags & IN_HEADER) {
if (inflateGetHeader(&cd->inStream, &cd->inHeader.header) != Z_OK) {
goto error;
diff --git a/library/http/http.tcl b/library/http/http.tcl
index cce1828..abef596 100644
--- a/library/http/http.tcl
+++ b/library/http/http.tcl
@@ -733,6 +733,7 @@ proc http::geturl {url args} {
-strict boolean
-timeout integer
-validate boolean
+ -headers list
}
set state(charset) $defaultCharset
set options {
@@ -747,8 +748,9 @@ proc http::geturl {url args} {
if {[regexp -- $pat $flag]} {
# Validate numbers
if {
- [info exists type($flag)] &&
- ![string is $type($flag) -strict $value]
+ ([info exists type($flag)] &&
+ ![string is $type($flag) -strict $value]) ||
+ $flag eq "-headers" && [llength $value] %2 != 0
} {
unset $token
return -code error \
diff --git a/tests/http.test b/tests/http.test
index 636a651..15bc37f 100644
--- a/tests/http.test
+++ b/tests/http.test
@@ -448,6 +448,9 @@ test http-3.33 {http::geturl application/xml is text} -body {
} -cleanup {
catch { http::cleanup $token }
} -result {test 4660 /test}
+test http-3.34 {http::geturl -headers not a dict} -returnCodes error -body {
+ http::geturl http://test/t -headers NoDict
+} -result {Bad value for -headers (NoDict), must be list}
test http-4.1 {http::Event} -body {
set token [http::geturl $url -keepalive 0]