]> git.ipfire.org Git - thirdparty/squid.git/blob - src/mime_header.h
Docs: Copyright updates for 2018 (#114)
[thirdparty/squid.git] / src / mime_header.h
1 /*
2 * Copyright (C) 1996-2018 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_MIME_HEADER_H_
12 #define SQUID_MIME_HEADER_H_
13
14 /**
15 * Scan for the end of mime header block.
16 *
17 * Which is one of the following octet patterns:
18 * - CRLF CRLF, or
19 * - CRLF LF, or
20 * - LF CRLF, or
21 * - LF LF or,
22 * if mime header block is empty:
23 * - LF or
24 * - CRLF
25 *
26 * Also detects whether a obf-fold pattern exists within the mime block
27 * - CR*LF (SP / HTAB)
28 *
29 * \param containsObsFold will be set to true if obs-fold pattern is found.
30 */
31 size_t headersEnd(const char *, size_t, bool &containsObsFold);
32
33 inline size_t
34 headersEnd(const SBuf &buf, bool &containsObsFold)
35 {
36 return headersEnd(buf.rawContent(), buf.length(), containsObsFold);
37 }
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_MIME_HEADER_H_ */
48