syspy 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/tds_package_stream.rb +4 -4
- metadata +1 -1
data/lib/tds_package_stream.rb
CHANGED
@@ -62,7 +62,7 @@ module Syspy
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def handle_package(io)
|
65
|
-
token = io.
|
65
|
+
token = io.readbyte()
|
66
66
|
token_class = TdsTokens.token_class(token)
|
67
67
|
if(token_class)
|
68
68
|
length = TdsTokens.fixed_length(token)
|
@@ -88,7 +88,7 @@ module Syspy
|
|
88
88
|
}
|
89
89
|
|
90
90
|
# read IP version and header length
|
91
|
-
ver_len = io.
|
91
|
+
ver_len = io.readbyte()
|
92
92
|
version = ver_len >> 4
|
93
93
|
|
94
94
|
raise "Invalid IP version: #{version}" unless version == 4 || version == 6
|
@@ -96,7 +96,7 @@ module Syspy
|
|
96
96
|
header_length = (ver_len & 0x0F) * 4
|
97
97
|
|
98
98
|
# skip TOS
|
99
|
-
io.
|
99
|
+
io.readcbyte()
|
100
100
|
|
101
101
|
# get package length
|
102
102
|
content_length = Bytes.uint16be(io)
|
@@ -111,7 +111,7 @@ module Syspy
|
|
111
111
|
io.read(12)
|
112
112
|
|
113
113
|
# get header length
|
114
|
-
tcp_offset = (io.
|
114
|
+
tcp_offset = (io.readbyte() >> 4) * 4
|
115
115
|
|
116
116
|
# consume remaining tcp header
|
117
117
|
io.read(tcp_offset - 13)
|