Mgr::StoreToCommWriter::StoreToCommWriter(const Comm::ConnectionPointer &conn, StoreEntry* anEntry):
AsyncJob("Mgr::StoreToCommWriter"),
- clientConnection(conn), entry(anEntry), sc(NULL), writeOffset(0), closer(NULL)
+ clientConnection(conn), entry(anEntry), sc(nullptr), writeOffset(0), closer(nullptr)
{
debugs(16, 6, clientConnection);
closer = asyncCall(16, 5, "Mgr::StoreToCommWriter::noteCommClosed",
Mgr::StoreToCommWriter::close()
{
if (Comm::IsConnOpen(clientConnection)) {
- if (closer != NULL) {
+ if (closer != nullptr) {
comm_remove_close_handler(clientConnection->fd, closer);
- closer = NULL;
+ closer = nullptr;
}
clientConnection->close();
}
{
debugs(16, 6, MYNAME);
Must(Comm::IsConnOpen(clientConnection));
- Must(entry != NULL);
+ Must(entry != nullptr);
AsyncCall::Pointer call = asyncCall(16, 4, "StoreToCommWriter::Abort", cbdataDialer(&StoreToCommWriter::HandleStoreAbort, this));
entry->registerAbortCallback(call);
sc = storeClientListAdd(entry, this);
- Must(sc != NULL);
+ Must(sc != nullptr);
// initiate the receive-from-store, write-to-comm sequence
scheduleStoreCopy();
Mgr::StoreToCommWriter::scheduleStoreCopy()
{
debugs(16, 6, MYNAME);
- Must(entry != NULL);
- Must(sc != NULL);
+ Must(entry != nullptr);
+ Must(sc != nullptr);
StoreIOBuffer readBuf(sizeof(buffer), writeOffset, buffer);
storeClientCopy(sc, entry, readBuf, &NoteStoreCopied, this);
}
void
Mgr::StoreToCommWriter::NoteStoreCopied(void* data, StoreIOBuffer ioBuf)
{
- Must(data != NULL);
+ Must(data != nullptr);
// make sync Store call async to get async call protections and features
StoreToCommWriter* writer = static_cast<StoreToCommWriter*>(data);
typedef UnaryMemFunT<StoreToCommWriter, StoreIOBuffer> MyDialer;
{
debugs(16, 6, MYNAME);
Must(Comm::IsConnOpen(clientConnection));
- Must(ioBuf.data != NULL);
+ Must(ioBuf.data != nullptr);
// write filled buffer
typedef CommCbMemFunT<StoreToCommWriter, CommIoCbParams> MyDialer;
AsyncCall::Pointer writer =
asyncCall(16, 5, "Mgr::StoreToCommWriter::noteCommWrote",
MyDialer(this, &StoreToCommWriter::noteCommWrote));
- Comm::Write(clientConnection, ioBuf.data, ioBuf.length, writer, NULL);
+ Comm::Write(clientConnection, ioBuf.data, ioBuf.length, writer, nullptr);
}
void
{
debugs(16, 6, MYNAME);
Must(params.flag == Comm::OK);
- Must(clientConnection != NULL && params.fd == clientConnection->fd);
+ Must(clientConnection != nullptr && params.fd == clientConnection->fd);
Must(params.size != 0);
writeOffset += params.size;
if (!doneAll())
Mgr::StoreToCommWriter::swanSong()
{
debugs(16, 6, MYNAME);
- if (entry != NULL) {
- if (sc != NULL) {
+ if (entry != nullptr) {
+ if (sc != nullptr) {
storeUnregister(sc, entry, this);
- sc = NULL;
+ sc = nullptr;
}
entry->unregisterAbortCallback("StoreToCommWriter done");
entry->unlock("Mgr::StoreToCommWriter::swanSong");
- entry = NULL;
+ entry = nullptr;
}
close();
}