Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/brpc/parallel_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,9 @@ void ParallelChannel::CallMethod(
ParallelChannelDone::SubDone* sd = d->sub_done(j++);
// Forward the attachment to each sub call
sd->cntl.request_attachment().append(cntl->request_attachment());
if (PROTOCOL_HTTP == cntl->request_protocol()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current ParallelChannel is not friendly to http protocol if user want to set different http request params for different sub call.

sd->cntl.http_request() = cntl->http_request();
}
_chans[i].chan->CallMethod(sd->ap.method, &sd->cntl,
sd->ap.request, sd->ap.response, sd);
}
Expand Down
4 changes: 3 additions & 1 deletion src/brpc/selective_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,9 @@ int Sender::IssueRPC(int64_t start_realtime_us) {
sub_cntl->set_request_code(_main_cntl->request_code());
// Forward request attachment to the subcall
sub_cntl->request_attachment().append(_main_cntl->request_attachment());
sub_cntl->http_request() = _main_cntl->http_request();
if (PROTOCOL_HTTP == _main_cntl->request_protocol()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this can also apply to PROTOCOL_H2

sub_cntl->http_request() = _main_cntl->http_request();
}

sel_out.channel()->CallMethod(_main_cntl->_method,
&r.sub_done->_cntl,
Expand Down
Loading