ftw 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,5 +3,5 @@ require "ftw/namespace"
3
3
  # :nodoc:
4
4
  module FTW
5
5
  # The version of this library
6
- VERSION = "0.0.10"
6
+ VERSION = "0.0.11"
7
7
  end
@@ -171,9 +171,9 @@ class FTW::WebSocket::Parser
171
171
  data = get
172
172
  case @need
173
173
  when 2
174
- @payload_length = data.unpack("S").first
174
+ @payload_length = data.unpack("S>").first
175
175
  when 8
176
- @payload_length = data.unpack("Q").first
176
+ @payload_length = data.unpack("Q>").first
177
177
  else
178
178
  raise "Unknown payload_length byte length '#{@need}'"
179
179
  end
@@ -69,7 +69,7 @@ class FTW::WebSocket::Writer
69
69
  # Pack the payload.
70
70
  def pack_payload(data, pack, text, mode)
71
71
  pack_maskbit_and_length(data, pack, text.length, mode)
72
- pack_extended_length(data, pack, text.length) if text.length > 126
72
+ pack_extended_length(data, pack, text.length) if text.length >= 126
73
73
  if mode == :client
74
74
  mask_key = [rand(1 << 32)].pack("Q")
75
75
  pack_mask(data, pack, mask_key)
@@ -122,10 +122,10 @@ class FTW::WebSocket::Writer
122
122
  data << length
123
123
  if length >= (1 << 16)
124
124
  # For lengths >= 16 bits, pack 8 byte length
125
- pack << "Q"
125
+ pack << "Q>"
126
126
  else
127
127
  # For lengths < 16 bits, pack 2 byte length
128
- pack << "S"
128
+ pack << "S>"
129
129
  end
130
130
  end # def pack_extended_length
131
131
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ftw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-23 00:00:00.000000000 Z
12
+ date: 2012-03-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json