Skip to content

Commit ac71e30

Browse files
Aman Sharmameta-codesync[bot]
authored andcommitted
Update MOQTPublishDone structure
Summary: I'm updating the `MOQTPublishDone` structure to be in line with the specification. Reviewed By: afrind Differential Revision: D88779365 fbshipit-source-id: 1f12cd01f4b501af0023a2153f158c3fb63dcc5c
1 parent 3100d3b commit ac71e30

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

moxygen/MoQSession.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3619,7 +3619,7 @@ void MoQSession::onSubscribeDone(SubscribeDone subscribeDone) {
36193619
<< " reason=" << subscribeDone.reasonPhrase;
36203620

36213621
if (logger_) {
3622-
logger_->logSubscribeDone(subscribeDone, ControlMessageType::PARSED);
3622+
logger_->logPublishDone(subscribeDone, ControlMessageType::PARSED);
36233623
}
36243624
MOQ_SUBSCRIBER_STATS(
36253625
subscriberStatsCallback_, onSubscribeDone, subscribeDone.statusCode);
@@ -4466,7 +4466,7 @@ void MoQSession::sendSubscribeDone(const SubscribeDone& subDone) {
44664466
}
44674467

44684468
if (logger_) {
4469-
logger_->logSubscribeDone(subDone);
4469+
logger_->logPublishDone(subDone);
44704470
}
44714471
controlWriteEvent_.signal();
44724472
retireRequestID(/*signalWriteLoop=*/false);

moxygen/mlog/MLogTypes.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,17 +368,17 @@ folly::dynamic MOQTFetchError::toDynamic() const {
368368
return obj;
369369
}
370370

371-
folly::dynamic MOQTSubscribeDone::toDynamic() const {
371+
folly::dynamic MOQTPublishDone::toDynamic() const {
372372
folly::dynamic obj = folly::dynamic::object;
373373
obj["type"] = type;
374-
obj["subscribeId"] = std::to_string(subscribeId);
375-
obj["statusCode"] = std::to_string(statusCode);
376-
obj["streamCount"] = std::to_string(streamCount);
374+
obj["request_id"] = requestId;
375+
obj["status_code"] = statusCode;
376+
obj["stream_count"] = streamCount;
377377
if (reason.hasValue()) {
378378
obj["reason"] = reason.value();
379379
}
380380
if (reasonBytes.hasValue()) {
381-
obj["reasonBytes"] = reasonBytes.value();
381+
obj["reason_bytes"] = reasonBytes.value();
382382
}
383383
return obj;
384384
}

moxygen/mlog/MLogTypes.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,13 +347,13 @@ class MOQTFetchError : public MOQTBaseControlMessage {
347347
folly::Optional<std::string> reasonBytes;
348348
};
349349

350-
class MOQTSubscribeDone : public MOQTBaseControlMessage {
350+
class MOQTPublishDone : public MOQTBaseControlMessage {
351351
public:
352-
MOQTSubscribeDone() {
353-
type = "subscribe_done";
352+
MOQTPublishDone() {
353+
type = "publish_done";
354354
}
355355
folly::dynamic toDynamic() const override;
356-
uint64_t subscribeId{0};
356+
uint64_t requestId{0};
357357
uint64_t statusCode{};
358358
uint64_t streamCount{};
359359
folly::Optional<std::string> reason;

moxygen/mlog/MLogger.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,11 +514,11 @@ void MLogger::logFetchError(
514514
controlType, kFirstBidiStreamId, folly::none, std::move(baseMsg));
515515
}
516516

517-
void MLogger::logSubscribeDone(
517+
void MLogger::logPublishDone(
518518
const SubscribeDone& req,
519519
ControlMessageType controlType) {
520-
auto baseMsg = std::make_unique<MOQTSubscribeDone>();
521-
baseMsg->subscribeId = req.requestID.value;
520+
auto baseMsg = std::make_unique<MOQTPublishDone>();
521+
baseMsg->requestId = req.requestID.value;
522522
baseMsg->statusCode = static_cast<uint64_t>(req.statusCode);
523523
baseMsg->streamCount = req.streamCount;
524524

moxygen/mlog/MLogger.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class MLogger {
111111
void logFetchError(
112112
const FetchError& req,
113113
ControlMessageType controlType = ControlMessageType::CREATED);
114-
void logSubscribeDone(
114+
void logPublishDone(
115115
const SubscribeDone& req,
116116
ControlMessageType controlType = ControlMessageType::CREATED);
117117
void logMaxRequestId(

0 commit comments

Comments
 (0)