raw_net_capture 2.0.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/raw_net_capture/net/buffered_io.rb +27 -10
- data/lib/raw_net_capture.rb +2 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8ef1701177be592630593956a9496261111cf1e7efdfabe9e9bb625ad4624f2c
|
4
|
+
data.tar.gz: 74cdf16ac30ff430549adb8cc16a06b4f2e39ac393b5d51de6af2282d978fbae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c10cfc9e73e252836b8b656a67f5451e94e2358970ac385c5676cb8604221b4f36b1f4e2b74b49309c5c9c56b6cd650f9abf59c81fc112c3a73052cd0fc51e63
|
7
|
+
data.tar.gz: e590add2226c67cac2676e47ac22540c4656f60fcf86d621562ebfb2dc0d531dcecf73e5e094f561f5811922fbe8f8de94c39597a37ec1f75281926a9d80a1b1
|
@@ -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
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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(
|
17
|
-
|
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
|
-
|
23
|
-
@written_bytes += len
|
24
|
-
len
|
41
|
+
ret
|
25
42
|
end
|
26
43
|
end
|
27
44
|
end
|
data/lib/raw_net_capture.rb
CHANGED
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.
|
4
|
+
version: 2.1.2
|
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:
|
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
|
-
|
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
|