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

Method CreateProgressiveAttachment

src/brpc/controller.cpp:1523–1546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1521}
1522
1523butil::intrusive_ptr<ProgressiveAttachment>
1524Controller::CreateProgressiveAttachment(StopStyle stop_style) {
1525 if (has_progressive_writer()) {
1526 LOG(ERROR) << "One controller can only have one ProgressiveAttachment";
1527 return NULL;
1528 }
1529 if (_request_protocol != PROTOCOL_HTTP) {
1530 LOG(ERROR) << "Only http supports ProgressiveAttachment now";
1531 return NULL;
1532 }
1533 if (_current_call.sending_sock == NULL) {
1534 LOG(ERROR) << "sending_sock is NULL";
1535 return NULL;
1536 }
1537 SocketUniquePtr httpsock;
1538 _current_call.sending_sock->ReAddress(&httpsock);
1539
1540 if (stop_style == FORCE_STOP) {
1541 httpsock->fail_me_at_server_stop();
1542 }
1543 _wpa.reset(new ProgressiveAttachment(
1544 httpsock, http_request().before_http_1_1()));
1545 return _wpa;
1546}
1547
1548void Controller::ReadProgressiveAttachmentBy(ProgressiveReader* r) {
1549 if (r == NULL) {

Callers 4

default_methodMethod · 0.80
streamMethod · 0.80
DownloadMethod · 0.80
DownloadFailedMethod · 0.80

Calls 3

ReAddressMethod · 0.80
before_http_1_1Method · 0.80
resetMethod · 0.45

Tested by 2

DownloadMethod · 0.64
DownloadFailedMethod · 0.64