From 0946b1961c3c20524d3190af3f09a966ce121210 Mon Sep 17 00:00:00 2001 From: hobbs Date: Thu, 21 Oct 1999 02:16:36 +0000 Subject: * library/http2.1/http.tcl: protected gets with catch [Bug: 2665] FossilOrigin-Name: 456c6c1d4c506aae6449bc63ed03d722d91943aa --- library/http/http.tcl | 6 ++++-- library/http2.1/http.tcl | 6 ++++-- library/http2.3/http.tcl | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/library/http/http.tcl b/library/http/http.tcl index c4da3d7..91a997b 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -9,7 +9,7 @@ # See the file "license.terms" for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: http.tcl,v 1.11 1999/10/05 22:46:00 hobbs Exp $ +# RCS: @(#) $Id: http.tcl,v 1.12 1999/10/21 02:16:37 hobbs Exp $ package provide http 2.1 ;# This uses Tcl namespaces @@ -349,7 +349,9 @@ proc http::cleanup {token} { return } if {[string equal $state(state) "header"]} { - set n [gets $s line] + if {[catch {gets $s line} n]} { + Finish $token $err + } if {$n == 0} { set state(state) body if {![regexp -nocase ^text $state(type)]} { diff --git a/library/http2.1/http.tcl b/library/http2.1/http.tcl index c4da3d7..91a997b 100644 --- a/library/http2.1/http.tcl +++ b/library/http2.1/http.tcl @@ -9,7 +9,7 @@ # See the file "license.terms" for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: http.tcl,v 1.11 1999/10/05 22:46:00 hobbs Exp $ +# RCS: @(#) $Id: http.tcl,v 1.12 1999/10/21 02:16:37 hobbs Exp $ package provide http 2.1 ;# This uses Tcl namespaces @@ -349,7 +349,9 @@ proc http::cleanup {token} { return } if {[string equal $state(state) "header"]} { - set n [gets $s line] + if {[catch {gets $s line} n]} { + Finish $token $err + } if {$n == 0} { set state(state) body if {![regexp -nocase ^text $state(type)]} { diff --git a/library/http2.3/http.tcl b/library/http2.3/http.tcl index c4da3d7..91a997b 100644 --- a/library/http2.3/http.tcl +++ b/library/http2.3/http.tcl @@ -9,7 +9,7 @@ # See the file "license.terms" for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: http.tcl,v 1.11 1999/10/05 22:46:00 hobbs Exp $ +# RCS: @(#) $Id: http.tcl,v 1.12 1999/10/21 02:16:37 hobbs Exp $ package provide http 2.1 ;# This uses Tcl namespaces @@ -349,7 +349,9 @@ proc http::cleanup {token} { return } if {[string equal $state(state) "header"]} { - set n [gets $s line] + if {[catch {gets $s line} n]} { + Finish $token $err + } if {$n == 0} { set state(state) body if {![regexp -nocase ^text $state(type)]} { -- cgit v0.12