Skip to content
Browse files

use single space as separator so client implementation is simpler in …

…languages without native regex support
  • Loading branch information...
1 parent 61fb916 commit b16c1a87427019d11eac7aa20984ec6fda87a8fb @ninjudd ninjudd committed May 11, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/clj/portal/core.clj
  2. +1 −1 src/rb/portal.rb
View
2 src/clj/portal/core.clj
@@ -16,7 +16,7 @@
(recur (conj forms form)))))))
(defn decode-message [string]
- (split (str string) #"\s+" 3))
+ (split (str string) #" " 3))
(defn encode-message [id type data]
(str id " " type " "
View
2 src/rb/portal.rb
@@ -38,7 +38,7 @@ def receive_message
raise ProtocolError.new("Message size must be an integer, found #{c.chr}") unless (?0..?9).include?(c)
size << c
end
- message = @socket.read(size.to_i).split(/\s+/, 3)
+ message = @socket.read(size.to_i).split(/ /, 3)
raise ProtocolError.new("Message must be followed by comma") unless @socket.getc == ?,
message
end

0 comments on commit b16c1a8

Please sign in to comment.
Something went wrong with that request. Please try again.