Skip to content

Commit 666fd49

Browse files
committed
Fix code review comments
1 parent 05dea59 commit 666fd49

8 files changed

Lines changed: 13 additions & 29 deletions

File tree

configuration.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1617,8 +1617,8 @@ static struct config_array_setting *populate_settings_array(
16171617
SETTING_ARRAY("cheevos_leaderboards_enable", settings->arrays.cheevos_leaderboards_enable, true, "", true); /* deprecated */
16181618
#endif
16191619

1620-
SETTING_ARRAY("netplay_mitm_server", settings->arrays.netplay_mitm_server, false, NULL, true);
16211620
#ifdef HAVE_NETWORKING
1621+
SETTING_ARRAY("netplay_mitm_server", settings->arrays.netplay_mitm_server, false, NULL, true);
16221622
#ifdef HAVE_CLOUDSYNC
16231623
SETTING_ARRAY("webdav_url", settings->arrays.webdav_url, false, NULL, true);
16241624
SETTING_ARRAY("webdav_username", settings->arrays.webdav_username, false, NULL, true);

libretro-common/net/net_http.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,11 +1012,6 @@ static bool net_http_connect(struct http_t *state)
10121012
struct conn_pool_entry *conn = state->conn;
10131013
struct dns_cache_entry *dns_entry = net_http_dns_cache_find(state->request.domain, state->request.port);
10141014
/* we just used/added this in _new_socket above, if it's not there it's a big bug */
1015-
if (!dns_entry || !dns_entry->addr || !conn)
1016-
{
1017-
net_http_log_transport_state(state, "connect_missing_dns_or_conn", -1);
1018-
return false;
1019-
}
10201015
addr = dns_entry->addr;
10211016

10221017
#ifndef HAVE_SSL
@@ -1025,6 +1020,11 @@ static bool net_http_connect(struct http_t *state)
10251020
#else
10261021
if (state->ssl)
10271022
{
1023+
if (!conn)
1024+
{
1025+
net_http_log_transport_state(state, "connect_missing_dns_or_conn", -1);
1026+
return false;
1027+
}
10281028
for (next_addr = addr; conn->fd >= 0; conn->fd = socket_next((void**)&next_addr))
10291029
{
10301030
if (!(conn->ssl_ctx = ssl_socket_init(conn->fd, state->request.domain)))

network/cloud_sync/google_drive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,7 @@ static void gdrive_do_patch(gdrive_cb_state_t *cb_st)
13561356
cb_st->path, (long long)len);
13571357
task_push_http_transfer_with_content(url, "PATCH",
13581358
buf, (size_t)len, "application/octet-stream",
1359-
true, headers, gdrive_upload_cb, cb_st);
1359+
true, false, headers, gdrive_upload_cb, cb_st);
13601360
free(buf);
13611361
free(headers);
13621362
}

network/cloud_sync/s3.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ static bool s3_http_put_async(const char *url, const char *headers,
929929
const void *data, size_t data_len, s3_cb_state_t *cb_state)
930930
{
931931
return task_push_http_transfer_with_content(url, "PUT",
932-
data, data_len, "application/octet-stream", true,
932+
data, data_len, "application/octet-stream", true, false,
933933
headers, s3_update_cb, cb_state) != NULL;
934934
}
935935

@@ -1399,7 +1399,7 @@ static void s3_multipart_complete(s3_multipart_state_t *mp_st)
13991399
goto fail;
14001400

14011401
if (!task_push_http_transfer_with_content(url_with_query, "POST",
1402-
xml_body, xml_len, "application/xml", true,
1402+
xml_body, xml_len, "application/xml", true, false,
14031403
auth_header, s3_multipart_complete_cb, mp_st))
14041404
goto fail;
14051405

@@ -1500,7 +1500,7 @@ static void s3_multipart_upload_next_part(s3_multipart_state_t *mp_st)
15001500
if (!url_with_query || !auth_header)
15011501
goto fail;
15021502

