raw_net_capture 2.0.1 → 2.1.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
- SHA1:
3
- metadata.gz: 0cddcb536ac8cc22edf1b0b2605deb406f783019
4
- data.tar.gz: 59abcb2f70e8f5e61a7958bd867ab4107c8aaf02
2
+ SHA256:
3
+ metadata.gz: 5bbb3ccfe245bd93d89e6ddbcca677d9f3117d3e4438f4e0a0848b6d88a938d2
4
+ data.tar.gz: fd845b1ee17db4a389c00986209b9f8cb31cdec1ccca5df2669f1fbf6939bb0e
5
5
  SHA512:
6
- metadata.gz: cb2a51061d463901d575be9384a734838cbcbaa925b20046936a321cc1c739030a1bab8381d242bbd3023db056dc7233bdf853b7029deee7aa24fc7893239250
7
- data.tar.gz: aa6cd0a9fc9bbb80f6045417b4bcf5a59ef7046bbad8020899bdc92cbfac9f6f927c9162d3ef31f83002880294103ce0775876ec7a619a79906e40c059c6d724
6
+ metadata.gz: 3fcb6307695e48b90530b5fdff48b8715c360cd9b85e95fb9ebc6d33138189a61450c1c1dec6932729cf5bd435d492bf255d671cfc607fe242f46e2b2cf720c2
7
+ data.tar.gz: 7e876740adee3f08c227054aec99f183f3c838b65adbe40b72884f0093ca8cc74f8f799b4a8bfdca48645510d7bbc5a90bd4939ce3ed9ddf736f2b2e73cd6909
@@ -3,25 +3,42 @@
3
3
  module Net
4
4
  class BufferedIO
5
5
  private
6
+ alias_method :orig_rbuf_consume, :rbuf_consume
7
+ alias_method :orig_write0, :write0
6
8
 
7
- def rbuf_consume(len)
8
- str = @rbuf.slice!(0, len)
9
- if @debug_output
10
- @debug_output << %Q[-> #{str.dump}\n]
11
- @debug_output.received(str) if @debug_output.respond_to?(:received)
9
+ def rbuf_consume(len = nil)
10
+ return orig_rbuf_consume(len) unless @debug_output
11
+
12
+ begin
13
+ saved_debug_output = @debug_output
14
+ @debug_output = nil
15
+ str = orig_rbuf_consume(len)
16
+ ensure
17
+ @debug_output = saved_debug_output
12
18
  end
19
+
20
+ @debug_output << %Q[-> #{str.dump}\n]
21
+ @debug_output.received(str) if @debug_output.respond_to?(:received)
13
22
  str
14
23
  end
15
24
 
16
- def write0(str)
17
- if @debug_output
25
+ def write0(*strs)
26
+ return orig_write0(*strs) unless @debug_output
27
+
28
+ begin
29
+ saved_debug_output = @debug_output
30
+ @debug_output = nil
31
+ ret = orig_write0(*strs)
32
+ ensure
33
+ @debug_output = saved_debug_output
34
+ end
35
+
36
+ strs.each do |str|
18
37
  @debug_output << str.dump
19
38
  @debug_output.sent(str) if @debug_output.respond_to?(:sent)
20
39
  end
21
40
 
22
- len = @io.write(str)
23
- @written_bytes += len
24
- len
41
+ ret
25
42
  end
26
43
  end
27
44
  end
@@ -1,5 +1,7 @@
1
1
  # encoding: utf-8
2
2
 
3
+ gem 'net-protocol'
4
+
3
5
  require 'raw_net_capture/raw_net_capture'
4
6
  require 'raw_net_capture/raw_http_capture'
5
7
  require 'raw_net_capture/net/buffered_io'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raw_net_capture
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gary Grossman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-25 00:00:00.000000000 Z
12
+ date: 2023-04-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: appraisal
@@ -84,8 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  requirements: []
87
- rubyforge_project:
88
- rubygems_version: 2.2.2
87
+ rubygems_version: 3.0.3.1
89
88
  signing_key:
90
89
  specification_version: 4
91
90
  summary: Capture raw data in net debug_output