Example #1
0
/*
    Eat remaining input incase last request did not consume all data
 */
static void consumeLastRequest(HttpConn *conn)
{
    char    junk[4096];

    if (conn->state >= HTTP_STATE_FIRST) {
        while (!httpIsEof(conn) && !httpRequestExpired(conn, 0)) {
            if (httpRead(conn, junk, sizeof(junk)) <= 0) {
                break;
            }
        }
    }
    if (HTTP_STATE_CONNECTED <= conn->state && conn->state < HTTP_STATE_COMPLETE) {
        conn->keepAliveCount = 0;
    }
}
Example #2
0
PUBLIC void httpPrepClientConn(HttpConn *conn, bool keepHeaders)
{
    MprHash     *headers;

    assert(conn);
    if (conn->keepAliveCount > 0 && conn->sock) {
        if (!httpIsEof(conn)) {
            conn->sock = 0;
        }
    } else {
        conn->input = 0;
    }
    conn->connError = 0;
    if (conn->tx) {
        conn->tx->conn = 0;
    }
    if (conn->rx) {
        conn->rx->conn = 0;
    }
    headers = (keepHeaders && conn->tx) ? conn->tx->headers: NULL;
    conn->tx = httpCreateTx(conn, headers);
    conn->rx = httpCreateRx(conn);
    commonPrep(conn);
}
Example #3
0
PUBLIC bool isEof()
{
    return httpIsEof(getStream());
}
Example #4
0
bool espIsEof(HttpConn *conn)
{
    return httpIsEof(conn);
}
Example #5
0
PUBLIC bool isEof()
{
    return httpIsEof(getConn());
}