changeset 1221:5d7393e2cf94

NcDataBlockReader, NcDataBlockWriter - protocolId moved to sessionInfoBlock
author Devel 2
date Thu, 25 Jun 2020 09:44:15 +0200
parents 6f6f6c8c790e
children f666342e4ad9
files stress-tester/src/main/java/com/passus/st/source/NcEventSource.java
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/source/NcEventSource.java	Thu Jun 25 09:43:58 2020 +0200
+++ b/stress-tester/src/main/java/com/passus/st/source/NcEventSource.java	Thu Jun 25 09:44:15 2020 +0200
@@ -280,12 +280,12 @@
                 break;
             case NcSessionPayloadBlock.TYPE:
                 NcSessionPayloadBlock payloadBlock = (NcSessionPayloadBlock) reader.read();
-                SessionInfo sessionInfo = payloadBlock.sessionInfo();
-                sessionInfo.setSourceName(getName());
+                SessionInfo session = payloadBlock.sessionInfo();
+                session.setSourceName(getName());
 
                 ByteBuff payload = readPayload(payloadBlock.data());
                 ReqRespPair messages;
-                switch (payloadBlock.proto()) {
+                switch (session.getProtocolId()) {
                     case HTTP:
                     case HTTP2:
                         messages = httpReader.read(payload);
@@ -304,7 +304,7 @@
                         break;
                     default:
                         if (LOGGER.isDebugEnabled()) {
-                            LOGGER.debug("Not supported protocol {}.", payloadBlock.proto());
+                            LOGGER.debug("Not supported protocol {}.", session.getProtocolId());
                         }
 
                         return;
@@ -312,9 +312,9 @@
 
                 if (collectMetrics) {
                     synchronized (metric) {
-                        if (sessionInfo.getTransport() == Session.PROTOCOL_TCP) {
+                        if (session.getTransport() == Session.PROTOCOL_TCP) {
                             metric.incTcpPacket();
-                        } else if (sessionInfo.getTransport() == Session.PROTOCOL_UDP) {
+                        } else if (session.getTransport() == Session.PROTOCOL_UDP) {
                             metric.incUdpPacket();
                         }
 
@@ -322,7 +322,7 @@
                     }
                 }
 
-                handler.handle(new SessionPayloadEvent(sessionInfo, messages.getRequest(), messages.getResponse(), payloadBlock.proto(), getName()));
+                handler.handle(new SessionPayloadEvent(session, messages.getRequest(), messages.getResponse(), session.getProtocolId(), getName()));
                 break;
             default:
                 reader.read();