| 196 | } |
| 197 | |
| 198 | static int connSocketAccept(connection *conn, ConnectionCallbackFunc accept_handler) { |
| 199 | int ret = C_OK; |
| 200 | |
| 201 | if (conn->state != CONN_STATE_ACCEPTING) return C_ERR; |
| 202 | conn->state = CONN_STATE_CONNECTED; |
| 203 | |
| 204 | connIncrRefs(conn); |
| 205 | if (!callHandler(conn, accept_handler)) ret = C_ERR; |
| 206 | connDecrRefs(conn); |
| 207 | |
| 208 | return ret; |
| 209 | } |
| 210 | |
| 211 | /* Register a write handler, to be called when the connection is writable. |
| 212 | * If NULL, the existing handler is removed. |
nothing calls this directly
no test coverage detected