* A refcounted pointer so that FwdState stays around as long as
* this clientReplyContext does
*/
- FwdState::fwdStart(http->getConn() != NULL ? http->getConn()->fd : -1,
- http->storeEntry(),
- http->request);
- /* Register with storage manager to receive updates when data comes in. */
+ Comm::ConnectionPointer conn = http->getConn() != NULL ? http->getConn()->clientConn : NULL;
+ FwdState::fwdStart(conn, http->storeEntry(), http->request);
+ /* Register with storage manager to receive updates when data comes in. */
if (EBIT_TEST(entry->flags, ENTRY_ABORTED))
debugs(88, 0, "clientReplyContext::processExpired: Found ENTRY_ABORTED object");
r->clientConnection = http->getConn();
/** Start forwarding to get the new object from network */
- FwdState::fwdStart(http->getConn() != NULL ? http->getConn()->fd : -1,
- http->storeEntry(),
- r);
+ Comm::ConnectionPointer conn = http->getConn() != NULL ? http->getConn()->clientConn : NULL;
+ FwdState::fwdStart(conn, http->storeEntry(), r);
}
}
ConnStateData * conn = http->getConn();
- int fd = conn != NULL ? conn->fd : -1;
- if (fd >= 0 && fd_table[fd].closing()) { // too late, our conn is closing
- // TODO: should we also quit when fd is negative?
- debugs(33,3, HERE << "not sending more data to a closing FD " << fd);
+ // AYJ: this seems a bit weird to ignore CLOSED but drop on closing.
+ if (conn != NULL && Comm::IsConnOpen(conn->clientConn) && fd_table[conn->clientConn->fd].closing()) {
+ // too late, our conn is closing
+ // TODO: should we also quit?
+ debugs(33,3, HERE << "not sending more data to a closing " << conn->clientConn);
return;
}
}
if (reqofs==0 && !logTypeIsATcpHit(http->logType)) {
- assert(fd >= 0); // the beginning of this method implies fd may be -1
+ assert(conn != NULL && Comm::IsConnOpen(conn->clientConn)); // the beginning of this method implies FD may be closed.
if (Ip::Qos::TheConfig.isHitTosActive()) {
- Ip::Qos::doTosLocalMiss(fd, http->request->hier.code);
+ Ip::Qos::doTosLocalMiss(conn->clientConn, http->request->hier.code);
}
if (Ip::Qos::TheConfig.isHitNfmarkActive()) {
- Ip::Qos::doNfmarkLocalMiss(fd, http->request->hier.code);
+ Ip::Qos::doNfmarkLocalMiss(conn->clientConn, http->request->hier.code);
}
}
reqofs << " bytes (" << result.length <<
" new bytes)");
debugs(88, 5, "clientReplyContext::sendMoreData:"
- " FD " << fd <<
+ << conn->clientConn <<
" '" << entry->url() << "'" <<
" out.offset=" << http->out.offset);
return;
}
-
-
/* Using this breaks the client layering just a little!
*/
void