mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-07 14:03:14 +02:00
New URL API (not really a unrealircd module api tho) - work in progress.
No longer url_start_async(a,b,c,d,e,f,g,...) but usings structs so simply url_start_async(tehstruct); makes it easy to add fields later without forcing all modules to change the prototype. Work in progress....
This commit is contained in:
@@ -1881,7 +1881,27 @@ struct HTTPForwardedHeader
|
||||
char ip[IPLEN+1];
|
||||
};
|
||||
|
||||
typedef struct OutgoingWebRequest OutgoingWebRequest;
|
||||
/** An outgoing web request (eg remote includes download) */
|
||||
struct OutgoingWebRequest
|
||||
{
|
||||
vFP callback;
|
||||
void *callback_data;
|
||||
char *url; /**< must be freed by url_do_transfers_async() */
|
||||
char *actual_url; /**< if you actually want to use a different url, mostly for redirects (end-users: don't set this!) */
|
||||
HttpMethod http_method;
|
||||
char *body;
|
||||
NameValuePrioList *headers;
|
||||
int store_in_file;
|
||||
time_t cachetime;
|
||||
int max_redirects;
|
||||
// If you are adding allocated fields here:
|
||||
// 1) update duplicate_outgoingwebrequest() in src/misc.c
|
||||
// 2) and update url_free_handle_request_portion() there as well
|
||||
};
|
||||
|
||||
typedef struct WebRequest WebRequest;
|
||||
/** An incoming web request */
|
||||
struct WebRequest {
|
||||
HttpMethod method; /**< GET/PUT/POST */
|
||||
char *uri; /**< Requested resource, eg "/api" */
|
||||
|
||||
Reference in New Issue
Block a user