Add access to streaminfo for tcp connections too#261
Add access to streaminfo for tcp connections too#261PiotrSikora merged 3 commits intoenvoyproxy:masterfrom
Conversation
c7dc2c6 to
7e436a9
Compare
| if (network_read_filter_callbacks_) { | ||
| return network_read_filter_callbacks_->connection().streamInfo().filterState(); | ||
| } | ||
| return network_write_filter_callbacks_->connection().streamInfo().filterState(); |
There was a problem hiding this comment.
I don't think this is correct, you have no guarantee that this isn't nullptr.
Also, does network_read_filter_callbacks_->connection() and network_write_filter_callbacks_->connection() point to the same connection or is one for downstream and one for upstream?
There was a problem hiding this comment.
Thanks for pointing..will fix that..
looks like they both point to the same connection.. we need different one for upstream and downstream right?
| if (!value_struct.ParseFromArray(serialized_value.data(), serialized_value.size())) { | ||
| return WasmResult::ParseFailure; | ||
| } | ||
| if (decoder_callbacks_ == nullptr && encoder_callbacks_ == nullptr) { |
There was a problem hiding this comment.
Everything below could be simplified to:
auto stream_info = getRequestStreamInfo();
if (!stream_info) {
return WasmResult:: NotFound;
}
stream_info->filterState().setData(key, std::make_unique<WasmState>(value_struct),
StreamInfo::FilterState::StateType::Mutable);
return WasmResult::Ok;
and then you don't even need getFilterState().
There was a problem hiding this comment.
I totally agree with that, but I kept separate functions because getStreamInfo was looking at access_log_stream_info_ and getFilterstate was not.. Is it okay to look at access_log_stream_info_ for filter state?
7e436a9 to
997ef31
Compare
Signed-off-by: gargnupur <gargnupur@google.com>
Signed-off-by: gargnupur <gargnupur@google.com>
Signed-off-by: gargnupur <gargnupur@google.com>
e7edb3a to
24085a1
Compare
|
@PiotrSikora : Can you please take a look at this? |
… (#11831) (envoyproxy#261) Currently Opencensus tracer uses grpcService proto to configure its tracing client stub. It uses GoogleGrpcUtil to construct a channel and create client stub with that. However, the channel created there does not take care of initial_metadata from grpcService configure. This change fills in OCprepare_client_context option in export to make it respect initial metadata. Risk level: Low Signed-off-by: Pengyuan Bian <bianpengyuan@google.com>
Description: Add access to streaminfo for tcp connections too
Risk Level: Low