mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-21 18:21:51 +00:00
add helper function for accessing connection method
This commit is contained in:
parent
c9ca0489ed
commit
5ac432026a
@ -46,6 +46,8 @@ void net_http_connection_set_user_agent(struct http_connection_t* conn, const ch
|
||||
|
||||
const char *net_http_connection_url(struct http_connection_t *conn);
|
||||
|
||||
const char* net_http_connection_method(struct http_connection_t* conn);
|
||||
|
||||
struct http_t *net_http_new(struct http_connection_t *conn);
|
||||
|
||||
/* You can use this to call net_http_update
|
||||
|
@ -682,6 +682,11 @@ const char *net_http_connection_url(struct http_connection_t *conn)
|
||||
return conn->urlcopy;
|
||||
}
|
||||
|
||||
const char* net_http_connection_method(struct http_connection_t* conn)
|
||||
{
|
||||
return conn->methodcopy;
|
||||
}
|
||||
|
||||
struct http_t *net_http_new(struct http_connection_t *conn)
|
||||
{
|
||||
bool error = false;
|
||||
|
@ -282,11 +282,13 @@ static void* task_push_http_transfer_generic(
|
||||
{
|
||||
retro_task_t *t = NULL;
|
||||
http_handle_t *http = NULL;
|
||||
const char *method = NULL;
|
||||
|
||||
if (!conn)
|
||||
return NULL;
|
||||
|
||||
if (conn->methodcopy && (conn->methodcopy[0] == 'P' || conn->methodcopy[0] == 'p'))
|
||||
method = net_http_connection_method(conn);
|
||||
if (method && (method[0] == 'P' || method[0] == 'p'))
|
||||
{
|
||||
/* POST requests usually mutate the server, so assume multiple calls are
|
||||
* intended, even if they're duplicated. Additionally, they may differ
|
||||
|
Loading…
x
Reference in New Issue
Block a user