File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ def initialize(sock, opts = {})
24
24
@opts = opts
25
25
26
26
@banner = nil
27
- @majver = MajorVersion
27
+ @majver = MajorVersions
28
28
@minver = -1
29
29
@auth_types = [ ]
30
30
end
@@ -50,7 +50,7 @@ def handshake
50
50
51
51
if @banner =~ /RFB ([0-9]{3})\. ([0-9]{3})/
52
52
maj = $1. to_i
53
- if maj != MajorVersion
53
+ unless MajorVersions . include? ( maj )
54
54
@error = "Invalid major version number: #{ maj } "
55
55
return false
56
56
end
@@ -61,8 +61,15 @@ def handshake
61
61
62
62
@minver = $2. to_i
63
63
64
- our_ver = "RFB %03d.%03d\n " % [ MajorVersion , @minver ]
65
- @sock . put ( our_ver )
64
+ # Forces client version 3 to be used. This adds support
65
+ # version 4 servers.
66
+ # It may be necessary to hardcode a miniver as well
67
+ # to do: add support for Version 4. Version 4 client
68
+ # adds additional information to the packet regarding
69
+ # supported authentication types.
70
+ our_ver = "RFB %03d.%03d\n " % [ 3 , @minver ]
71
+ puts our_ver
72
+ @sock . put ( our_ver )
66
73
67
74
true
68
75
end
You can’t perform that action at this time.
0 commit comments