From: Amos Jeffries Date: Thu, 5 Jun 2014 09:32:50 +0000 (-0700) Subject: Cleanup: remove comm_read_cancel(AsyncCall) API X-Git-Tag: SQUID_3_5_0_1~202 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0d4e382bc2d8661a93b1fdfa56d237ead7f01c04;p=thirdparty%2Fsquid.git Cleanup: remove comm_read_cancel(AsyncCall) API Converting remaining users of the old API wrapper to Comm::ReadCancel. --- diff --git a/src/adaptation/icap/Xaction.cc b/src/adaptation/icap/Xaction.cc index f353e7b1b1..55b7436c79 100644 --- a/src/adaptation/icap/Xaction.cc +++ b/src/adaptation/icap/Xaction.cc @@ -428,7 +428,7 @@ void Adaptation::Icap::Xaction::cancelRead() { if (reader != NULL) { Must(haveConnection()); - comm_read_cancel(connection->fd, reader); + Comm::ReadCancel(connection->fd, reader); reader = NULL; } } diff --git a/src/base/AsyncCalls.dox b/src/base/AsyncCalls.dox index b0be201ee6..a14008c5f8 100644 --- a/src/base/AsyncCalls.dox +++ b/src/base/AsyncCalls.dox @@ -53,7 +53,7 @@ be dialed is irrelevant here. handle the call back, then it must cancel it. Whether that Call will be scheduled is irrelevant here. If the Recipient has an AsyncCall pointer, calling AsyncCall::cancel is sufficient, but the code should use -call-specific APIs when possible (e.g., comm_read_cancel or comm_close). +call-specific APIs when possible (e.g., Comm::ReadCancel or comm_close). - Processed calls should be forgotten: If you scheduled, received, or cancel the call, set its pointer to NULL. The Caller should forget the diff --git a/src/comm.cc b/src/comm.cc index 653e67c5a6..712d6e24d7 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1694,7 +1694,7 @@ commStopHalfClosedMonitor(int const fd) // cancel the read if one was scheduled AsyncCall::Pointer reader = fd_table[fd].halfClosedReader; if (reader != NULL) - comm_read_cancel(fd, reader); + Comm::ReadCancel(fd, reader); fd_table[fd].halfClosedReader = NULL; TheHalfClosed->del(fd); diff --git a/src/comm/Read.h b/src/comm/Read.h index 3ba7f3415a..69de56cc29 100644 --- a/src/comm/Read.h +++ b/src/comm/Read.h @@ -50,6 +50,5 @@ inline void comm_read(const Comm::ConnectionPointer &conn, char *buf, int len, A comm_read_base(conn, buf, len, callback); } void comm_read_cancel(int fd, IOCB *callback, void *data); -inline void comm_read_cancel(int fd, AsyncCall::Pointer &callback) {Comm::ReadCancel(fd,callback);} #endif /* _SQUID_COMM_READ_H */