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

Function getClientSockname

app/redis-6.2.6/src/networking.c:2287–2295  ·  view source on GitHub ↗

This function returns the client bound socket name, by creating and caching * it if client->sockname is NULL, otherwise returning the cached value. * The Socket Name never changes during the life of the client, however it * is expensive to compute. */

Source from the content-addressed store, hash-verified

2285 * The Socket Name never changes during the life of the client, however it
2286 * is expensive to compute. */
2287char *getClientSockname(client *c) {
2288 char sockname[NET_ADDR_STR_LEN];
2289
2290 if (c->sockname == NULL) {
2291 genClientAddrString(c,sockname,sizeof(sockname),FD_TO_SOCK_NAME);
2292 c->sockname = sdsnew(sockname);
2293 }
2294 return c->sockname;
2295}
2296
2297/* Concatenate a string representing the state of a client in a human
2298 * readable format, into the sds string 's'. */

Callers 2

catClientInfoStringFunction · 0.85
clientCommandFunction · 0.85

Calls 2

genClientAddrStringFunction · 0.85
sdsnewFunction · 0.85

Tested by

no test coverage detected