Skip to content

Commit

Permalink
Fix build errors in the C API (#6190)
Browse files Browse the repository at this point in the history
* Fix build errors due to missing default socket provider integration

* Fix build warning in realm2json
  • Loading branch information
danieltabacaru authored Jan 12, 2023
1 parent dbe83e7 commit 690e32d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/realm/exec/realm2json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ int main(int argc, char const* argv[])
options.allow_file_format_upgrade = true;
options.is_immutable = false;
}
catch (const realm::IncompatibleHistories& e) {
catch (const realm::IncompatibleHistories&) {
hist = realm::sync::make_client_replication();
options.allow_file_format_upgrade = false;
options.is_immutable = true;
Expand Down
13 changes: 12 additions & 1 deletion src/realm/object-store/c_api/socket_provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,17 @@ struct CAPIWebSocketObserver : sync::WebSocketObserver {
return m_observer.websocket_closed_handler(was_clean, status);
}

// DEPRECATED
void websocket_connect_error_handler(std::error_code) final {}
void websocket_ssl_handshake_error_handler(std::error_code) final {}
void websocket_read_or_write_error_handler(std::error_code) final {}
void websocket_handshake_error_handler(std::error_code, const std::string_view*) final {}
void websocket_protocol_error_handler(std::error_code) final {}
bool websocket_close_message_received(std::error_code, StringData) final
{
return false;
}

private:
sync::WebSocketObserver& m_observer;
};
Expand Down Expand Up @@ -253,7 +264,7 @@ RLM_API void realm_sync_socket_websocket_closed(realm_websocket_observer_t* real
RLM_API void realm_sync_client_config_set_sync_socket(realm_sync_client_config_t* config,
realm_sync_socket_t* sync_socket) RLM_API_NOEXCEPT
{
config->sync_socket = *sync_socket;
config->socket_provider = *sync_socket;
}

} // namespace realm::c_api

0 comments on commit 690e32d

Please sign in to comment.