src/flb_upstream.c
/*
 * This function moves the 'upstream connection' into the queue to be
 * destroyed. Note that the caller is responsible to validate and check
 * required mutex if this is being used in multi-worker mode.
 */
This function moves the 'upstream connection' into the queue to be
destroyed. Note that the caller is responsible to validate and check
required mutex if this is being used in multi-worker mode.
This function moves the ' upstream connection ' into the queue to be destroyed . Note that the caller is responsible to validate and check required mutex if this is being used in multi - worker mode .
static int prepare_destroy_conn(struct flb_upstream_conn *u_conn)
{
    struct flb_upstream *u = u_conn->u;
    struct flb_upstream_queue *uq;
    uq = flb_upstream_queue_get(u);
    flb_trace("[upstream] destroy connection #%i to %s:%i",
              u_conn->fd, u->tcp_host, u->tcp_port);
    if (u->flags & FLB_IO_ASYNC) {
        mk_event_del(u_conn->evl, &u_conn->event);
    }
    if (u_conn->fd > 0) {
        flb_socket_close(u_conn->fd);
        u_conn->fd = -1;
        u_conn->event.fd = -1;
    }
    mk_list_del(&u_conn->_head);
    mk_list_add(&u_conn->_head, &uq->destroy_queue);
    return 0;
}
static int prepare_destroy_conn ( struct flb_upstream_conn * u_conn ) { struct flb_upstream * u = u_conn -> u ; struct flb_upstream_queue * uq ; uq = flb_upstream_queue_get ( u ) ; flb_trace ( " " , u_conn -> fd , u -> tcp_host , u -> tcp_port ) ; if ( u -> flags & FLB_IO_ASYNC ) { mk_event_del ( u_conn -> evl , & u_conn -> event ) ; } if ( u_conn -> fd > 0 ) { flb_socket_close ( u_conn -> fd ) ; u_conn -> fd = -1 ; u_conn -> event . fd = -1 ; } mk_list_del ( & u_conn -> _head ) ; mk_list_add ( & u_conn -> _head , & uq -> destroy_queue ) ; return 0 ; }
This function moves the 'upstream connection' into the queue to be
 destroyed.
This function moves the ' upstream connection ' into the queue to be destroyed .
/* remove connection from the queue */ /* Add node to destroy queue */ /*
     * note: the connection context is destroyed by the engine once all events
     * have been processed.
     */