dacpclient 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dacpclient/pairingserver.rb +6 -7
- data/lib/dacpclient/version.rb +1 -1
- 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: 7cff4d4d1619ceb0c95d8b580555e2e52654a5d0
|
4
|
+
data.tar.gz: 9386ed35980f41b0c13d4a7984cc8e8380bc8dff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c3b18e11267e973a749e6914cdc49d208272320b9f3894e00a2a2ec47d681ecd740a34ef01d690f9dd30034142d680232f37865afa230d81415fdfb8fedbcba
|
7
|
+
data.tar.gz: 89f07f9edb793880e2c04da6aafa0dd780457499abfa2251cb95cb33df644982e0bc5f91f5cd284119ce97e8e980cc6dee220aaa46db7091725103be7967e9eb
|
@@ -13,7 +13,7 @@ module DACPClient
|
|
13
13
|
@name = client.name
|
14
14
|
@port = port
|
15
15
|
@host = host
|
16
|
-
@pair = client.
|
16
|
+
@pair = client.guid
|
17
17
|
@pin = [0, 0, 0, 0]
|
18
18
|
@device_type = 'iPod'
|
19
19
|
super port, host
|
@@ -34,21 +34,20 @@ module DACPClient
|
|
34
34
|
|
35
35
|
def self.generate_pin_challenge(pair, pin)
|
36
36
|
pin_string = pin.map { |i| "#{i}\x00" }.join
|
37
|
-
Digest::MD5.hexdigest(pair + pin_string)
|
37
|
+
Digest::MD5.hexdigest(pair + pin_string)
|
38
38
|
end
|
39
39
|
|
40
40
|
def serve(client)
|
41
|
-
|
42
|
-
correct = code == @expected
|
43
|
-
if correct
|
41
|
+
if client.gets =~ /pairingcode=#{@expected}/i
|
44
42
|
client.print "HTTP/1.1 200 OK\r\n" +
|
45
43
|
"Content-Length: #{@pairing_string.length}\r\n\r\n"
|
46
44
|
client.print @pairing_string
|
45
|
+
client.close
|
46
|
+
stop
|
47
47
|
else
|
48
48
|
client.print "HTTP/1.1 404 Not Found\r\nContent-Length: 0\r\n\r\n"
|
49
|
+
client.close
|
49
50
|
end
|
50
|
-
client.close
|
51
|
-
stop if correct
|
52
51
|
end
|
53
52
|
|
54
53
|
private
|
data/lib/dacpclient/version.rb
CHANGED