Go to the documentation of this file.
147 const
char *host, const
char *
path);
167 const
char *username, const
char *password);
229 const
char *field, const
char *token);
417 uint_fast32_t stream_id,
bool eos);
423 const char *
const headers[][2]);
unsigned vlc_http_msg_get_retry_after(const struct vlc_http_msg *m)
Gets retry timeout.
Definition: message.c:835
#define VLC_FORMAT(x, y)
Definition: vlc_common.h:100
size_t count
Definition: core.c:461
const char * vlc_http_msg_get_path(const struct vlc_http_msg *m)
Gets request absolute path.
Definition: message.c:186
char * vlc_http_msg_get_basic_realm(const struct vlc_http_msg *m)
Definition: message.c:940
Definition: vlc_memstream.h:27
static const char vlc_http_error_loc
Definition: message.c:53
static int vlc_http_istoken(int c)
Definition: message.c:538
int strcasecmp(const char *, const char *)
static size_t vlc_http_token_length(const char *str)
Definition: message.c:553
struct vlc_h2_frame * vlc_http_msg_h2_frame(const struct vlc_http_msg *m, uint_fast32_t stream_id, bool eos)
Formats an HTTP 2.0 HEADER frame.
Definition: message.c:390
const struct vlc_http_stream_cbs * cbs
Definition: message.h:342
static struct vlc_http_msg * vlc_http_stream_read_headers(struct vlc_http_stream *s)
Reads one message header.
Definition: message.h:357
const char * vlc_http_msg_get_method(const struct vlc_http_msg *m)
Gets request method.
Definition: message.c:171
struct vlc_http_msg * vlc_http_msg_h2_headers(unsigned n, const char *const hdrs[][2])
Parses an HTTP 2.0 header table.
Definition: message.c:452
int vlc_http_msg_add_creds_basic(struct vlc_http_msg *m, bool proxy, const char *username, const char *password)
Adds Basic credentials.
Definition: message.c:958
struct tm * gmtime_r(const time_t *, struct tm *)
void vlc_http_msg_destroy(struct vlc_http_msg *m)
Destroys an HTTP message.
Definition: message.c:191
struct vlc_http_msg * vlc_http_msg_h2_headers(unsigned count, const char *const headers[][2])
Parses an HTTP 2.0 header table.
Definition: message.c:452
unsigned count
Definition: message.c:65
static size_t vlc_http_comment_length(const char *str)
Definition: message.c:668
struct vlc_http_msg * vlc_http_msg_iterate(struct vlc_http_msg *m)
Gets next response headers.
Definition: message.c:263
struct vlc_http_msg *(* read_headers)(struct vlc_http_stream *)
Definition: message.h:334
static struct block_t * vlc_http_stream_read(struct vlc_http_stream *s)
Reads message payload data.
Definition: message.h:371
static const char * vlc_http_get_token(const char *value, const char *token)
Definition: message.c:605
static size_t vlc_http_quoted_length(const char *str)
Definition: message.c:562
char * vlc_http_cookies_fetch(vlc_http_cookie_jar_t *p_jar, bool secure, const char *host, const char *path)
Returns a cookie value that match the given URL.
Definition: httpcookies.c:353
const char * vlc_http_next_token(const char *value)
Finds next token.
Definition: message.c:595
int vlc_http_msg_add_header(struct vlc_http_msg *m, const char *name, const char *fmt,...)
Definition: message.c:142
int asprintf(char **, const char *,...)
HTTP stream callbacks.
Definition: message.h:332
struct vlc_h2_frame * vlc_http_msg_h2_frame(const struct vlc_http_msg *m, uint_fast32_t stream_id, bool eos)
Formats an HTTP 2.0 HEADER frame.
Definition: message.c:390
char * vlc_b64_encode_binary(const uint8_t *src, size_t i_src)
Definition: strings.c:349
int vlc_http_msg_add_header(struct vlc_http_msg *, const char *name, const char *fmt,...) VLC_FORMAT(3
Formats a header field.
char * strndup(const char *, size_t)
int vlc_memstream_open(struct vlc_memstream *ms)
Definition: memstream.c:104
int vlc_http_msg_add_atime(struct vlc_http_msg *m)
Adds a Date header field.
Definition: message.c:779
time_t vlc_http_msg_get_atime(const struct vlc_http_msg *m)
Gets message date.
Definition: message.c:825
bool vlc_http_cookies_store(vlc_http_cookie_jar_t *p_jar, const char *cookies, const char *host, const char *path)
Parse a value of an incoming Set-Cookie header and append the cookie to the cookie jar if appropriate...
Definition: httpcookies.c:298
struct vlc_http_stream * payload
Definition: message.c:66
void vlc_http_msg_get_cookies(const struct vlc_http_msg *m, vlc_http_cookie_jar_t *jar, const char *host, const char *path)
Definition: message.c:887
static const char vlc_http_days[7][4]
Definition: message.c:756
const char * vlc_http_msg_get_agent(const struct vlc_http_msg *m)
Gets the agent field.
Definition: message.c:748
const char * vlc_http_msg_get_scheme(const struct vlc_http_msg *m)
Gets request scheme.
Definition: message.c:176
FILE * stream
Definition: vlc_memstream.h:65
struct vlc_http_msg * vlc_http_msg_get_initial(struct vlc_http_stream *s)
Definition: message.c:274
struct vlc_http_msg * vlc_http_req_create(const char *method, const char *scheme, const char *authority, const char *path)
Creates an HTTP request.
Definition: message.c:211
char * scheme
Definition: message.c:61
struct vlc_http_msg * vlc_http_msg_get_final(struct vlc_http_msg *m)
Gets final response headers.
Definition: message.c:282
static time_t vlc_http_mktime(const char *str)
Definition: message.c:787
const char * vlc_http_msg_get_token(const struct vlc_http_msg *msg, const char *field, const char *token)
Looks up a token in a header field.
Definition: message.c:662
short status
Definition: message.c:59
static const char vlc_http_months[12][4]
Definition: message.c:759
#define VLC_H2_DEFAULT_MAX_FRAME
Definition: h2frame.h:96
static bool vlc_http_is_token(const char *)
Definition: message.c:589
char *(* headers)[2]
Definition: message.c:64
Definition: vlc_fixups.h:133
struct vlc_http_msg * vlc_http_msg_headers(const char *msg) VLC_USED
Parses an HTTP 1.1 message header.
Definition: message.c:331
HTTP stream.
Definition: message.h:340
void *const vlc_http_error
Error pointer value.
Definition: message.c:55
time_t vlc_http_msg_get_time(const struct vlc_http_msg *m, const char *name)
Parses a timestamp header field.
Definition: message.c:817
void(* close)(struct vlc_http_stream *, bool abort)
Definition: message.h:336
Definition: httpcookies.c:266
struct vlc_http_msg * vlc_http_msg_headers(const char *msg)
Parses an HTTP 1.1 message header.
Definition: message.c:331
const char * vlc_http_msg_get_authority(const struct vlc_http_msg *m)
Gets request authority.
Definition: message.c:181
void vlc_http_msg_attach(struct vlc_http_msg *m, struct vlc_http_stream *s)
Definition: message.c:257
static char * vlc_http_get_token_value(const char *value, const char *token)
Definition: message.c:621
char * strdup(const char *)
static int vlc_http_msg_vadd_header(struct vlc_http_msg *m, const char *name, const char *fmt, va_list ap)
Definition: message.c:68
#define VLC_USED
Definition: fourcc_gen.c:31
int vlc_http_msg_add_agent(struct vlc_http_msg *m, const char *str)
Sets the agent field.
Definition: message.c:736
int() vlc_memstream_puts(struct vlc_memstream *ms, const char *str)
Definition: memstream.c:149
const char name[16]
Definition: httpd.c:1249
char * method
Definition: message.c:60
char * path
Definition: message.c:63
struct vlc_http_msg * vlc_http_resp_create(unsigned status)
Creates an HTTP response.
Definition: message.c:239
struct block_t *(* read)(struct vlc_http_stream *)
Definition: message.h:335
time_t vlc_http_msg_get_mtime(const struct vlc_http_msg *m)
Gets resource date.
Definition: message.c:830
#define unlikely(p)
Definition: vlc_common.h:114
int vlc_memstream_printf(struct vlc_memstream *ms, const char *fmt,...)
Definition: memstream.c:184
struct vlc_h2_frame * vlc_h2_frame_headers(uint_fast32_t stream_id, uint_fast32_t mtu, bool eos, unsigned count, const char *const headers[][2])
Definition: h2frame.c:155
time_t timegm(struct tm *)
static bool vlc_http_is_agent(const char *s)
Definition: message.c:698
const char * vlc_http_msg_get_header(const struct vlc_http_msg *m, const char *name)
Looks up an header field.
Definition: message.c:154
int vlc_http_msg_get_status(const struct vlc_http_msg *m)
Gets response status code.
Definition: message.c:166
block_t * vlc_http_msg_read(struct vlc_http_msg *m)
Receives HTTP data.
Definition: message.c:289
int vlc_http_msg_add_time(struct vlc_http_msg *m, const char *hname, const time_t *t)
Adds a timestamp header field.
Definition: message.c:764
static ssize_t vlc_http_msg_find_header(const struct vlc_http_msg *m, const char *name)
Definition: message.c:59
static void * vlc_alloc(size_t count, size_t size)
Definition: vlc_common.h:948
char * vlc_http_msg_format(const struct vlc_http_msg *m, size_t *restrict lenp, bool proxied) VLC_USED
Formats an HTTP 1.1 message header.
Definition: message.c:299
uintmax_t vlc_http_msg_get_size(const struct vlc_http_msg *m)
Gets HTTP payload length.
Definition: message.c:858
char * authority
Definition: message.c:62
char * vlc_http_msg_format(const struct vlc_http_msg *m, size_t *restrict lenp, bool proxied)
Formats an HTTP 1.1 message header.
Definition: message.c:299
Definition: vlc_block.h:111
int vlc_memstream_close(struct vlc_memstream *ms)
Definition: memstream.c:119
int vasprintf(char **, const char *, va_list)
static int vlc_http_isctext(int c)
Definition: message.c:546
int vlc_http_msg_add_cookies(struct vlc_http_msg *m, vlc_http_cookie_jar_t *jar)
Definition: message.c:899
static void vlc_http_stream_close(struct vlc_http_stream *s, bool abort)
Closes an HTTP stream.
Definition: message.h:382