]> git.ipfire.org Git - thirdparty/squid.git/blame - src/mime_header.h
Source Format Enforcement (#763)
[thirdparty/squid.git] / src / mime_header.h
CommitLineData
b6149797 1/*
f70aedc4 2 * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
b6149797 3 *
bbc27441
AJ
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.
b6149797
FC
7 */
8
bbc27441
AJ
9/* DEBUG: section 25 MiME Header Parsing */
10
b6149797
FC
11#ifndef SQUID_MIME_HEADER_H_
12#define SQUID_MIME_HEADER_H_
13
00237269
AJ
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
69c698a3
EB
21 * - LF LF or,
22 * if mime header block is empty:
23 * - LF or
24 * - CRLF
00237269
AJ
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 */
31size_t headersEnd(const char *, size_t, bool &containsObsFold);
32
33inline size_t
34headersEnd(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
40inline size_t
41headersEnd(const char *buf, size_t sz)
42{
43 bool ignored;
44 return headersEnd(buf, sz, ignored);
45}
b6149797
FC
46
47#endif /* SQUID_MIME_HEADER_H_ */
f53969cc 48