phut 0.6.3 → 0.6.4
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/phut/version.rb +1 -1
- data/lib/phut/vhost_daemon.rb +16 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75625e8cb54acd2d9b2f0203ab25c58023fff30f
|
4
|
+
data.tar.gz: 258addd7917000406f9ecfd38dd9fb65760432a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9a8f348e6014413d9ebd5633e2c8fcc1434f6a0d3164817b25dc5597b1653e6a7b9513c0dd309e18e96b55abee030a13b37027e042b09bfa161928e81bda661
|
7
|
+
data.tar.gz: 965d8c4d03911757c8ab1b44bc6757a1516ba661be129e4a11016345a6177bf3a014a8f9277c2d996db24d42785dc225dd432d09627c8337ffcc53b420d3349a
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,12 @@
|
|
3
3
|
## develop (unreleased)
|
4
4
|
|
5
5
|
|
6
|
+
## 0.6.4 (6/4/2015)
|
7
|
+
### Bugs fixed
|
8
|
+
* [#24](https://github.com/trema/phut/pull/24): vhost should not exit
|
9
|
+
if the link to which the vhost is connected is disabled.
|
10
|
+
|
11
|
+
|
6
12
|
## 0.6.3 (6/4/2015)
|
7
13
|
### Bugs fixed
|
8
14
|
* [#23](https://github.com/trema/phut/pull/23): Fix vhost restart failure.
|
data/lib/phut/version.rb
CHANGED
data/lib/phut/vhost_daemon.rb
CHANGED
@@ -68,6 +68,9 @@ module Phut
|
|
68
68
|
def write_to_raw_socket(packet)
|
69
69
|
@packets_sent << packet.snapshot
|
70
70
|
raw_socket.write packet.to_binary_s
|
71
|
+
rescue Errno::ENXIO
|
72
|
+
# link is disconnected
|
73
|
+
true
|
71
74
|
end
|
72
75
|
|
73
76
|
def create_udp_packet(dest)
|
@@ -81,17 +84,24 @@ module Phut
|
|
81
84
|
"#{@options.fetch(:log_dir)}/vhost.#{@options.fetch(:name)}.log"
|
82
85
|
end
|
83
86
|
|
87
|
+
# rubocop:disable MethodLength
|
84
88
|
def read_loop
|
85
89
|
loop do
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
+
begin
|
91
|
+
raw_data, = raw_socket.recvfrom(8192)
|
92
|
+
udp = Pio::Udp.read(raw_data)
|
93
|
+
unless @options[:promisc]
|
94
|
+
next if udp.ip_destination_address != @options.fetch(:ip_address)
|
95
|
+
end
|
96
|
+
@logger.info "Received: #{udp}"
|
97
|
+
@packets_received << udp.snapshot
|
98
|
+
rescue Errno::ENETDOWN
|
99
|
+
# link is disconnected
|
100
|
+
sleep 1
|
90
101
|
end
|
91
|
-
@logger.info "Received: #{udp}"
|
92
|
-
@packets_received << udp.snapshot
|
93
102
|
end
|
94
103
|
end
|
104
|
+
# rubocop:enable MethodLength
|
95
105
|
|
96
106
|
def start_daemon
|
97
107
|
Process.daemon
|