uNetworking / uSockets

Miniscule cross-platform eventing, networking & crypto for async applications
Apache License 2.0
1.29k stars 267 forks source link

fix wording #226

Closed twenty2811 closed 1 month ago

twenty2811 commented 3 months ago

For the us_socket_close_connecting and us_socket_close part, the wordings are true 4 years ago, but later changes make it not accurate.

So, this pull request modified the comments.

Of course, if extracting the common logics like below, the comments could be removed without confusion.

void us_internal_socket_finalize(int ssl, struct us_socket_t *s) {
        /* Link this socket to the close-list and let it be deleted after this iteration */
        s->next = s->context->loop->data.closed_head;
        s->context->loop->data.closed_head = s;

        /* Any socket with prev = context is marked as closed */
        s->prev = (struct us_socket_t *) s->context;
}