summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-11-18 05:04:36 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-11-18 05:04:36 +0000
commit15b9494baa5be28a827a5169f27a5f884cb4518d (patch)
treed3955032b9ee9de4283db18ccd22d4f2f01e9c8c
parentc12c7ab1dcdffc82886b9ad5a082669cd6056843 (diff)
aamine
* lib/net/http.rb: Socket#readline() reads until "\n", not "\r\n" git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--lib/net/protocol.rb5
2 files changed, 6 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index ee3c4ab0d5..e6810d64cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sat Nov 18 14:07:20 2000 Minero Aoki <aamine@dp.u-netsurf.ne.jp>
+
+ * lib/net/http.rb: Socket#readline() reads until "\n", not "\r\n"
+
Fri Nov 17 14:55:18 2000 WATANABE Hirofumi <eban@ruby-lang.org>
* string.c (rb_str_succ): output should be NUL terminated.
diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb
index eb90cd48b3..34b379361b 100644
--- a/lib/net/protocol.rb
+++ b/lib/net/protocol.rb
@@ -528,7 +528,7 @@ module Net
def readline
- ret = readuntil( "\r\n" )
+ ret = readuntil( "\n" )
ret.chop!
ret
end
@@ -538,7 +538,6 @@ module Net
@pipe << "reading text...\n" if @pipe; pipeoff
rsize = 0
-
while (str = readuntil("\r\n")) != ".\r\n" do
rsize += str.size
str.gsub!( /\A\./, '' )
@@ -557,9 +556,9 @@ module Net
str = nil
i = 0
while (str = readuntil("\r\n")) != ".\r\n" do
+ i += 1
str.chop!
yield str
- i += 1
end
@pipe << "read #{i} items\n" if pipeon