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

Function callHandler

app/redis-6.2.6/src/connhelpers.h:77–86  ·  view source on GitHub ↗

Helper for connection implementations to call handlers: * 1. Increment refs to protect the connection. * 2. Execute the handler (if set). * 3. Decrement refs and perform deferred close, if refs==0. */

Source from the content-addressed store, hash-verified

75 * 3. Decrement refs and perform deferred close, if refs==0.
76 */
77static inline int callHandler(connection *conn, ConnectionCallbackFunc handler) {
78 connIncrRefs(conn);
79 if (handler) handler(conn);
80 connDecrRefs(conn);
81 if (conn->flags & CONN_FLAG_CLOSE_SCHEDULED) {
82 if (!connHasRefs(conn)) connClose(conn);
83 return 0;
84 }
85 return 1;
86}
87
88#endif /* __REDIS_CONNHELPERS_H */

Callers 4

tlsHandleEventFunction · 0.85
connTLSAcceptFunction · 0.85
connSocketAcceptFunction · 0.85
connSocketEventHandlerFunction · 0.85

Calls 5

connIncrRefsFunction · 0.85
handlerFunction · 0.85
connDecrRefsFunction · 0.85
connHasRefsFunction · 0.85
connCloseFunction · 0.85

Tested by

no test coverage detected