plugins/mod_proxy65.lua

changeset 2273
b98b29f614ae
parent 2272
9c3564117b24
child 2305
7ddd00260808
equal deleted inserted replaced
2272:9c3564117b24 2273:b98b29f614ae
65 data:sub(2):byte() == 0x01 and -- CMD must be 1 65 data:sub(2):byte() == 0x01 and -- CMD must be 1
66 data:sub(3):byte() == 0x00 and -- RSV must be 0 66 data:sub(3):byte() == 0x00 and -- RSV must be 0
67 data:sub(4):byte() == 0x03 and -- ATYP must be 3 67 data:sub(4):byte() == 0x03 and -- ATYP must be 3
68 data:sub(5):byte() == 40 and -- SHA1 HASH length must be 40 (0x28) 68 data:sub(5):byte() == 40 and -- SHA1 HASH length must be 40 (0x28)
69 data:sub(-2):byte() == 0x00 and -- PORT must be 0, size 2 byte 69 data:sub(-2):byte() == 0x00 and -- PORT must be 0, size 2 byte
70 data:sub(-1):byte() == 0x00 70 data:sub(-1):byte() == 0x00
71 then 71 then
72 local sha = data:sub(6, 45); -- second param is not count! it's the ending index (included!) 72 local sha = data:sub(6, 45); -- second param is not count! it's the ending index (included!)
73 if transfers[sha] == nil then 73 if transfers[sha] == nil then
74 transfers[sha] = {}; 74 transfers[sha] = {};
75 transfers[sha].activated = false; 75 transfers[sha].activated = false;

mercurial