1503-
if (!task_push_http_transfer_with_content_ex(url_with_query, "PUT",
1503+
if (!task_push_http_transfer_with_content(url_with_query, "PUT",
15041504
mp_st->file_data + offset, content_len, "application/octet-stream", true, true,
15051505
auth_header, s3_multipart_upload_part_cb, mp_st))
15061506
goto fail;

pkg/apple/BaseConfig.xcconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ OTHER_CFLAGS = $(inherited) -DHAVE_RPNG
7474
OTHER_CFLAGS = $(inherited) -DHAVE_RTGA
7575
OTHER_CFLAGS = $(inherited) -DHAVE_RUNAHEAD
7676
OTHER_CFLAGS = $(inherited) -DHAVE_RWAV
77+
OTHER_CFLAGS = $(inherited) -DHAVE_S3
7778
OTHER_CFLAGS = $(inherited) -DHAVE_SCREENSHOTS
7879
OTHER_CFLAGS = $(inherited) -DHAVE_SHADERPIPELINE
7980
OTHER_CFLAGS = $(inherited) -DHAVE_SLANG

pkg/apple/RetroArch_Metal.xcodeproj/project.pbxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,7 +1911,6 @@
19111911
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
19121912
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
19131913
CLANG_ANALYZER_DEADCODE_DEADSTORES = NO;
1914-
COMMON_SDL_CFLAGS = "-DHAVE_S3";
19151914
CURRENT_PROJECT_VERSION = 1;
19161915
ENABLE_HARDENED_RUNTIME = YES;
19171916
};
@@ -1924,7 +1923,6 @@
19241923
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
19251924
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
19261925
CLANG_ANALYZER_DEADCODE_DEADSTORES = NO;
1927-
COMMON_SDL_CFLAGS = "-DHAVE_S3";
19281926
CURRENT_PROJECT_VERSION = 1;
19291927
ENABLE_HARDENED_RUNTIME = YES;
19301928
};

tasks/task_http.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -552,11 +552,10 @@ void* task_push_http_post_transfer_with_headers(const char *url,
552552
return task_push_http_transfer_generic(conn, url, mute, false, cb, user_data);
553553
}
554554

555-
void *task_push_http_transfer_with_content_ex(const char *url,
555+
void *task_push_http_transfer_with_content(const char *url,
556556
const char *method, const void *content, size_t content_len,
557557
const char *content_type, bool mute, bool headers_accept_err,
558-
const char *headers,
559-
retro_task_callback_t cb, void *user_data)
558+
const char *headers, retro_task_callback_t cb, void *user_data)
560559
{
561560
struct http_connection_t *conn;
562561

@@ -576,13 +575,3 @@ void *task_push_http_transfer_with_content_ex(const char *url,
576575
return task_push_http_transfer_generic(conn, url, mute,
577576
headers_accept_err, cb, user_data);
578577
}
579-
580-
void *task_push_http_transfer_with_content(const char *url,
581-
const char *method, const void *content, size_t content_len,
582-
const char *content_type, bool mute, const char *headers,
583-
retro_task_callback_t cb, void *user_data)
584-
{
585-
return task_push_http_transfer_with_content_ex(url, method, content,
586-
content_len, content_type, mute, false,
587-
headers, cb, user_data);
588-
}

tasks/tasks_internal.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@ void *task_push_http_post_transfer_with_headers(const char *url, const char *pos
8080
const char *type, const char *headers, retro_task_callback_t cb, void *user_data);
8181

8282
void *task_push_http_transfer_with_content(const char *url, const char *method,
83-
const void *content, size_t content_len, const char *content_type, bool mute,
84-
const char *headers, retro_task_callback_t cb, void *user_data);
85-
86-
void *task_push_http_transfer_with_content_ex(const char *url, const char *method,
8783
const void *content, size_t content_len, const char *content_type, bool mute,
8884
bool headers_accept_err, const char *headers,
8985
retro_task_callback_t cb, void *user_data);

0 commit comments

Comments
 (0)