+/*
+ * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
#include "squid.h"
#include "comm/Connection.h"
#include "comm/IoCallback.h"
#include "globals.h"
#include "MemBuf.h"
#include "profiler/Profiler.h"
-#include "protos.h"
#include "SquidTime.h"
#include "StatCounters.h"
-
#if USE_DELAY_POOLS
#include "ClientInfo.h"
#endif
-#if HAVE_ERRNO_H
-#include <errno.h>
-#endif
+
+#include <cerrno>
void
Comm::Write(const Comm::ConnectionPointer &conn, MemBuf *mb, AsyncCall::Pointer &callback)
if (nleft != 0)
debugs(5, DBG_IMPORTANT, "FD " << fd << " write failure: connection closed with " << nleft << " bytes remaining.");
- state->finish(nleft ? COMM_ERROR : COMM_OK, errno);
+ state->finish(nleft ? Comm::COMM_ERROR : Comm::OK, errno);
} else if (len < 0) {
/* An error */
if (fd_table[fd].flags.socket_eof) {
debugs(50, 2, HERE << "FD " << fd << " write failure: " << xstrerror() << ".");
- state->finish(nleft ? COMM_ERROR : COMM_OK, errno);
+ state->finish(nleft ? Comm::COMM_ERROR : Comm::OK, errno);
} else if (ignoreErrno(errno)) {
debugs(50, 9, HERE << "FD " << fd << " write failure: " << xstrerror() << ".");
state->selectOrQueueWrite();
} else {
debugs(50, 2, HERE << "FD " << fd << " write failure: " << xstrerror() << ".");
- state->finish(nleft ? COMM_ERROR : COMM_OK, errno);
+ state->finish(nleft ? Comm::COMM_ERROR : Comm::OK, errno);
}
} else {
/* A successful write, continue */
/* Not done, reinstall the write handler and write some more */
state->selectOrQueueWrite();
} else {
- state->finish(nleft ? COMM_OK : COMM_ERROR, errno);
+ state->finish(nleft ? Comm::OK : Comm::COMM_ERROR, errno);
}
}
PROF_stop(commHandleWrite);
}
+