brotorift 0.3.5 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0817f8914f49d1fee55dca1f4371581d1ff9e9507cb20791b34ec688e346f52
4
- data.tar.gz: 0b6d7fbc3b4cfd2d640190e4202261c95eb9b39e40a4f9e8271d7ab25799b0ff
3
+ metadata.gz: a3a6bc71f0a335b6ac8945a9211bfdb26127ace4416b67afd4b1b61404ac14d9
4
+ data.tar.gz: ec535b169b1173ae74018ae2a40a67a56bedc256db8b5233e5e2a67c8c8ec1d4
5
5
  SHA512:
6
- metadata.gz: 3d4c69a78fbc4b0a0d2530a8c75d4ea7962cab6f637b52c0c776ae8ffacdff99d47f5680eeb6db1a906eb14f93da20a463ff8cc528fd026d8f725b899e2350aa
7
- data.tar.gz: 9366ac9c6975c722c904bbca8f5ad8a618445a2726de54b280af018a8c460cb7f3ed38e3e1cceeac83c4e03a54cda49906c673cd7116d33cf4720e87b30ec456
6
+ metadata.gz: 17b79c96de8f98c7e48a1faa0e34502fb2e22dabd59e3af62ddfbac7a03c5382974e1f3eee37a9bc40a03a391c21be161ce24e12ee77577d6fa0e0da653cc910
7
+ data.tar.gz: 31378d699b2840197fbf35f7529280291e6994512941fc6b3d9165ac393a59d1807f869de722fd78f975aacc82985cf971c7c67e6034fca9dfd92257cbddc7f0
@@ -102,12 +102,16 @@ defmodule <%= node.namespace %>.<%= node.elixir_connection %> do
102
102
  {:ok, state}
103
103
  end
104
104
  defp process_packet(data, handler, state) do
105
- <<_size::32-little, header::32-little, data::binary>> = data
105
+ <<header::32-little, data::binary>> = data
106
106
  case header do<% for m in n.in_direction.messages.values %>
107
107
  <%= m.elixir_header_name %> -><% for p in m.members %>
108
108
  {data, <%= p.elixir_name %>} = <%= p.type.elixir_read node %><% end %>
109
- {:ok, state} = handler.<%= m.elixir_name %>(self(), state<%= m.elixir_params %>)
110
- process_packet(data, handler, state)<% end %>
109
+ if byte_size(data) != 0 do
110
+ stop(self())
111
+ else
112
+ {:ok, state} = handler.<%= m.elixir_name %>(self(), state<%= m.elixir_params %>)
113
+ process_packet(data, handler, state)<% end %>
114
+ end
111
115
  end
112
116
  end
113
117
  end
@@ -66,9 +66,10 @@ namespace <%= node.namespace %>
66
66
 
67
67
  public PacketProcessPolicy policy { get; set; }
68
68
 
69
- public <%= node_direction.connector_name %>( <%= node_direction.handler_name %> handler )
69
+ public <%= node_direction.connector_name %>( <%= node_direction.handler_name %> handler, long dataHead )
70
70
  {
71
71
  this.handler = handler;
72
+ this.dataHead = dataHead;
72
73
  this.policy = PacketProcessPolicy.Discard;
73
74
  }
74
75
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brotorift
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ren