From 9e97ebfe46991dd15b0a16f10593dbddca3c758a Mon Sep 17 00:00:00 2001 From: Dmitry Simonenko Date: Fri, 31 Mar 2017 17:17:17 +0300 Subject: [PATCH] odissey: update machinarium; switch to new api --- CMakeLists.txt | 7 +++++++ core/od_fe.c | 4 +--- core/od_io.c | 4 +--- lib/machinarium | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 60c2985d..6c50c7a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,13 @@ set(od_libraries ${od_libraries} ${MACHINARIUM_LIBRARIES}) set(od_libraries ${od_libraries} ${MACHINARIUM_LIBRARIES_LIBUV}) include_directories(${MACHINARIUM_INCLUDE_DIRS}) +# openssl +find_package(OpenSSL) +if (NOT OPENSSL_FOUND) +endif() +set(od_libraries ${od_libraries} ${OPENSSL_LIBRARIES}) +include_directories("${OPENSSL_INCLUDE_DIR}") + # soprano include(BuildSoprano) build_soprano() diff --git a/core/od_fe.c b/core/od_fe.c index d51f7fee..69b352f5 100644 --- a/core/od_fe.c +++ b/core/od_fe.c @@ -93,11 +93,9 @@ od_festartup_read(od_client_t *client) int rc = so_stream_ensure(stream, to_read); if (rc == -1) return -1; - rc = machine_read(client->io, to_read, 0); + rc = machine_read(client->io, (char*)stream->p, to_read, 0); if (rc < 0) return -1; - char *data_pointer = machine_read_buf(client->io); - memcpy(stream->p, data_pointer, to_read); so_stream_advance(stream, to_read); } return 0; diff --git a/core/od_io.c b/core/od_io.c index b0306a5b..77a95b82 100644 --- a/core/od_io.c +++ b/core/od_io.c @@ -39,11 +39,9 @@ int od_read(machine_io_t io, so_stream_t *stream, int time_ms) int rc = so_stream_ensure(stream, to_read); if (rc == -1) return -1; - rc = machine_read(io, to_read, time_ms); + rc = machine_read(io, (char*)stream->p, to_read, time_ms); if (rc < 0) return -1; - char *data_pointer = machine_read_buf(io); - memcpy(stream->p, data_pointer, to_read); so_stream_advance(stream, to_read); } return 0; diff --git a/lib/machinarium b/lib/machinarium index b0f195b9..3e091b6c 160000 --- a/lib/machinarium +++ b/lib/machinarium @@ -1 +1 @@ -Subproject commit b0f195b9b42d982abbb5a203e69b0ae5a94eb52d +Subproject commit 3e091b6c76ee765f459dff346d612de97d278897