/* 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; } }
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); }
PUBLIC bool isEof() { return httpIsEof(getStream()); }
bool espIsEof(HttpConn *conn) { return httpIsEof(conn); }
PUBLIC bool isEof() { return httpIsEof(getConn()); }