You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2019/10/12 20:06:46 UTC

[plc4x] branch develop updated: - Fixed a problem that the response to a CPUServices request didn't clean up the list of unconfirmed PDUs.

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/develop by this push:
     new ab23c37  - Fixed a problem that the response to a CPUServices request didn't clean up the list of unconfirmed PDUs.
ab23c37 is described below

commit ab23c37c90f9852eb8e7e95a86fd6672ce44c36a
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Sat Oct 12 22:06:38 2019 +0200

    - Fixed a problem that the response to a CPUServices request didn't clean up the list of unconfirmed PDUs.
---
 .../s7/src/main/java/org/apache/plc4x/java/s7/netty/S7Protocol.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/netty/S7Protocol.java b/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/netty/S7Protocol.java
index 6bc19b0..8195542 100644
--- a/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/netty/S7Protocol.java
+++ b/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/netty/S7Protocol.java
@@ -531,6 +531,10 @@ public class S7Protocol extends ChannelDuplexHandler {
                     for (S7Payload s7Payload : s7Payloads) {
                         if(s7Payload instanceof CpuServicesPayload) {
                             CpuServicesPayload cpuServicesPayload = (CpuServicesPayload) s7Payload;
+
+                            // Remove the current response from the list of unconfirmed messages.
+                            sentButUnacknowledgedTpdus.remove(tpduReference);
+
                             handleIdentifyRemote(ctx, cpuServicesPayload);
                         }
                     }
@@ -596,7 +600,7 @@ public class S7Protocol extends ChannelDuplexHandler {
             logger.debug("-  pdu size: {}", pduSize);
         }
         if(logger.isInfoEnabled()) {
-            logger.info("Successfully connected to S7: {} wit PDU {}", controllerType.name(),pduSize);
+            logger.info("Successfully connected to S7: {} wit PDU {}", controllerType.name(), pduSize);
         }
 
         // Send an event that connection setup is complete.