Skip to content

Commit 795b47a

Browse files
committed
Disabled MTU discovery & C API tweaks
• Updated some C types from `const char**` to `const char* const*` to fix up the Swift interface • Updated to the latest libQuic and disabled MTU discovery (caused issues with some networks)
1 parent 77c4845 commit 795b47a

File tree

10 files changed

+22
-22
lines changed

10 files changed

+22
-22
lines changed

include/session/config/base.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ typedef struct config_string_list {
9595

9696
LIBSESSION_EXPORT config_string_list* config_merge(
9797
config_object* conf,
98-
const char** msg_hashes,
99-
const unsigned char** configs,
98+
const char* const* msg_hashes,
99+
const unsigned char* const* configs,
100100
const size_t* lengths,
101101
size_t count) LIBSESSION_WARN_UNUSED;
102102

include/session/config/groups/keys.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ LIBSESSION_EXPORT void groups_keys_dump(
333333
/// them on failure.
334334
LIBSESSION_EXPORT bool groups_keys_key_supplement(
335335
config_group_keys* conf,
336-
const char** sids,
336+
const char* const* sids,
337337
size_t sids_len,
338338
unsigned char** message,
339339
size_t* message_len);

include/session/multi_encrypt.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ extern "C" {
5353
/// responsibility to `free()` this buffer (if non-NULL) when done with it!
5454
LIBSESSION_EXPORT unsigned char* session_encrypt_for_multiple_simple(
5555
size_t* out_len,
56-
const unsigned char** messages,
56+
const unsigned char* const* messages,
5757
const size_t* message_lengths,
5858
size_t n_messages,
59-
const unsigned char** recipients,
59+
const unsigned char* const* recipients,
6060
size_t n_recipients,
6161
const unsigned char* x25519_privkey,
6262
const unsigned char* x25519_pubkey,
@@ -69,10 +69,10 @@ LIBSESSION_EXPORT unsigned char* session_encrypt_for_multiple_simple(
6969
/// from the Ed25519 key on the fly.
7070
LIBSESSION_EXPORT unsigned char* session_encrypt_for_multiple_simple_ed25519(
7171
size_t* out_len,
72-
const unsigned char** messages,
72+
const unsigned char* const* messages,
7373
const size_t* message_lengths,
7474
size_t n_messages,
75-
const unsigned char** recipients,
75+
const unsigned char* const* recipients,
7676
size_t n_recipients,
7777
const unsigned char* ed25519_secret_key,
7878
const char* domain,

include/session/network.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ typedef struct network_server_destination {
3737
const char* endpoint;
3838
uint16_t port;
3939
const char* x25519_pubkey;
40-
const char** headers;
41-
const char** header_values;
40+
const char* const* headers;
41+
const char* const* header_values;
4242
size_t headers_size;
4343
} network_server_destination;
4444

@@ -197,8 +197,8 @@ typedef void (*network_onion_response_callback_t)(
197197
bool success,
198198
bool timeout,
199199
int16_t status_code,
200-
const char** headers,
201-
const char** header_values,
200+
const char* const* headers,
201+
const char* const* header_values,
202202
size_t headers_size,
203203
const char* response,
204204
size_t response_size,

src/config/base.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,8 +764,8 @@ LIBSESSION_EXPORT int16_t config_storage_namespace(const config_object* conf) {
764764

765765
LIBSESSION_EXPORT config_string_list* config_merge(
766766
config_object* conf,
767-
const char** msg_hashes,
768-
const unsigned char** configs,
767+
const char* const* msg_hashes,
768+
const unsigned char* const* configs,
769769
const size_t* lengths,
770770
size_t count) {
771771
return wrap_exceptions(conf, [&] {

src/config/groups/keys.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,7 @@ LIBSESSION_C_API bool groups_keys_decrypt_message(
16591659

16601660
LIBSESSION_C_API bool groups_keys_key_supplement(
16611661
config_group_keys* conf,
1662-
const char** sids,
1662+
const char* const* sids,
16631663
size_t sids_len,
16641664
unsigned char** message,
16651665
size_t* message_len) {

src/multi_encrypt.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,10 @@ static unsigned char* to_c_buffer(std::span<const unsigned char> x, size_t* out_
259259

260260
LIBSESSION_C_API unsigned char* session_encrypt_for_multiple_simple(
261261
size_t* out_len,
262-
const unsigned char** messages,
262+
const unsigned char* const* messages,
263263
const size_t* message_lengths,
264264
size_t n_messages,
265-
const unsigned char** recipients,
265+
const unsigned char* const* recipients,
266266
size_t n_recipients,
267267
const unsigned char* x25519_privkey,
268268
const unsigned char* x25519_pubkey,
@@ -298,10 +298,10 @@ LIBSESSION_C_API unsigned char* session_encrypt_for_multiple_simple(
298298

299299
LIBSESSION_C_API unsigned char* session_encrypt_for_multiple_simple_ed25519(
300300
size_t* out_len,
301-
const unsigned char** messages,
301+
const unsigned char* const* messages,
302302
const size_t* message_lengths,
303303
size_t n_messages,
304-
const unsigned char** recipients,
304+
const unsigned char* const* recipients,
305305
size_t n_recipients,
306306
const unsigned char* ed25519_secret_key,
307307
const char* domain,

src/network.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ std::chrono::milliseconds Network::retry_delay(
767767
std::shared_ptr<quic::Endpoint> Network::get_endpoint() {
768768
return net.call_get([this]() mutable {
769769
if (!endpoint)
770-
endpoint = net.endpoint(quic::Address{"0.0.0.0", 0}, quic::opt::alpns{ALPN});
770+
endpoint = net.endpoint(quic::Address{"0.0.0.0", 0}, quic::opt::alpns{ALPN}, quic::opt::disable_mtu_discovery{});
771771

772772
return endpoint;
773773
});

tests/test_network.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,8 +1281,8 @@ TEST_CASE("Network direct request C API", "[network][network_send_request]") {
12811281
[](bool success,
12821282
bool timeout,
12831283
int16_t status_code,
1284-
const char** headers,
1285-
const char** header_values,
1284+
const char* const* headers,
1285+
const char* const* header_values,
12861286
size_t headers_size,
12871287
const char* c_response,
12881288
size_t response_size,

0 commit comments

Comments
 (0)