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

Function connSocketClose

app/redis-6.2.6/src/connection.c:148–164  ·  view source on GitHub ↗

Close the connection and free resources. */

Source from the content-addressed store, hash-verified

146
147/* Close the connection and free resources. */
148static void connSocketClose(connection *conn) {
149 if (conn->fd != -1) {
150 aeDeleteFileEvent(server.el,conn->fd, AE_READABLE | AE_WRITABLE);
151 close(conn->fd);
152 conn->fd = -1;
153 }
154
155 /* If called from within a handler, schedule the close but
156 * keep the connection until the handler returns.
157 */
158 if (connHasRefs(conn)) {
159 conn->flags |= CONN_FLAG_CLOSE_SCHEDULED;
160 return;
161 }
162
163 zfree(conn);
164}
165
166static int connSocketWrite(connection *conn, const void *data, size_t data_len) {
167 int ret = write(conn->fd, data, data_len);

Callers

nothing calls this directly

Calls 4

aeDeleteFileEventFunction · 0.85
connHasRefsFunction · 0.85
closeFunction · 0.70
zfreeFunction · 0.70

Tested by

no test coverage detected