From 605960dfa7c68e69a1541ffdf9e8ba7818dbad2d Mon Sep 17 00:00:00 2001 From: "patrick.qian" Date: Fri, 31 Mar 2023 22:44:41 +0200 Subject: [PATCH 1/4] stop using deprecated functions --- source/kraken/kraken_zmq.h | 16 ++++++++-------- source/utils | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source/kraken/kraken_zmq.h b/source/kraken/kraken_zmq.h index 7f65ce900b..e295d0f8ce 100644 --- a/source/kraken/kraken_zmq.h +++ b/source/kraken/kraken_zmq.h @@ -1,4 +1,4 @@ -/* Copyright © 2001-2022, Hove and/or its affiliates. All rights reserved. +/* Copyright �� 2001-2022, Hove and/or its affiliates. All rights reserved. This file is part of Navitia, the software to build cool stuff with public transport. @@ -47,22 +47,22 @@ www.navitia.io static void respond(zmq::socket_t& socket, const std::vector& client_id, const pbnavitia::Response& response) { - zmq::message_t reply(response.ByteSize()); + zmq::message_t reply(response.ByteSizeLong()); try { - response.SerializeToArray(reply.data(), response.ByteSize()); + response.SerializeToArray(reply.data(), response.ByteSizeLong()); } catch (const google::protobuf::FatalException& e) { auto logger = log4cplus::Logger::getInstance("worker"); LOG4CPLUS_ERROR(logger, "failure during serialization: " << e.what()); pbnavitia::Response error_response; error_response.mutable_error()->set_id(pbnavitia::Error::internal_error); error_response.mutable_error()->set_message(e.what()); - reply.rebuild(error_response.ByteSize()); - error_response.SerializeToArray(reply.data(), error_response.ByteSize()); + reply.rebuild(error_response.ByteSizeLong()); + error_response.SerializeToArray(reply.data(), error_response.ByteSizeLong()); } for (const auto& idx : client_id) { - z_send(socket, idx, ZMQ_SNDMORE); + z_send(socket, idx, zmq::send_flags::sndmore); } - socket.send(reply); + socket.send(reply, zmq::send_flags::none); } static pbnavitia::Response create_error_response(std::string error_message, pbnavitia::Error_error_id error_id) { @@ -106,7 +106,7 @@ inline void doWork(zmq::context_t& context, socket.getsockopt(ZMQ_RCVMORE, &more, &more_size); } while (more); } catch (const zmq::error_t&) { - // on gére le cas du sighup durant un recv + // on g��re le cas du sighup durant un recv LOG4CPLUS_WARN(logger, "Zmq error occured while receiving. I'll ignore this message."); pbnavitia::Response response = create_error_response("zmq error occured while receiving", pbnavitia::Error::internal_error); diff --git a/source/utils b/source/utils index ab96a35433..637f8f27a8 160000 --- a/source/utils +++ b/source/utils @@ -1 +1 @@ -Subproject commit ab96a354331982fd40657583fe6b74fdf67920bd +Subproject commit 637f8f27a8f9e1ebcb0bc37f08b3e8e53d847bc9 From d3f05b9629014e9a3e3cac69b2d2e3d6655c4908 Mon Sep 17 00:00:00 2001 From: "patrick.qian" Date: Fri, 31 Mar 2023 22:45:55 +0200 Subject: [PATCH 2/4] special character --- source/kraken/kraken_zmq.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/kraken/kraken_zmq.h b/source/kraken/kraken_zmq.h index e295d0f8ce..9ac57e2def 100644 --- a/source/kraken/kraken_zmq.h +++ b/source/kraken/kraken_zmq.h @@ -1,4 +1,4 @@ -/* Copyright �� 2001-2022, Hove and/or its affiliates. All rights reserved. +/* Copyright © 2001-2022, Hove and/or its affiliates. All rights reserved. This file is part of Navitia, the software to build cool stuff with public transport. From 7744b10c24162acd3079b996007ad1cfe35c75eb Mon Sep 17 00:00:00 2001 From: "patrick.qian" Date: Fri, 31 Mar 2023 22:46:49 +0200 Subject: [PATCH 3/4] special character --- source/kraken/kraken_zmq.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/kraken/kraken_zmq.h b/source/kraken/kraken_zmq.h index 9ac57e2def..676c1f7bf1 100644 --- a/source/kraken/kraken_zmq.h +++ b/source/kraken/kraken_zmq.h @@ -106,7 +106,7 @@ inline void doWork(zmq::context_t& context, socket.getsockopt(ZMQ_RCVMORE, &more, &more_size); } while (more); } catch (const zmq::error_t&) { - // on g��re le cas du sighup durant un recv + // on gére le cas du sighup durant un recv LOG4CPLUS_WARN(logger, "Zmq error occured while receiving. I'll ignore this message."); pbnavitia::Response response = create_error_response("zmq error occured while receiving", pbnavitia::Error::internal_error); From 2921710f7688a9cdd1c52078ddd056f5306a7a26 Mon Sep 17 00:00:00 2001 From: "patrick.qian" Date: Fri, 31 Mar 2023 22:48:01 +0200 Subject: [PATCH 4/4] update utils --- source/utils | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/utils b/source/utils index 637f8f27a8..7c7730b852 160000 --- a/source/utils +++ b/source/utils @@ -1 +1 @@ -Subproject commit 637f8f27a8f9e1ebcb0bc37f08b3e8e53d847bc9 +Subproject commit 7c7730b8528265d3969f4892fa5aa3e2b510b288