























错误请求涉及的包有Marker包(PacketType 0x0C)和Data Error(DataType 0x06 DataID 0x17 CallID 0x02)包

.....
if(command:match("forbidden")) then
--set a flag indicate error happen
ngx.ctx.responseError=true
print("forbidden matched...")
--return marker1
reqsock:send(string.char(0x00,0x0b,0x00,0x00,0x0c,0x00,0x00,0x00,0x01,0x00,0x01))
--return marker2
reqsock:send(string.char(0x00,0x0b,0x00,0x00,0x0c,0x00,0x00,0x00,0x01,0x00,0x02))
goto continue
end
![]()
--process req marker, if flag true then return error
if(data:byte(3)==12 and ngx.ctx.responseError) then
print("return error message")
--11g
if(tnsVersion==314 and oracleVersion.major==11) then
reqsock:send(string.char(
0x00, 0x75, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x05,
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x04, 0x00,
0x00, 0x00, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x28, 0x4f, 0x52, 0x41,
0x2d, 0x30, 0x30, 0x39, 0x34, 0x32, 0x3a, 0x20,
0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x6f, 0x72,
0x20, 0x76, 0x69, 0x65, 0x77, 0x20, 0x64, 0x6f,
0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x65,
0x78, 0x69, 0x73, 0x74, 0x0a))
end
--12c
if(tnsVersion==314 and oracleVersion.major==12) then
reqsock:send(string.char(
0x00, 0xb4, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x00, 0x00, 0x17, 0x02, 0x04, 0x00, 0x04, 0x33,
0x35, 0x38, 0x34, 0x04, 0x01, 0x00, 0x00, 0x00,
0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x07,
0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x40, 0xbb, 0x3d, 0x24, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,