#include "squid.h"
#include "base/Packable.h"
#include "debug/Stream.h"
#include "enums.h"
#include "HttpHdrContRange.h"
#include "HttpHeaderTools.h"
Go to the source code of this file.
Macros | |
#define | range_spec_unknown (-1) |
#define | known_spec(s) ((s) != range_spec_unknown) |
#define | size_min(a, b) ((a) <= (b) ? (a) : (b)) |
#define | size_diff(a, b) ((a) >= (b) ? ((a)-(b)) : 0) |
Functions | |
static int | httpHdrRangeRespSpecParseInit (HttpHdrRangeSpec *spec, const char *field, int flen) |
static void | httpHdrRangeRespSpecPackInto (const HttpHdrRangeSpec *spec, Packable *p) |
HttpHdrContRange * | httpHdrContRangeCreate (void) |
HttpHdrContRange * | httpHdrContRangeParseCreate (const char *str) |
int | httpHdrContRangeParseInit (HttpHdrContRange *range, const char *str) |
HttpHdrContRange * | httpHdrContRangeDup (const HttpHdrContRange *range) |
void | httpHdrContRangePackInto (const HttpHdrContRange *range, Packable *p) |
void | httpHdrContRangeSet (HttpHdrContRange *cr, HttpHdrRangeSpec spec, int64_t ent_len) |
Macro Definition Documentation
◆ known_spec
#define known_spec | ( | s | ) | ((s) != range_spec_unknown) |
Definition at line 34 of file HttpHdrContRange.cc.
◆ range_spec_unknown
#define range_spec_unknown (-1) |
Definition at line 31 of file HttpHdrContRange.cc.
◆ size_diff
#define size_diff | ( | a, | |
b | |||
) | ((a) >= (b) ? ((a)-(b)) : 0) |
Definition at line 36 of file HttpHdrContRange.cc.
◆ size_min
#define size_min | ( | a, | |
b | |||
) | ((a) <= (b) ? (a) : (b)) |
Definition at line 35 of file HttpHdrContRange.cc.
Function Documentation
◆ httpHdrContRangeCreate()
HttpHdrContRange * httpHdrContRangeCreate | ( | void | ) |
Definition at line 118 of file HttpHdrContRange.cc.
References HttpHdrContRange::elength, HttpHdrRangeSpec::length, HttpHdrRangeSpec::offset, range_spec_unknown, and HttpHdrContRange::spec.
Referenced by httpHdrContRangeDup(), httpHdrContRangeParseCreate(), and httpHeaderAddContRange().
◆ httpHdrContRangeDup()
HttpHdrContRange * httpHdrContRangeDup | ( | const HttpHdrContRange * | range | ) |
Definition at line 196 of file HttpHdrContRange.cc.
References assert, and httpHdrContRangeCreate().
◆ httpHdrContRangePackInto()
void httpHdrContRangePackInto | ( | const HttpHdrContRange * | range, |
Packable * | p | ||
) |
Definition at line 206 of file HttpHdrContRange.cc.
References Packable::append(), Packable::appendf(), assert, HttpHdrContRange::elength, httpHdrRangeRespSpecPackInto(), known_spec, PRId64, and HttpHdrContRange::spec.
Referenced by HttpHeader::putContRange().
◆ httpHdrContRangeParseCreate()
HttpHdrContRange * httpHdrContRangeParseCreate | ( | const char * | str | ) |
Definition at line 127 of file HttpHdrContRange.cc.
References httpHdrContRangeCreate(), and httpHdrContRangeParseInit().
Referenced by HttpHeader::getContRange().
◆ httpHdrContRangeParseInit()
int httpHdrContRangeParseInit | ( | HttpHdrContRange * | crange, |
const char * | crange_spec | ||
) |
returns true if range is valid; inits HttpHdrContRange
Definition at line 141 of file HttpHdrContRange.cc.
References assert, debugs, HttpHdrContRange::elength, httpHdrRangeRespSpecParseInit(), httpHeaderParseOffset(), known_spec, HttpHdrRangeSpec::length, HttpHdrRangeSpec::offset, range_spec_unknown, and HttpHdrContRange::spec.
Referenced by httpHdrContRangeParseCreate().
◆ httpHdrContRangeSet()
void httpHdrContRangeSet | ( | HttpHdrContRange * | cr, |
HttpHdrRangeSpec | spec, | ||
int64_t | ent_len | ||
) |
inits with given spec
Definition at line 220 of file HttpHdrContRange.cc.
References assert, HttpHdrContRange::elength, and HttpHdrContRange::spec.
Referenced by httpHeaderAddContRange().
◆ httpHdrRangeRespSpecPackInto()
|
static |
Definition at line 102 of file HttpHdrContRange.cc.
References Packable::append(), Packable::appendf(), assert, known_spec, HttpHdrRangeSpec::length, HttpHdrRangeSpec::offset, and PRId64.
Referenced by httpHdrContRangePackInto().
◆ httpHdrRangeRespSpecParseInit()
|
static |
Definition at line 42 of file HttpHdrContRange.cc.
References assert, debugs, httpHeaderParseOffset(), HttpHdrRangeSpec::length, HttpHdrRangeSpec::offset, range_spec_unknown, and size_diff.
Referenced by httpHdrContRangeParseInit().