plugins/in_forward/fw.c
static int in_fw_collect(struct flb_input_instance *ins,
                         struct flb_config *config, void *in_context)
{
    int fd;
    struct fw_conn *conn;
    struct flb_in_fw_config *ctx = in_context;

    /* Accept the new connection */
    fd = flb_net_accept(ctx->server_fd);
    if (fd == -1) {
        flb_plg_error(ins, "could not accept new connection");
        return -1;
    }

    if (config->is_ingestion_active == FLB_FALSE) {
        mk_event_closesocket(fd);
        return -1;
    }

    flb_plg_trace(ins, "new TCP connection arrived FD=%i", fd);
    conn = fw_conn_add(fd, ctx);
    if (!conn) {
        return -1;
    }
    return 0;
}
/*
 * For a server event, the collection event means a new client have arrived, we
 * accept the connection and create a new FW instance which will wait for
 * MessagePack records.
 */
For a server event, the collection event means a new client have arrived, we
accept the connection and create a new FW instance which will wait for
MessagePack records.
For a server event the collection event means a new client have arrived we accept the connection and create a new FW instance which will wait for MessagePack records .
static int in_fw_collect(struct flb_input_instance *ins,
                         struct flb_config *config, void *in_context)
{
    int fd;
    struct fw_conn *conn;
    struct flb_in_fw_config *ctx = in_context;
    fd = flb_net_accept(ctx->server_fd);
    if (fd == -1) {
        flb_plg_error(ins, "could not accept new connection");
        return -1;
    }
    if (config->is_ingestion_active == FLB_FALSE) {
        mk_event_closesocket(fd);
        return -1;
    }
    flb_plg_trace(ins, "new TCP connection arrived FD=%i", fd);
    conn = fw_conn_add(fd, ctx);
    if (!conn) {
        return -1;
    }
    return 0;
}
static int in_fw_collect ( struct flb_input_instance * ins , struct flb_config * config , void * in_context ) { int fd ; struct fw_conn * conn ; struct flb_in_fw_config * ctx = in_context ; fd = flb_net_accept ( ctx -> server_fd ) ; if ( fd == -1 ) { flb_plg_error ( ins , " " ) ; return -1 ; } if ( config -> is_ingestion_active == FLB_FALSE ) { mk_event_closesocket ( fd ) ; return -1 ; } flb_plg_trace ( ins , " " , fd ) ; conn = fw_conn_add ( fd , ctx ) ; if ( ! conn ) { return -1 ; } return 0 ; }
For a server event, the collection event means a new client have arrived, we
 accept the connection and create a new FW instance which will wait for
 MessagePack records.
For a server event the collection event means a new client have arrived we accept the connection and create a new FW instance which will wait for MessagePack records .
/* Accept the new connection */