Skip to content
7 changes: 7 additions & 0 deletions configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -1619,10 +1619,17 @@ static struct config_array_setting *populate_settings_array(

#ifdef HAVE_NETWORKING
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why move this down a line?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was having a problem when I was finding the right place for some of the config and #ifdefs and had forced myself into a faux problem with netplay_mitm_server. Looks like I didn't revert that pushdown, I'll move it back up.

SETTING_ARRAY("netplay_mitm_server", settings->arrays.netplay_mitm_server, false, NULL, true);
#ifdef HAVE_CLOUDSYNC
SETTING_ARRAY("webdav_url", settings->arrays.webdav_url, false, NULL, true);
SETTING_ARRAY("webdav_username", settings->arrays.webdav_username, false, NULL, true);
SETTING_ARRAY("webdav_password", settings->arrays.webdav_password, false, NULL, true);
SETTING_ARRAY("google_drive_refresh_token", settings->arrays.google_drive_refresh_token, false, NULL, true);
#ifdef HAVE_S3
SETTING_ARRAY("s3_url", settings->arrays.s3_url, false, NULL, true);
SETTING_ARRAY("access_key_id", settings->arrays.access_key_id, false, NULL, true);
SETTING_ARRAY("secret_access_key", settings->arrays.secret_access_key, false, NULL, true);
#endif
#endif
SETTING_ARRAY("youtube_stream_key", settings->arrays.youtube_stream_key, true, NULL, true);
SETTING_ARRAY("twitch_stream_key", settings->arrays.twitch_stream_key, true, NULL, true);
SETTING_ARRAY("facebook_stream_key", settings->arrays.facebook_stream_key, true, NULL, true);
Expand Down
9 changes: 9 additions & 0 deletions configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,19 @@ typedef struct settings
char audio_device[NAME_MAX_LENGTH];
char camera_device[NAME_MAX_LENGTH];
char netplay_mitm_server[NAME_MAX_LENGTH];
#ifdef HAVE_NETWORKING
#ifdef HAVE_CLOUDSYNC
char webdav_url[NAME_MAX_LENGTH];
char webdav_username[NAME_MAX_LENGTH];
char webdav_password[NAME_MAX_LENGTH];
char google_drive_refresh_token[2048];
#ifdef HAVE_S3
char s3_url[NAME_MAX_LENGTH];
char access_key_id[128];
char secret_access_key[186]; /* TODO/RESEARCH - check size, ex https://github.com/winscp/winscp/pull/15/files */
#endif
#endif
#endif

char crt_switch_timings[NAME_MAX_LENGTH];
char input_reserved_devices[MAX_USERS][NAME_MAX_LENGTH];
Expand Down
3 changes: 3 additions & 0 deletions griffin/griffin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,9 @@ CLOUD SYNC
#ifdef HAVE_SMBCLIENT
#include "../network/cloud_sync/smb.c"
#endif
#ifdef HAVE_S3
#include "../network/cloud_sync/s3.c"
#endif
#endif

/*============================================================
Expand Down
12 changes: 12 additions & 0 deletions intl/msg_hash_lbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3550,6 +3550,18 @@ MSG_HASH(
MENU_ENUM_LABEL_CLOUD_SYNC_PASSWORD,
"cloud_sync_password"
)
MSG_HASH(
MENU_ENUM_LABEL_CLOUD_SYNC_ACCESS_KEY_ID,
"cloud_sync_access_key_id"
)
MSG_HASH(
MENU_ENUM_LABEL_CLOUD_SYNC_SECRET_ACCESS_KEY,
"cloud_sync_secret_access_key"
)
MSG_HASH(
MENU_ENUM_LABEL_CLOUD_SYNC_S3_URL,
"cloud_sync_s3_url"
)
MSG_HASH(
MENU_ENUM_LABEL_SCAN_DIRECTORY,
"scan_directory"
Expand Down
24 changes: 24 additions & 0 deletions intl/msg_hash_us.h
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,30 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_CLOUD_SYNC_PASSWORD,
"Your password for your cloud storage account."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CLOUD_SYNC_ACCESS_KEY_ID,
"Access Key ID"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_CLOUD_SYNC_ACCESS_KEY_ID,
"Your access key ID for your cloud storage account."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CLOUD_SYNC_SECRET_ACCESS_KEY,
"Secret Access Key"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_CLOUD_SYNC_SECRET_ACCESS_KEY,
"Your secret access key for your cloud storage account."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CLOUD_SYNC_S3_URL,
"S3 URL"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_CLOUD_SYNC_S3_URL,
"Your S3 endpoint URL for cloud storage."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_LOGGING_SETTINGS,
"Logging"
Expand Down
44 changes: 44 additions & 0 deletions libretro-common/include/net/net_http.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,43 @@ RETRO_BEGIN_DECLS
struct http_t;
struct http_connection_t;

typedef enum net_http_phase
{
NET_HTTP_PHASE_CONNECT = 0,
NET_HTTP_PHASE_SEND,
NET_HTTP_PHASE_RECV_HEADER,
NET_HTTP_PHASE_RECV_BODY,
NET_HTTP_PHASE_REDIRECT,
NET_HTTP_PHASE_DONE,
NET_HTTP_PHASE_ERROR
} net_http_phase_t;

const char *net_http_phase_to_string(net_http_phase_t phase);

/* Caller-facing, point-in-time HTTP transport snapshot.
*
* Notes:
* - Some fields intentionally mirror live http_t state (e.g. status/fd/err)
* so callers can log a single self-contained payload without issuing
* additional net_http_* calls.
* - Snapshot data is safe to copy and retain after transfer completion,
* unlike the opaque internal state which may be freed. */
typedef struct net_http_debug_state
{
int fd;
int status;
int last_errno;
int64_t last_io_len;
size_t progress;
size_t total;
unsigned redirects;
bool ssl;
bool connected;
bool request_sent;
bool err;
net_http_phase_t phase;
} net_http_debug_state_t;

struct http_connection_t *net_http_connection_new(const char *url, const char *method, const char *data);

/**
Expand Down Expand Up @@ -96,6 +133,12 @@ int net_http_status(struct http_t *state);
**/
bool net_http_error(struct http_t *state);

/* Copies the current transport snapshot into @out.
*
* Returns false if inputs are invalid; true on success.
* The returned snapshot is independent from internal http_t lifetime. */
bool net_http_get_debug_state(struct http_t *state, net_http_debug_state_t *out);

/**
* net_http_headers:
*
Expand All @@ -106,6 +149,7 @@ bool net_http_error(struct http_t *state);
* If the status is not 20x and accept_error is false, it returns NULL.
**/
struct string_list *net_http_headers(struct http_t *state);
struct string_list *net_http_headers_ex(struct http_t *state, bool accept_error);

/**
* net_http_data:
Expand Down
Loading
Loading