Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .drone.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ local static_build(name,
]
),

mac_pipeline('Static macOS', build=[
mac_pipeline('Static macOS', arch='arm64', build=[
'export JOBS=6',
'./utils/macos.sh',
'cd build-macos && ../utils/ci/drone-static-upload.sh',
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if(CCACHE_PROGRAM)
endif()

project(libsession-util
VERSION 1.3.0
VERSION 1.3.1
DESCRIPTION "Session client utility library"
LANGUAGES ${LANGS})

Expand Down
4 changes: 2 additions & 2 deletions include/session/config/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ typedef struct config_string_list {

LIBSESSION_EXPORT config_string_list* config_merge(
config_object* conf,
const char** msg_hashes,
const unsigned char** configs,
const char* const* msg_hashes,
const unsigned char* const* configs,
const size_t* lengths,
size_t count) LIBSESSION_WARN_UNUSED;

Expand Down
2 changes: 1 addition & 1 deletion include/session/config/groups/keys.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ LIBSESSION_EXPORT void groups_keys_dump(
/// them on failure.
LIBSESSION_EXPORT bool groups_keys_key_supplement(
config_group_keys* conf,
const char** sids,
const char* const* sids,
size_t sids_len,
unsigned char** message,
size_t* message_len);
Expand Down
8 changes: 4 additions & 4 deletions include/session/multi_encrypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ extern "C" {
/// responsibility to `free()` this buffer (if non-NULL) when done with it!
LIBSESSION_EXPORT unsigned char* session_encrypt_for_multiple_simple(
size_t* out_len,
const unsigned char** messages,
const unsigned char* const* messages,
const size_t* message_lengths,
size_t n_messages,
const unsigned char** recipients,
const unsigned char* const* recipients,
size_t n_recipients,
const unsigned char* x25519_privkey,
const unsigned char* x25519_pubkey,
Expand All @@ -69,10 +69,10 @@ LIBSESSION_EXPORT unsigned char* session_encrypt_for_multiple_simple(
/// from the Ed25519 key on the fly.
LIBSESSION_EXPORT unsigned char* session_encrypt_for_multiple_simple_ed25519(
size_t* out_len,
const unsigned char** messages,
const unsigned char* const* messages,
const size_t* message_lengths,
size_t n_messages,
const unsigned char** recipients,
const unsigned char* const* recipients,
size_t n_recipients,
const unsigned char* ed25519_secret_key,
const char* domain,
Expand Down
8 changes: 4 additions & 4 deletions include/session/network.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ typedef struct network_server_destination {
const char* endpoint;
uint16_t port;
const char* x25519_pubkey;
const char** headers;
const char** header_values;
const char* const* headers;
const char* const* header_values;
size_t headers_size;
} network_server_destination;

Expand Down Expand Up @@ -197,8 +197,8 @@ typedef void (*network_onion_response_callback_t)(
bool success,
bool timeout,
int16_t status_code,
const char** headers,
const char** header_values,
const char* const* headers,
const char* const* header_values,
size_t headers_size,
const char* response,
size_t response_size,
Expand Down
4 changes: 2 additions & 2 deletions include/session/network.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ class Network {
std::unordered_map<std::string, std::pair<swarm_id_t, std::vector<service_node>>> swarm_cache;

// Snode refresh state
int snode_cache_refresh_failure_count;
int in_progress_snode_cache_refresh_count;
int snode_cache_refresh_failure_count = 0;
int in_progress_snode_cache_refresh_count = 0;
std::optional<std::string> current_snode_cache_refresh_request_id;
std::vector<std::function<void()>> after_snode_cache_refresh;
std::optional<std::vector<service_node>> unused_snode_refresh_nodes;
Expand Down
4 changes: 2 additions & 2 deletions src/config/base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -764,8 +764,8 @@ LIBSESSION_EXPORT int16_t config_storage_namespace(const config_object* conf) {

LIBSESSION_EXPORT config_string_list* config_merge(
config_object* conf,
const char** msg_hashes,
const unsigned char** configs,
const char* const* msg_hashes,
const unsigned char* const* configs,
const size_t* lengths,
size_t count) {
return wrap_exceptions(conf, [&] {
Expand Down
2 changes: 1 addition & 1 deletion src/config/groups/keys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1659,7 +1659,7 @@ LIBSESSION_C_API bool groups_keys_decrypt_message(

LIBSESSION_C_API bool groups_keys_key_supplement(
config_group_keys* conf,
const char** sids,
const char* const* sids,
size_t sids_len,
unsigned char** message,
size_t* message_len) {
Expand Down
8 changes: 4 additions & 4 deletions src/multi_encrypt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,10 @@ static unsigned char* to_c_buffer(std::span<const unsigned char> x, size_t* out_

LIBSESSION_C_API unsigned char* session_encrypt_for_multiple_simple(
size_t* out_len,
const unsigned char** messages,
const unsigned char* const* messages,
const size_t* message_lengths,
size_t n_messages,
const unsigned char** recipients,
const unsigned char* const* recipients,
size_t n_recipients,
const unsigned char* x25519_privkey,
const unsigned char* x25519_pubkey,
Expand Down Expand Up @@ -298,10 +298,10 @@ LIBSESSION_C_API unsigned char* session_encrypt_for_multiple_simple(

LIBSESSION_C_API unsigned char* session_encrypt_for_multiple_simple_ed25519(
size_t* out_len,
const unsigned char** messages,
const unsigned char* const* messages,
const size_t* message_lengths,
size_t n_messages,
const unsigned char** recipients,
const unsigned char* const* recipients,
size_t n_recipients,
const unsigned char* ed25519_secret_key,
const char* domain,
Expand Down
9 changes: 7 additions & 2 deletions src/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,10 @@ std::chrono::milliseconds Network::retry_delay(
std::shared_ptr<quic::Endpoint> Network::get_endpoint() {
return net.call_get([this]() mutable {
if (!endpoint)
endpoint = net.endpoint(quic::Address{"0.0.0.0", 0}, quic::opt::alpns{ALPN});
endpoint = net.endpoint(
quic::Address{"0.0.0.0", 0},
quic::opt::alpns{ALPN},
quic::opt::disable_mtu_discovery{});

return endpoint;
});
Expand Down Expand Up @@ -1207,6 +1210,8 @@ void Network::refresh_snode_cache(std::optional<std::string> existing_request_id
// `snode_refresh_results` so we can use it to track the results from the different requests)
if (!current_snode_cache_refresh_request_id) {
log::info(cat, "Refreshing snode cache ({}).", request_id);
snode_cache_refresh_failure_count = 0;
in_progress_snode_cache_refresh_count = 0;
current_snode_cache_refresh_request_id = request_id;
snode_refresh_results = std::make_shared<std::vector<std::vector<service_node>>>();
}
Expand Down Expand Up @@ -1286,7 +1291,7 @@ void Network::refresh_snode_cache(std::optional<std::string> existing_request_id
log::error(
cat,
"Failed to retrieve nodes from one target when refreshing cache due to "
"error: {} Will try another target after {}ms ({}).",
"error: {}, Will try another target after {}ms ({}).",
e.what(),
cache_refresh_retry_delay.count(),
request_id);
Expand Down
4 changes: 2 additions & 2 deletions tests/test_network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1281,8 +1281,8 @@ TEST_CASE("Network direct request C API", "[network][network_send_request]") {
[](bool success,
bool timeout,
int16_t status_code,
const char** headers,
const char** header_values,
const char* const* headers,
const char* const* header_values,
size_t headers_size,
const char* c_response,
size_t response_size,
Expand Down