Skip to content

Commit 201b37f

Browse files
authored
Merge pull request #39 from mpretty-cyro/fix/snode-cache-rebuild-infinite-loop
Fixed a infinite loop, updated libQuic, disabled MTU discovery and C API tweaks
2 parents e2eed34 + 25beeed commit 201b37f

File tree

13 files changed

+32
-27
lines changed

13 files changed

+32
-27
lines changed

.drone.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ local static_build(name,
397397
]
398398
),
399399

400-
mac_pipeline('Static macOS', build=[
400+
mac_pipeline('Static macOS', arch='arm64', build=[
401401
'export JOBS=6',
402402
'./utils/macos.sh',
403403
'cd build-macos && ../utils/ci/drone-static-upload.sh',

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if(CCACHE_PROGRAM)
1717
endif()
1818

1919
project(libsession-util
20-
VERSION 1.3.0
20+
VERSION 1.3.1
2121
DESCRIPTION "Session client utility library"
2222
LANGUAGES ${LANGS})
2323

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,

include/session/network.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ class Network {
217217
std::unordered_map<std::string, std::pair<swarm_id_t, std::vector<service_node>>> swarm_cache;
218218

219219
// Snode refresh state
220-
int snode_cache_refresh_failure_count;
221-
int in_progress_snode_cache_refresh_count;
220+
int snode_cache_refresh_failure_count = 0;
221+
int in_progress_snode_cache_refresh_count = 0;
222222
std::optional<std::string> current_snode_cache_refresh_request_id;
223223
std::vector<std::function<void()>> after_snode_cache_refresh;
224224
std::optional<std::vector<service_node>> unused_snode_refresh_nodes;

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) {

0 commit comments

Comments
 (0)