Skip to content

Commit de504f0

Browse files
committed
Ensure connection initialted is set to fals in appropriate places
Signed-off-by: Kai-Uwe Hermann <[email protected]>
1 parent 8127b8c commit de504f0

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

modules/EVSE/EvseV2G/connection/connection.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ static void* connection_handle_tcp(void* data) {
446446

447447
static void* connection_server(void* data) {
448448
struct v2g_context* ctx = static_cast<v2g_context*>(data);
449+
ctx->connection_initiated = false;
449450
struct v2g_connection* conn = NULL;
450451
pthread_attr_t attr;
451452

@@ -508,6 +509,7 @@ static void* connection_server(void* data) {
508509

509510
if (pthread_create(&conn->thread_id, &attr, connection_handle_tcp, conn) != 0) {
510511
dlog(DLOG_LEVEL_ERROR, "pthread_create() failed: %s", strerror(errno));
512+
ctx->connection_initiated = false;
511513
continue;
512514
}
513515

modules/EVSE/EvseV2G/connection/tls_connection.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ void handle_new_connection_cb(tls::Server::ConnectionPtr&& con, struct v2g_conte
8787
// unable to start thread
8888
dlog(DLOG_LEVEL_ERROR, "pthread_create() failed: %s", strerror(errno));
8989
con->shutdown();
90+
ctx->connection_initiated = false;
9091
}
9192
}
9293

0 commit comments

Comments
 (0)