Fix PROTOCOL parsing

Add PROTOCOL test for raw sessions to send client
This commit is contained in:
zzz
2015-11-27 16:20:49 +00:00
parent ed1567e9f7
commit 48d7f4969c
2 changed files with 5 additions and 2 deletions

View File

@ -158,7 +158,7 @@ class SAMv3DatagramServer implements Handler {
while (tok.hasMoreTokens()) { while (tok.hasMoreTokens()) {
String t = tok.nextToken(); String t = tok.nextToken();
if (t.startsWith("PROTOCOL=")) if (t.startsWith("PROTOCOL="))
pr = t.substring("PROTOTCOL=".length()); pr = t.substring("PROTOCOL=".length());
else if (t.startsWith("FROM_PORT=")) else if (t.startsWith("FROM_PORT="))
fp = t.substring("FROM_PORT=".length()); fp = t.substring("FROM_PORT=".length());
else if (t.startsWith("TO_PORT=")) else if (t.startsWith("TO_PORT="))

View File

@ -440,6 +440,9 @@ public class SAMStreamSend {
baos.write(DataHelper.getASCII(_remoteDestination)); baos.write(DataHelper.getASCII(_remoteDestination));
if (_isV32) { if (_isV32) {
// only set TO_PORT to test session setting of FROM_PORT // only set TO_PORT to test session setting of FROM_PORT
if (_mode == RAW)
baos.write(DataHelper.getASCII(" PROTOCOL=123 TO_PORT=5678"));
else
baos.write(DataHelper.getASCII(" TO_PORT=5678")); baos.write(DataHelper.getASCII(" TO_PORT=5678"));
} }
baos.write((byte) '\n'); baos.write((byte) '\n');