]> git.ipfire.org Git - thirdparty/squid.git/blame - src/HttpControlMsg.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / HttpControlMsg.cc
CommitLineData
84540b47 1/*
ef57eb7b 2 * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
84540b47
AJ
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9#include "squid.h"
10#include "comm/Flag.h"
11#include "CommCalls.h"
12#include "HttpControlMsg.h"
13
14/// called when we wrote the 1xx response
15void
16HttpControlMsgSink::wroteControlMsg(const CommIoCbParams &params)
17{
18 if (params.flag == Comm::ERR_CLOSING)
19 return;
20
21 if (params.flag == Comm::OK) {
22 if (cbControlMsgSent)
23 ScheduleCallHere(cbControlMsgSent);
24 return;
25 }
26
27 debugs(33, 3, "1xx writing failed: " << xstrerr(params.xerrno));
28 // no error notification: see HttpControlMsg.h for rationale and
29 // note that some errors are detected elsewhere (e.g., close handler)
30
31 // close on 1xx errors to be conservative and to simplify the code
32 // (if we do not close, we must notify the source of a failure!)
33 params.conn->close();
34
35 // XXX: writeControlMsgAndCall() should handle writer-specific writing
36 // results, including errors and then call us with success/failure outcome.
37}
38