src/elastic-connection.c
static void
elastic_connection_search_response(const struct http_response *response,
                                   struct elastic_connection *conn)
{
    FUNC_START();
    /* 404's usually mean the index is missing.
     * it could mean you also hit a non-ES service
     * 400 means request json is malformed */
    if (response->status / 100 != 2) {
        i_error("fts_elastic: search failed: %d %s",
                    response->status, response->reason);
        conn->request_status = -1;
    }

    if (response->payload == NULL) {
        i_error("fts_elastic: search failed: empty response payload");
        conn->request_status = -1;
        return;
    }

    i_stream_ref(response->payload);
    conn->payload = response->payload;
    conn->io = io_add_istream(response->payload,
                    elastic_connection_payload_input, conn);
    elastic_connection_payload_input(conn);
    FUNC_END();
}
/* Parses HTTP response from _search request */
Parses HTTP response from _search request
Parses HTTP response from _search request
static void
elastic_connection_search_response(const struct http_response *response,
                                   struct elastic_connection *conn)
{
    FUNC_START();
    if (response->status / 100 != 2) {
        i_error("fts_elastic: search failed: %d %s",
                    response->status, response->reason);
        conn->request_status = -1;
    }
    if (response->payload == NULL) {
        i_error("fts_elastic: search failed: empty response payload");
        conn->request_status = -1;
        return;
    }
    i_stream_ref(response->payload);
    conn->payload = response->payload;
    conn->io = io_add_istream(response->payload,
                    elastic_connection_payload_input, conn);
    elastic_connection_payload_input(conn);
    FUNC_END();
}
static void elastic_connection_search_response ( const struct http_response * response , struct elastic_connection * conn ) { FUNC_START ( ) ; if ( response -> status / 100 != 2 ) { i_error ( " " , response -> status , response -> reason ) ; conn -> request_status = -1 ; } if ( response -> payload == NULL ) { i_error ( " " ) ; conn -> request_status = -1 ; return ; } i_stream_ref ( response -> payload ) ; conn -> payload = response -> payload ; conn -> io = io_add_istream ( response -> payload , elastic_connection_payload_input , conn ) ; elastic_connection_payload_input ( conn ) ; FUNC_END ( ) ; }
Parses HTTP response from _search request
Parses HTTP response from _search request
/* 404's usually mean the index is missing.
     * it could mean you also hit a non-ES service
     * 400 means request json is malformed */