79 char *buf,
size_t len ) {
101 ( missing ?
", MissingDataRequest=true" :
"" ) );
106 .
name =
"X-P2P-PeerDist",
119 char *buf,
size_t len ) {
127 return snprintf ( buf,
len, (
"MinContentInformation=1.0, " 128 "MaxContentInformation=2.0" ) );
133 .
name =
"X-P2P-PeerDistEx",
158 .description =
"PeerDist enabled",
159 .type = &setting_type_int8,
struct interface xfer
Data transfer interface.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static int apply_peerdist_settings(void)
Apply PeerDist settings.
static int http_format_p2p_peerdist(struct http_transaction *http, char *buf, size_t len)
Format HTTP "X-P2P-PeerDist" header.
int peermux_filter(struct interface *xfer, struct interface *info, struct uri *uri)
Add PeerDist content-encoding filter.
struct uri * uri
Request URI.
struct http_request_header http_request_p2p_peerdist __http_request_header
HTTP "X-P2P-PeerDist" header.
static long peerdist_enabled
PeerDist is globally enabled.
#define SETTING_MISC
Miscellaneous settings.
int fetch_int_setting(struct settings *settings, const struct setting *setting, long *value)
Fetch value of signed integer setting.
An HTTP content encoding.
struct http_request_range range
Range descriptor.
struct http_request request
Request.
Hyper Text Transport Protocol.
Peer Content Caching and Retrieval (PeerDist) protocol multiplexer.
struct interface content
Content-decoded interface.
struct interface transfer
Transfer-decoded interface.
size_t len
Range length, or zero for no range request.
static int http_format_p2p_peerdistex(struct http_transaction *http, char *buf, size_t len)
Format HTTP "X-P2P-PeerDistEx" header.
static int http_peerdist_init(struct http_transaction *http)
Initialise PeerDist content encoding.
struct http_content_encoding peerdist_encoding __http_content_encoding
PeerDist HTTP content encoding.
int(* apply)(void)
Apply updated settings.
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
static int http_peerdist_supported(struct http_transaction *http)
Check whether or not to support PeerDist encoding for this request.
uint32_t supported
Bitmask of supported AENQ groups (device -> host)
#define NULL
NULL pointer (VOID *)
struct settings_applicator peerdist_applicator __settings_applicator
PeerDist settings applicator.
const struct setting peerdist_setting __setting(SETTING_MISC, peerdist)
PeerDist enabled setting.