From 50ac392b86a4ac6097e5c8b3fb6a7c11d8637d6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Mill=C3=A1n?= Date: Mon, 30 Oct 2023 15:49:07 +0100 Subject: [PATCH] FBS: Remove unneeded message type member It's not needed since the body contained in the message is aleady typed. --- node/src/Channel.ts | 10 +- rust/src/messages.rs | 137 ++++++++++----------- worker/fbs/message.fbs | 8 -- worker/include/Channel/ChannelNotifier.hpp | 2 - worker/include/Channel/ChannelRequest.hpp | 2 +- worker/src/Channel/ChannelRequest.cpp | 2 +- worker/src/Channel/ChannelSocket.cpp | 10 +- 7 files changed, 79 insertions(+), 92 deletions(-) diff --git a/node/src/Channel.ts b/node/src/Channel.ts index 0a69f99916f..568d0b31b7e 100644 --- a/node/src/Channel.ts +++ b/node/src/Channel.ts @@ -128,9 +128,9 @@ export class Channel extends EnhancedEventEmitter try { - switch (message.type()) + switch (message.dataType()) { - case MessageType.RESPONSE: + case MessageBody.Response: { const response = new Response(); @@ -141,7 +141,7 @@ export class Channel extends EnhancedEventEmitter break; } - case MessageType.NOTIFICATION: + case MessageBody.Notification: { const notification = new Notification(); @@ -152,7 +152,7 @@ export class Channel extends EnhancedEventEmitter break; } - case MessageType.LOG: + case MessageBody.Log: { const log = new Log(); @@ -283,7 +283,6 @@ export class Channel extends EnhancedEventEmitter const messageOffset = Message.createMessage( this.#bufferBuilder, - MessageType.NOTIFICATION, MessageBody.Notification, notificationOffset ); @@ -348,7 +347,6 @@ export class Channel extends EnhancedEventEmitter const messageOffset = Message.createMessage( this.#bufferBuilder, - MessageType.REQUEST, MessageBody.Request, requestOffset ); diff --git a/rust/src/messages.rs b/rust/src/messages.rs index 204ac53b536..1d38d9d9f8a 100644 --- a/rust/src/messages.rs +++ b/rust/src/messages.rs @@ -95,7 +95,7 @@ impl Request for WorkerCloseRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -126,7 +126,7 @@ impl Request for WorkerDumpRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -203,7 +203,7 @@ impl Request for WorkerUpdateSettingsRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -243,7 +243,7 @@ impl Request for WorkerCreateWebRtcServerRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -282,7 +282,7 @@ impl Request for WebRtcServerCloseRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -313,7 +313,7 @@ impl Request for WebRtcServerDumpRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -395,7 +395,7 @@ impl Request for WorkerCreateRouterRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -430,7 +430,7 @@ impl Request for RouterCloseRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -461,7 +461,7 @@ impl Request for RouterDumpRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -606,7 +606,7 @@ impl Request for RouterCreateDirectTransportRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -772,7 +772,7 @@ impl Request for RouterCreateWebRtcTransportRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -849,7 +849,7 @@ impl Request for RouterCreateWebRtcTransportWithServerRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -981,7 +981,7 @@ impl Request for RouterCreatePlainTransportRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -1107,7 +1107,7 @@ impl Request for RouterCreatePipeTransportRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -1208,7 +1208,7 @@ impl Request for RouterCreateAudioLevelObserverRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -1273,7 +1273,7 @@ impl Request for RouterCreateActiveSpeakerObserverRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -1304,7 +1304,7 @@ impl Request for TransportDumpRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -1339,7 +1339,7 @@ impl Request for TransportGetStatsRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -1380,7 +1380,7 @@ impl Request for TransportCloseRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -1421,7 +1421,7 @@ impl Request for WebRtcTransportConnectRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -1475,7 +1475,7 @@ impl Request for PipeTransportConnectRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -1534,7 +1534,7 @@ impl Request for TransportConnectPlainRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -1584,7 +1584,7 @@ impl Request for TransportSetMaxIncomingBitrateRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -1620,7 +1620,7 @@ impl Request for TransportSetMaxOutgoingBitrateRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -1656,7 +1656,7 @@ impl Request for TransportSetMinOutgoingBitrateRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -1686,7 +1686,7 @@ impl Request for TransportRestartIceRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -1748,7 +1748,7 @@ impl Request for TransportProduceRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -1820,7 +1820,7 @@ impl Request for TransportConsumeRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -1902,7 +1902,7 @@ impl Request for TransportProduceDataRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -1993,7 +1993,7 @@ impl Request for TransportConsumeDataRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2054,7 +2054,7 @@ impl Request for TransportEnableTraceEventRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2094,7 +2094,7 @@ impl Notification for TransportSendRtcpNotification { Some(notification_body), ); let message_body = message::Body::create_notification(&mut builder, notification); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2125,7 +2125,7 @@ impl Request for ProducerCloseRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2156,7 +2156,7 @@ impl Request for ProducerDumpRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2191,7 +2191,7 @@ impl Request for ProducerGetStatsRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2227,7 +2227,7 @@ impl Request for ProducerPauseRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2258,7 +2258,7 @@ impl Request for ProducerResumeRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2300,7 +2300,7 @@ impl Request for ProducerEnableTraceEventRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2340,7 +2340,7 @@ impl Notification for ProducerSendNotification { Some(notification_body), ); let message_body = message::Body::create_notification(&mut builder, notification); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2371,7 +2371,7 @@ impl Request for ConsumerCloseRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2402,7 +2402,7 @@ impl Request for ConsumerDumpRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2437,7 +2437,7 @@ impl Request for ConsumerGetStatsRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2473,7 +2473,7 @@ impl Request for ConsumerPauseRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2504,7 +2504,7 @@ impl Request for ConsumerResumeRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2544,7 +2544,7 @@ impl Request for ConsumerSetPreferredLayersRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2594,7 +2594,7 @@ impl Request for ConsumerSetPriorityRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2632,7 +2632,7 @@ impl Request for ConsumerRequestKeyFrameRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2674,7 +2674,7 @@ impl Request for ConsumerEnableTraceEventRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2717,7 +2717,7 @@ impl Request for DataProducerCloseRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2748,7 +2748,7 @@ impl Request for DataProducerDumpRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2784,7 +2784,7 @@ impl Request for DataProducerGetStatsRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2820,7 +2820,7 @@ impl Request for DataProducerPauseRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2851,7 +2851,7 @@ impl Request for DataProducerResumeRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2895,8 +2895,7 @@ impl Notification for DataProducerSendNotification { Some(notification_body), ); let message_body = message::Body::create_notification(&mut builder, notification); - let message = - message::Message::create(&mut builder, message::Type::Notification, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2929,7 +2928,7 @@ impl Request for DataConsumerCloseRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2960,7 +2959,7 @@ impl Request for DataConsumerDumpRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -2996,7 +2995,7 @@ impl Request for DataConsumerGetStatsRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -3032,7 +3031,7 @@ impl Request for DataConsumerPauseRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -3063,7 +3062,7 @@ impl Request for DataConsumerResumeRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -3099,7 +3098,7 @@ impl Request for DataConsumerGetBufferedAmountRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -3150,7 +3149,7 @@ impl Request for DataConsumerSetBufferedAmountLowThresholdRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -3188,7 +3187,7 @@ impl Request for DataConsumerSendRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -3236,7 +3235,7 @@ impl Request for DataConsumerSetSubchannelsRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -3281,7 +3280,7 @@ impl Request for RtpObserverCloseRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -3311,7 +3310,7 @@ impl Request for RtpObserverPauseRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -3341,7 +3340,7 @@ impl Request for RtpObserverResumeRequest { None::, ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -3380,7 +3379,7 @@ impl Request for RtpObserverAddProducerRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } @@ -3419,7 +3418,7 @@ impl Request for RtpObserverRemoveProducerRequest { Some(request_body), ); let message_body = message::Body::create_request(&mut builder, request); - let message = message::Message::create(&mut builder, message::Type::Request, message_body); + let message = message::Message::create(&mut builder, message_body); builder.finish(message, None).to_vec() } diff --git a/worker/fbs/message.fbs b/worker/fbs/message.fbs index 0e01a809d62..233ff28b087 100644 --- a/worker/fbs/message.fbs +++ b/worker/fbs/message.fbs @@ -5,13 +5,6 @@ include "response.fbs"; namespace FBS.Message; -enum Type: uint8 { - REQUEST = 0, - RESPONSE, - NOTIFICATION, - LOG, -} - union Body { Request: FBS.Request.Request, Response: FBS.Response.Response, @@ -20,7 +13,6 @@ union Body { } table Message { - type: Type; data: Body (required); } diff --git a/worker/include/Channel/ChannelNotifier.hpp b/worker/include/Channel/ChannelNotifier.hpp index 4c16204feb1..75b5bb172d9 100644 --- a/worker/include/Channel/ChannelNotifier.hpp +++ b/worker/include/Channel/ChannelNotifier.hpp @@ -31,7 +31,6 @@ namespace Channel auto message = FBS::Message::CreateMessage( builder, - FBS::Message::Type::NOTIFICATION, FBS::Message::Body::Notification, notification.Union()); @@ -48,7 +47,6 @@ namespace Channel auto message = FBS::Message::CreateMessage( builder, - FBS::Message::Type::NOTIFICATION, FBS::Message::Body::Notification, notification.Union()); diff --git a/worker/include/Channel/ChannelRequest.hpp b/worker/include/Channel/ChannelRequest.hpp index 96f960f7d41..43def7d4eee 100644 --- a/worker/include/Channel/ChannelRequest.hpp +++ b/worker/include/Channel/ChannelRequest.hpp @@ -43,7 +43,7 @@ namespace Channel auto response = FBS::Response::CreateResponse(builder, this->id, true, type, body.Union()); auto message = FBS::Message::CreateMessage( - builder, FBS::Message::Type::RESPONSE, FBS::Message::Body::Response, response.Union()); + builder, FBS::Message::Body::Response, response.Union()); builder.FinishSizePrefixed(message); this->Send(builder.GetBufferPointer(), builder.GetSize()); diff --git a/worker/src/Channel/ChannelRequest.cpp b/worker/src/Channel/ChannelRequest.cpp index f70619c6428..8627c76ef51 100644 --- a/worker/src/Channel/ChannelRequest.cpp +++ b/worker/src/Channel/ChannelRequest.cpp @@ -166,7 +166,7 @@ namespace Channel { auto& builder = this->bufferBuilder; auto message = FBS::Message::CreateMessage( - builder, FBS::Message::Type::RESPONSE, FBS::Message::Body::Response, response.Union()); + builder, FBS::Message::Body::Response, response.Union()); builder.FinishSizePrefixed(message); this->Send(builder.GetBufferPointer(), builder.GetSize()); diff --git a/worker/src/Channel/ChannelSocket.cpp b/worker/src/Channel/ChannelSocket.cpp index a38670b34a6..7c062760467 100644 --- a/worker/src/Channel/ChannelSocket.cpp +++ b/worker/src/Channel/ChannelSocket.cpp @@ -151,7 +151,7 @@ namespace Channel auto log = FBS::Log::CreateLogDirect(this->bufferBuilder, msg); auto message = FBS::Message::CreateMessage( - this->bufferBuilder, FBS::Message::Type::LOG, FBS::Message::Body::Log, log.Union()); + this->bufferBuilder, FBS::Message::Body::Log, log.Union()); this->bufferBuilder.FinishSizePrefixed(message); this->Send(this->bufferBuilder.GetBufferPointer(), this->bufferBuilder.GetSize()); @@ -185,7 +185,7 @@ namespace Channel MS_DUMP("%s", s.c_str()); #endif - if (message->type() == FBS::Message::Type::REQUEST) + if (message->data_type() == FBS::Message::Body::Request) { ChannelRequest* request; @@ -207,7 +207,7 @@ namespace Channel delete request; } - else if (message->type() == FBS::Message::Type::NOTIFICATION) + else if (message->data_type() == FBS::Message::Body::Notification) { ChannelNotification* notification; @@ -265,7 +265,7 @@ namespace Channel MS_DUMP("%s", s.c_str()); #endif - if (message->type() == FBS::Message::Type::REQUEST) + if (message->data_type() == FBS::Message::Body::Request) { ChannelRequest* request; @@ -287,7 +287,7 @@ namespace Channel delete request; } - else if (message->type() == FBS::Message::Type::NOTIFICATION) + else if (message->data_type() == FBS::Message::Body::Notification) { ChannelNotification* notification;