raw_net_capture 2.0.1 → 2.1.1
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.
- 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: 5bbb3ccfe245bd93d89e6ddbcca677d9f3117d3e4438f4e0a0848b6d88a938d2
|
4
|
+
data.tar.gz: fd845b1ee17db4a389c00986209b9f8cb31cdec1ccca5df2669f1fbf6939bb0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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.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:
|
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
|