manage probing sockets in a specific list instead of searching through all connections

This commit is contained in:
yrutschle committed 2021-04-19 09:38:22 +02:00
1 parent 02f6c6999d
commit b258b0e0f7
4 files changed
+83 -28

No files matched your search

+4 -2
View File
@@ -80,8 +80,10 @@ struct connection* collection_alloc_cnx_from_fd(struct cnx_collection* collectio
/* Remove a connection from the collection */
int collection_remove_cnx(cnx_collection* collection, struct connection *cnx)
{
gap_set(collection->fd2cnx, cnx->q[0].fd, NULL);
gap_set(collection->fd2cnx, cnx->q[1].fd, NULL);
if (cnx->q[0].fd != -1)
gap_set(collection->fd2cnx, cnx->q[0].fd, NULL);
if (cnx->q[1].fd != -1)
gap_set(collection->fd2cnx, cnx->q[1].fd, NULL);
free(cnx);
return 0;
}