]> git.ipfire.org Git - thirdparty/squid.git/blob - src/mime_header.h
Bug 5069: Keep listening after getsockname() error (#1713)
[thirdparty/squid.git] / src / mime_header.h
1 /*
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
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 /* DEBUG: section 25 MiME Header Parsing */
10
11 #ifndef SQUID_SRC_MIME_HEADER_H
12 #define SQUID_SRC_MIME_HEADER_H
13
14 #include "sbuf/forward.h"
15
16 #include <cstddef>
17
18 /**
19 * Scan for the end of mime header block.
20 *
21 * Which is one of the following octet patterns:
22 * - CRLF CRLF, or
23 * - CRLF LF, or
24 * - LF CRLF, or
25 * - LF LF or,
26 * if mime header block is empty:
27 * - LF or
28 * - CRLF
29 *
30 * Also detects whether a obf-fold pattern exists within the mime block
31 * - CR*LF (SP / HTAB)
32 *
33 * \param containsObsFold will be set to true if obs-fold pattern is found.
34 */
35 size_t headersEnd(const char *, size_t, bool &containsObsFold);
36
37 size_t headersEnd(const SBuf &buf, bool &containsObsFold);
38
39 /// \deprecated caller needs to be fixed to handle obs-fold
40 inline size_t
41 headersEnd(const char *buf, size_t sz)
42 {
43 bool ignored;
44 return headersEnd(buf, sz, ignored);
45 }
46
47 #endif /* SQUID_SRC_MIME_HEADER_H */
48