MCPcopy Create free account
hub / github.com/F-Stack/f-stack / instanceLinkCloseConnection

Function instanceLinkCloseConnection

app/redis-6.2.6/src/sentinel.c:1067–1078  ·  view source on GitHub ↗

Disconnect a hiredis connection in the context of an instance link. */

Source from the content-addressed store, hash-verified

1065
1066/* Disconnect a hiredis connection in the context of an instance link. */
1067void instanceLinkCloseConnection(instanceLink *link, redisAsyncContext *c) {
1068 if (c == NULL) return;
1069
1070 if (link->cc == c) {
1071 link->cc = NULL;
1072 link->pending_commands = 0;
1073 }
1074 if (link->pc == c) link->pc = NULL;
1075 c->data = NULL;
1076 link->disconnected = 1;
1077 redisAsyncFree(c);
1078}
1079
1080/* Decrement the refcount of a link object, if it drops to zero, actually
1081 * free it and return NULL. Otherwise don't do anything and return the pointer

Callers 6

releaseInstanceLinkFunction · 0.85
sentinelDropConnectionsFunction · 0.85
sentinelResetMasterFunction · 0.85

Calls 1

redisAsyncFreeFunction · 0.85

Tested by

no test coverage detected