@@ -200,7 +200,7 @@ FfiClient::sendRequest(const proto::FfiRequest &request) const {
200200 }
201201
202202 // Ensure we drop the handle exactly once on all paths
203- FfiHandle handle_guard (static_cast <uintptr_t >(handle));
203+ const FfiHandle handle_guard (static_cast <uintptr_t >(handle));
204204 if (!resp_ptr || resp_len == 0 ) {
205205 throw std::runtime_error (" FFI returned empty response bytes" );
206206 }
@@ -403,7 +403,7 @@ FfiClient::connectAsync(const std::string &url, const std::string &token,
403403 }
404404
405405 try {
406- proto::FfiResponse resp = sendRequest (req);
406+ const proto::FfiResponse resp = sendRequest (req);
407407 if (!resp.has_connect ()) {
408408 logAndThrow (" FfiResponse missing connect" );
409409 }
@@ -501,7 +501,7 @@ FfiClient::publishTrackAsync(std::uint64_t local_participant_handle,
501501 return ;
502502 }
503503
504- proto::OwnedTrackPublication pub = cb.publication ();
504+ const proto::OwnedTrackPublication & pub = cb.publication ();
505505 pr.set_value (std::move (pub));
506506 });
507507
@@ -515,7 +515,7 @@ FfiClient::publishTrackAsync(std::uint64_t local_participant_handle,
515515 msg->mutable_options ()->CopyFrom (optionProto);
516516
517517 try {
518- proto::FfiResponse resp = sendRequest (req);
518+ const proto::FfiResponse resp = sendRequest (req);
519519 if (!resp.has_publish_track ()) {
520520 logAndThrow (" FfiResponse missing publish_track" );
521521 }
@@ -560,7 +560,7 @@ FfiClient::unpublishTrackAsync(std::uint64_t local_participant_handle,
560560 msg->set_request_async_id (async_id);
561561
562562 try {
563- proto::FfiResponse resp = sendRequest (req);
563+ const proto::FfiResponse resp = sendRequest (req);
564564 if (!resp.has_unpublish_track ()) {
565565 logAndThrow (" FfiResponse missing unpublish_track" );
566566 }
@@ -611,7 +611,7 @@ std::future<void> FfiClient::publishDataAsync(
611611 }
612612
613613 try {
614- proto::FfiResponse resp = sendRequest (req);
614+ const proto::FfiResponse resp = sendRequest (req);
615615 if (!resp.has_publish_data ()) {
616616 logAndThrow (" FfiResponse missing publish_data" );
617617 }
@@ -665,7 +665,7 @@ FfiClient::publishDataTrackAsync(std::uint64_t local_participant_handle,
665665 msg->set_request_async_id (async_id);
666666
667667 try {
668- proto::FfiResponse resp = sendRequest (req);
668+ const proto::FfiResponse resp = sendRequest (req);
669669 if (!resp.has_publish_data_track ()) {
670670 cancelPendingByAsyncId (async_id);
671671 std::promise<Result<proto::OwnedLocalDataTrack, PublishDataTrackError>>
@@ -760,7 +760,7 @@ std::future<void> FfiClient::publishSipDtmfAsync(
760760 }
761761
762762 try {
763- proto::FfiResponse resp = sendRequest (req);
763+ const proto::FfiResponse resp = sendRequest (req);
764764 if (!resp.has_publish_sip_dtmf ()) {
765765 logAndThrow (" FfiResponse missing publish_sip_dtmf" );
766766 }
@@ -803,7 +803,7 @@ FfiClient::setLocalMetadataAsync(std::uint64_t local_participant_handle,
803803 msg->set_request_async_id (async_id);
804804
805805 try {
806- proto::FfiResponse resp = sendRequest (req);
806+ const proto::FfiResponse resp = sendRequest (req);
807807 if (!resp.has_set_local_metadata ()) {
808808 logAndThrow (" FfiResponse missing set_local_metadata" );
809809 }
@@ -848,7 +848,7 @@ FfiClient::captureAudioFrameAsync(std::uint64_t source_handle,
848848 msg->mutable_buffer ()->CopyFrom (buffer);
849849
850850 try {
851- proto::FfiResponse resp = sendRequest (req);
851+ const proto::FfiResponse resp = sendRequest (req);
852852 if (!resp.has_capture_audio_frame ()) {
853853 logAndThrow (" FfiResponse missing capture_audio_frame" );
854854 }
@@ -902,7 +902,7 @@ FfiClient::performRpcAsync(std::uint64_t local_participant_handle,
902902 }
903903
904904 try {
905- proto::FfiResponse resp = sendRequest (req);
905+ const proto::FfiResponse resp = sendRequest (req);
906906 if (!resp.has_perform_rpc ()) {
907907 logAndThrow (" FfiResponse missing perform_rpc" );
908908 }
@@ -951,7 +951,7 @@ std::future<void> FfiClient::sendStreamHeaderAsync(
951951 }
952952
953953 try {
954- proto::FfiResponse resp = sendRequest (req);
954+ const proto::FfiResponse resp = sendRequest (req);
955955 if (!resp.has_send_stream_header ()) {
956956 logAndThrow (" FfiResponse missing send_stream_header" );
957957 }
@@ -1000,7 +1000,7 @@ std::future<void> FfiClient::sendStreamChunkAsync(
10001000 }
10011001
10021002 try {
1003- proto::FfiResponse resp = sendRequest (req);
1003+ const proto::FfiResponse resp = sendRequest (req);
10041004 if (!resp.has_send_stream_chunk ()) {
10051005 logAndThrow (" FfiResponse missing send_stream_chunk" );
10061006 }
@@ -1045,7 +1045,7 @@ FfiClient::sendStreamTrailerAsync(std::uint64_t local_participant_handle,
10451045 msg->set_request_async_id (async_id);
10461046
10471047 try {
1048- proto::FfiResponse resp = sendRequest (req);
1048+ const proto::FfiResponse resp = sendRequest (req);
10491049 if (!resp.has_send_stream_trailer ()) {
10501050 logAndThrow (" FfiResponse missing send_stream_trailer" );
10511051 }
0 commit comments