projects
/
riece
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cc9b384
)
Simplified.
author
Daiki Ueno
<ueno@unixuser.org>
Tue, 22 Mar 2005 09:17:02 +0000
(09:17 +0000)
committer
Daiki Ueno
<ueno@unixuser.org>
Tue, 22 Mar 2005 09:17:02 +0000
(09:17 +0000)
lisp/rubyserv.rb
patch
|
blob
|
history
diff --git
a/lisp/rubyserv.rb
b/lisp/rubyserv.rb
index
027e552
..
032adfc
100644
(file)
--- a/
lisp/rubyserv.rb
+++ b/
lisp/rubyserv.rb
@@
-14,7
+14,7
@@
class RubyServ
def dispatch(line)
case line.chomp
when /\AD /
def dispatch(line)
case line.chomp
when /\AD /
-
return
@buf << unescape($')
+ @buf << unescape($')
when /\A(\S+)\s*/
c = $1
r = $'
when /\A(\S+)\s*/
c = $1
r = $'
@@
-86,13
+86,11
@@
class RubyServ
end
def send_data(d)
end
def send_data(d)
+ d = escape(d)
begin
begin
- r = [d.length, 998].min # 998 = 1000 - CRLF
- (0 ... r).each do |i|
- r -= 2 if d[i] =~ /[%\r\n]/
- end
- puts("D #{escape(d[0 ... r])}\r\n")
- d = d[r .. -1]
+ len = [d.length, 998].min # 998 = 1000 - "D "
+ puts("D #{d[0 ... len]}\r\n")
+ d = d[len .. -1]
end until d.empty?
end
end until d.empty?
end