upipe-modules/upipe_http_source.h header reference
Upipe source module for http GET requests More
Header inclusion [link]
Members [link]
Types [link]
- enum upipe_http_src_command
- struct upipe_http_src_hook
- enum upipe_http_src_hook_code
- enum upipe_http_src_mgr_command
- enum uprobe_http_src_event
Functions [link]
- const char * upipe_http_src_command_str(int cmd)
- int upipe_http_src_get_user_agent(struct upipe *upipe, const char **user_agent_p)
- void upipe_http_src_hook_release(struct upipe_http_src_hook *hook)
- struct upipe_http_src_hook * upipe_http_src_hook_use(struct upipe_http_src_hook *hook)
- struct upipe_mgr * upipe_http_src_mgr_alloc(void )
- int upipe_http_src_mgr_get_proxy(struct upipe_mgr *mgr, const char **proxy_p)
- int upipe_http_src_mgr_get_user_agent(struct upipe_mgr *mgr, const char **user_agent_p)
- int upipe_http_src_mgr_iterate_cookie(struct upipe_mgr *mgr, const char *domain, const char *path, struct uchain **uchain_p)
- int upipe_http_src_mgr_set_cookie(struct upipe_mgr *mgr, const char *string)
- int upipe_http_src_mgr_set_proxy(struct upipe_mgr *mgr, const char *proxy)
- int upipe_http_src_mgr_set_user_agent(struct upipe_mgr *mgr, const char *user_agent)
- int upipe_http_src_set_proxy(struct upipe *upipe, const char *proxy)
- int upipe_http_src_set_timeout(struct upipe *upipe, uint64_t timeout)
- int upipe_http_src_set_user_agent(struct upipe *upipe, const char *user_agent)
- int upipe_http_src_throw_error(struct upipe *upipe, unsigned int code)
- int upipe_http_src_throw_redirect(struct upipe *upipe, const char *uri)
- const char * uprobe_http_src_event_str(int event)
Description [link]
Upipe source module for http GET requests
Members detail [link]
#define UPIPE_HTTP_SRC_SIGNATURE [link]
This macro is declared in upipe-modules/upipe_http_source.h source file, line 38.
#define _UPIPE_MODULES_UPIPE_HTTP_SOURCE_H_ [link]
This macro is declared in upipe-modules/upipe_http_source.h source file, line 31.
enum upipe_http_src_command [link]
This enum is declared in upipe-modules/upipe_http_source.h source file, line 142.
This enum extends upipe_command with specific commands for http source.
| Identifier | Value | Description |
|---|---|---|
| UPIPE_HTTP_SRC_SENTINEL | 0x8000 | |
| UPIPE_HTTP_SRC_SET_PROXY | 1 | set the http proxy to use (const char *) |
| UPIPE_HTTP_SRC_SET_TIMEOUT | 2 | set the http read/write timeout (uint64_t) |
| UPIPE_HTTP_SRC_GET_USER_AGENT | 3 | get the current user agent (const char **) |
| UPIPE_HTTP_SRC_SET_USER_AGENT | 4 | set the user agent to use (const char *) |
const char * upipe_http_src_command_str(int cmd) [link]
This function is declared in upipe-modules/upipe_http_source.h source file, line 161.
This function converts an enum upipe_http_src_command to a string.
Parameter list:
- cmd: the enum to convert
The return value is a string
This function is declared in upipe-modules/upipe_http_source.h source file, line 193.
This function gets the current user agent.
Parameter list:
- upipe: description structure of the pipe
- user_agent_p: filled with the current user agent
The return value is an error code
struct upipe_http_src_hook [link]
This struct is declared in upipe-modules/upipe_http_source.h source file, line 49.
This struct stores a http source hook.
| Field | Description |
|---|---|
| struct urefcount * urefcount; | refcount on the structure |
| struct <anonymous> { | |
| int (*read)(struct upipe *upipe, struct upipe_http_src_hook *, int ) ; | called when the transport socket is ready for read |
| int (*write)(struct upipe *upipe, struct upipe_http_src_hook *, int ) ; | called when the transport socket is ready for write |
| } transport; | |
| struct <anonymous> { | |
| ssize_t (*read)(struct upipe *upipe, struct upipe_http_src_hook *, uint8_t *size_t ) ; | called when there is data for read |
| ssize_t (*write)(struct upipe *upipe, struct upipe_http_src_hook *, const uint8_t *size_t ) ; | called when there is space for data to write |
| } data; |
enum upipe_http_src_hook_code [link]
This enum is declared in upipe-modules/upipe_http_source.h source file, line 41.
| Identifier | Value | Description |
|---|---|---|
| UPIPE_HTTP_SRC_HOOK_TRANSPORT_READ | 1<<0 | |
| UPIPE_HTTP_SRC_HOOK_TRANSPORT_WRITE | 1<<1 | |
| UPIPE_HTTP_SRC_HOOK_DATA_READ | 1<<2 | |
| UPIPE_HTTP_SRC_HOOK_DATA_WRITE | 1<<3 |
void upipe_http_src_hook_release(struct upipe_http_src_hook *hook) [link]
This function is declared in upipe-modules/upipe_http_source.h source file, line 78.
struct upipe_http_src_hook * upipe_http_src_hook_use(struct upipe_http_src_hook *hook) [link]
This function is declared in upipe-modules/upipe_http_source.h source file, line 71.
This function is declared in upipe-modules/upipe_http_source.h source file, line 330.
This function returns the management structure for all http sources.
The return value is pointer to manager
enum upipe_http_src_mgr_command [link]
This enum is declared in upipe-modules/upipe_http_source.h source file, line 225.
This enum extends upipe_mgr_command with specific commands for http source.
| Identifier | Value | Description |
|---|---|---|
| UPIPE_HTTP_SRC_MGR_SENTINEL | 0x8000 | |
| UPIPE_HTTP_SRC_MGR_GET_PROXY | 1 | get the proxy url (const char **) |
| UPIPE_HTTP_SRC_MGR_SET_PROXY | 2 | set the proxy url (const char *) |
| UPIPE_HTTP_SRC_MGR_SET_COOKIE | 3 | add a cookie (const char *) |
| UPIPE_HTTP_SRC_MGR_ITERATE_COOKIE | 4 | iterate over cookies |
| UPIPE_HTTP_SRC_MGR_GET_USER_AGENT | 5 | get user agent (const char **) |
| UPIPE_HTTP_SRC_MGR_SET_USER_AGENT | 6 | set user agent (const char *) |
This function is declared in upipe-modules/upipe_http_source.h source file, line 265.
This function gets the proxy url to use by default for the new allocated pipes.
Parameter list:
- mgr: pointer to upipe manager
- proxy_p: a pointer the proxy url
The return value is an error code
This function is declared in upipe-modules/upipe_http_source.h source file, line 291.
This function gets the user agent to use by default for newly allocated pipes.
Parameter list:
- mgr: pointer to upipe manager
- user_agent_p: a pointer filled with the current user agent
The return value is an error code
int upipe_http_src_mgr_iterate_cookie(struct upipe_mgr *mgr, const char *domain, const char *path, struct uchain **uchain_p) [link]
This function is declared in upipe-modules/upipe_http_source.h source file, line 321.
This function iterates over the manager cookie list.
Parameter list:
- mgr: pointer to upipe manager
- domain: the domain to match
- path: the path to match
- uchain_p: iterator
The return value is an error code
This function is declared in upipe-modules/upipe_http_source.h source file, line 304.
This function adds a cookie in the manager cookie list.
Parameter list:
- mgr: pointer to upipe manager
- string: the cookie string to add
The return value is an error code
This function is declared in upipe-modules/upipe_http_source.h source file, line 252.
This function sets the proxy url to use by default for the new allocated pipes.
Parameter list:
- mgr: pointer to upipe manager
- proxy: the proxy url
The return value is an error code
This function is declared in upipe-modules/upipe_http_source.h source file, line 278.
This function sets the user agent to use by default for newly allocated pipes.
Parameter list:
- mgr: pointer to upipe manager
- user_agent: the user_agent
The return value is an error code
This function is declared in upipe-modules/upipe_http_source.h source file, line 180.
This function sets the http proxy to use.
Parameter list:
- upipe: description structure of the pipe
- proxy: the proxy url
The return value is an error code
This function is declared in upipe-modules/upipe_http_source.h source file, line 219.
This function sets the read/write timeout.
Parameter list:
- upipe: description structure of the pipe
- timeout: timeout value in 27MHz clock ticks
The return value is an error code
This function is declared in upipe-modules/upipe_http_source.h source file, line 206.
This function sets the user agent to use.
Parameter list:
- upipe: description structure of the pipe
- user_agent: user agent to use
The return value is an error code
This function is declared in upipe-modules/upipe_http_source.h source file, line 135.
This function throw an error code event.
Parameter list:
- upipe: description structure of the pipe
- code: HTTP error code
The return value is an error code
This function is declared in upipe-modules/upipe_http_source.h source file, line 122.
This function throw a redirect event.
Parameter list:
- upipe: description structure of the pipe
- uri: the temporary uri
The return value is an error code
enum uprobe_http_src_event [link]
This enum is declared in upipe-modules/upipe_http_source.h source file, line 84.
This enum extends uprobe_event with specific events for http source.
| Identifier | Value | Description |
|---|---|---|
| UPROBE_HTTP_SRC_SENTINEL | 0x8000 | |
| UPROBE_HTTP_SRC_REDIRECT | 1 | request receive a HTTP 302 redirect response with the url (const char *) |
| UPROBE_HTTP_SRC_ERROR | 2 | request receive an error code response with the error code (unsigned int) |
| UPROBE_HTTP_SRC_SCHEME_HOOK | 3 | request for scheme hook (struct uref *, struct upipe_http_src_hook **) |
const char * uprobe_http_src_event_str(int event) [link]
This function is declared in upipe-modules/upipe_http_source.h source file, line 104.
This function converts an enum uprobe_http_src_event to a string.
Parameter list:
- event: the enum to convert
The return value is a string