mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* sample/*: whitespace patch by Sergio Campama [Fixes GH-364]
https://github.com/ruby/ruby/pull/364 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
368cecc151
commit
b4489ae953
25 changed files with 314 additions and 309 deletions
|
@ -29,22 +29,22 @@ end
|
|||
while true
|
||||
as = ls.accept
|
||||
Thread.start do
|
||||
STDERR.print "socket #{myname} accepted, thread ", Thread.current, "\n"
|
||||
s = as # copy to dynamic variable
|
||||
str = ''
|
||||
while line = s.gets
|
||||
break if line == "\r\n" or line == "\n"
|
||||
str << line
|
||||
end
|
||||
STDERR.print "socket #{myname} got string\n"
|
||||
s.write("HTTP/1.0 200 OK\n")
|
||||
s.write("Content-type: text/plain\n\n")
|
||||
s.write("this is test: my name is #{myname}, you sent:\n")
|
||||
s.write("---start\n")
|
||||
s.write(str)
|
||||
s.write("---end\n")
|
||||
s.close
|
||||
STDERR.print "socket #{myname} processed, thread ", Thread.current, " terminating\n"
|
||||
STDERR.print "socket #{myname} accepted, thread ", Thread.current, "\n"
|
||||
s = as # copy to dynamic variable
|
||||
str = ''
|
||||
while line = s.gets
|
||||
break if line == "\r\n" or line == "\n"
|
||||
str << line
|
||||
end
|
||||
STDERR.print "socket #{myname} got string\n"
|
||||
s.write("HTTP/1.0 200 OK\n")
|
||||
s.write("Content-type: text/plain\n\n")
|
||||
s.write("this is test: my name is #{myname}, you sent:\n")
|
||||
s.write("---start\n")
|
||||
s.write(str)
|
||||
s.write("---end\n")
|
||||
s.close
|
||||
STDERR.print "socket #{myname} processed, thread ", Thread.current, " terminating\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue