Skip to content

Commit c3e7f11

Browse files
committed
fix trigger CS104_CONNECTION_FAILED event, if tlsSocket fails
1 parent f4a8088 commit c3e7f11

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib60870-C/src/iec60870/cs104/cs104_connection.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ handleConnection(void* parameter)
866866
{
867867
CS104_Connection self = (CS104_Connection) parameter;
868868

869-
CS104_ConnectionEvent event = CS104_CONNECTION_OPENED;
869+
CS104_ConnectionEvent event = CS104_CONNECTION_FAILED;
870870

871871
resetConnection(self);
872872

@@ -1016,9 +1016,6 @@ handleConnection(void* parameter)
10161016
#if (CONFIG_USE_SEMAPHORES == 1)
10171017
Semaphore_post(self->conStateLock);
10181018
#endif /* (CONFIG_USE_SEMAPHORES == 1) */
1019-
1020-
/* register CLOSED event */
1021-
event = CS104_CONNECTION_FAILED;
10221019
}
10231020

10241021
#if (CONFIG_USE_SEMAPHORES == 1)
@@ -1065,10 +1062,8 @@ handleConnection(void* parameter)
10651062
}
10661063

10671064
/* Call connection handler */
1068-
if ((event == CS104_CONNECTION_CLOSED) || (event == CS104_CONNECTION_FAILED)) {
1069-
if (self->connectionHandler)
1070-
self->connectionHandler(self->connectionHandlerParameter, self, event);
1071-
}
1065+
if (self->connectionHandler)
1066+
self->connectionHandler(self->connectionHandlerParameter, self, event);
10721067

10731068
return NULL;
10741069
}

0 commit comments

Comments
 (0)