Attachment "533025.diff" to
ticket [533025ffff]
added by
andreas_kupries
2002-04-04 23:28:39.
? modules/fileinput
? modules/ftp/example
? modules/ftpd/examples
? modules/mime/smtp.tcl.diff
Index: ChangeLog
===================================================================
RCS file: /cvsroot/tcllib/tcllib/ChangeLog,v
retrieving revision 1.132
diff -u -r1.132 ChangeLog
--- ChangeLog 1 Apr 2002 20:29:19 -0000 1.132
+++ ChangeLog 4 Apr 2002 16:27:23 -0000
@@ -1,3 +1,7 @@
+2002-04-04 Andreas Kupries <[email protected]>
+
+ * mime: Fixed bug #533025.
+
2002-04-01 Andreas Kupries <[email protected]>
* Makefile.in (doc_generate): Added 'touch' command to prevent
Index: modules/mime/ChangeLog
===================================================================
RCS file: /cvsroot/tcllib/tcllib/modules/mime/ChangeLog,v
retrieving revision 1.21
diff -u -r1.21 ChangeLog
--- modules/mime/ChangeLog 27 Feb 2002 21:33:51 -0000 1.21
+++ modules/mime/ChangeLog 4 Apr 2002 16:27:23 -0000
@@ -1,4 +1,10 @@
-2002-02-27 Andreas Kupries <[email protected]>
+2002-04-04 Andreas Kupries <[email protected]>
+
+ * smtp.tcl: Accepted patch by Simon Scott
+ <[email protected]>, with slight modification. Fixes
+ bug #533025.
+
+2002-02-27 Andreas Kupries <[email protected]>
* mime.tcl: Accepted patch for bug #519623 by Rolf Ade
<[email protected]>.
Index: modules/mime/smtp.tcl
===================================================================
RCS file: /cvsroot/tcllib/tcllib/modules/mime/smtp.tcl,v
retrieving revision 1.18
diff -u -r1.18 smtp.tcl
--- modules/mime/smtp.tcl 1 Feb 2002 17:44:53 -0000 1.18
+++ modules/mime/smtp.tcl 4 Apr 2002 16:27:24 -0000
@@ -1093,7 +1093,7 @@
}
if {!$state(readable)} {
- vwait $token
+ vwait ${token}(readable)
}
# Wait until socket is readable.
@@ -1173,12 +1173,14 @@
}
set state(line) ""
- if {[eof $state(sd)]} {
- set state(readable) -3
- set state(error) "premature end-of-file from server"
- } elseif {[catch { gets $state(sd) state(line) } result]} {
+ if {[catch { gets $state(sd) state(line) } result]} {
set state(readable) -2
set state(error) $result
+ } elseif {$result == -1} {
+ if {[eof $state(sd)]} {
+ set state(readable) -3
+ set state(error) "premature end-of-file from server"
+ }
} else {
# If the line ends in \r, remove the \r.
if {![string compare [string index $state(line) end] "\r"]} {
@@ -1187,7 +1189,7 @@
set state(readable) 1
}
- if {$state(readable) != 1} {
+ if {$state(readable) < 0} {
if {$options(-debug)} {
puts stderr " ... $state(error) ..."
flush stderr