MCPcopy Create free account
hub / github.com/apache/brpc / ReadProgressiveAttachmentBy

Method ReadProgressiveAttachmentBy

src/brpc/controller.cpp:1548–1570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1546}
1547
1548void Controller::ReadProgressiveAttachmentBy(ProgressiveReader* r) {
1549 if (r == NULL) {
1550 LOG(FATAL) << "Param[r] is NULL";
1551 return;
1552 }
1553 if (!is_response_read_progressively()) {
1554 return r->OnEndOfMessage(
1555 butil::Status(EINVAL, "Can't read progressive attachment from a "
1556 "controller without calling "
1557 "response_will_be_read_progressively() before"));
1558 }
1559 if (_rpa == NULL) {
1560 return r->OnEndOfMessage(
1561 butil::Status(EINVAL, "ReadableProgressiveAttachment is NULL"));
1562 }
1563 if (has_progressive_reader()) {
1564 return r->OnEndOfMessage(
1565 butil::Status(EPERM, "%s can't be called more than once",
1566 __FUNCTION__));
1567 }
1568 add_flag(FLAGS_PROGRESSIVE_READER);
1569 return _rpa->ReadProgressiveAttachmentBy(r);
1570}
1571
1572void Controller::set_mongo_session_data(MongoContext* data) {
1573 _mongo_session_data = data;

Callers 4

TEST_FFunction · 0.45
UploadMethod · 0.45
UploadFailedMethod · 0.45
ResetNonPodsMethod · 0.45

Calls 2

StatusEnum · 0.70
OnEndOfMessageMethod · 0.45

Tested by 3

TEST_FFunction · 0.36
UploadMethod · 0.36
UploadFailedMethod · 0.36