grpc 1.59.0 → 1.59.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +7 -1
  3. data/src/core/ext/filters/http/server/http_server_filter.cc +21 -17
  4. data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +504 -361
  5. data/src/core/ext/transport/chttp2/transport/frame_ping.cc +11 -1
  6. data/src/core/ext/transport/chttp2/transport/frame_rst_stream.cc +9 -0
  7. data/src/core/ext/transport/chttp2/transport/internal.h +92 -28
  8. data/src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.cc +44 -0
  9. data/src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.h +67 -0
  10. data/src/core/ext/transport/chttp2/transport/parsing.cc +103 -14
  11. data/src/core/ext/transport/chttp2/transport/ping_callbacks.cc +108 -0
  12. data/src/core/ext/transport/chttp2/transport/ping_callbacks.h +115 -0
  13. data/src/core/ext/transport/chttp2/transport/ping_rate_policy.cc +26 -4
  14. data/src/core/ext/transport/chttp2/transport/ping_rate_policy.h +16 -1
  15. data/src/core/ext/transport/chttp2/transport/write_size_policy.cc +60 -0
  16. data/src/core/ext/transport/chttp2/transport/write_size_policy.h +66 -0
  17. data/src/core/ext/transport/chttp2/transport/writing.cc +149 -77
  18. data/src/core/lib/channel/promise_based_filter.cc +9 -4
  19. data/src/core/lib/channel/promise_based_filter.h +2 -1
  20. data/src/core/lib/experiments/experiments.cc +222 -0
  21. data/src/core/lib/experiments/experiments.h +135 -0
  22. data/src/core/lib/iomgr/combiner.cc +3 -0
  23. data/src/core/lib/transport/metadata_batch.h +11 -1
  24. data/src/core/lib/transport/transport.h +6 -0
  25. data/src/ruby/lib/grpc/version.rb +1 -1
  26. metadata +9 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d5697d69958e8e2da81809d8b177b5711134fc1b3273360b4e46016c39772463
4
- data.tar.gz: c89bc94a56c355a7e2c611740486a7552dfe5ceabff95a013ef6c9ef19351b51
3
+ metadata.gz: 759d825c6725ecef82f2e56b725a43704250217a4cbff252302a070bf11e3849
4
+ data.tar.gz: 1156877963781d0594e138c6b5d31695230946eb4738647cec37706691912e15
5
5
  SHA512:
6
- metadata.gz: b7db75ce8a7fdd9bd8a00c9561dec1fa1550888987cfe6d56c9d25a4cf59bbbfaf9294624645543226589a2d340c382cd6c1335b67e2f5a00146eff4348d7b9d
7
- data.tar.gz: 077fe5996f3b52ad73cb5d2fb9ec150b0a45290e1a7d8735eeb1792e6f1d97659a42f877e51e0380ced1080801e56236e7313ca4a565fb9d17cb411f5ca9241a
6
+ metadata.gz: 5f79426b08ab87c3c5d184f083f51ae3cad7433839409223d74ea30ee2f3c2a731a94cae642c616e256154a2f5f585c8904a2c4bb9233c679558ed942fe319fd
7
+ data.tar.gz: f00070bbbcd743d96acea7052edae32162a6450465fdeb319bc332a4bd38984fd2a4929e8c903197e748846b88bc6da0bd70e2c4377af722768de7e27a22b89c
data/Makefile CHANGED
@@ -411,7 +411,7 @@ Q = @
411
411
  endif
412
412
 
413
413
  CORE_VERSION = 36.0.0
414
- CPP_VERSION = 1.59.0
414
+ CPP_VERSION = 1.59.2
415
415
 
416
416
  CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES))
417
417
  CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS)
@@ -1057,11 +1057,14 @@ LIBGRPC_SRC = \
1057
1057
  src/core/ext/transport/chttp2/transport/http2_settings.cc \
1058
1058
  src/core/ext/transport/chttp2/transport/http_trace.cc \
1059
1059
  src/core/ext/transport/chttp2/transport/huffsyms.cc \
1060
+ src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.cc \
1060
1061
  src/core/ext/transport/chttp2/transport/parsing.cc \
1061
1062
  src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc \
1063
+ src/core/ext/transport/chttp2/transport/ping_callbacks.cc \
1062
1064
  src/core/ext/transport/chttp2/transport/ping_rate_policy.cc \
1063
1065
  src/core/ext/transport/chttp2/transport/stream_lists.cc \
1064
1066
  src/core/ext/transport/chttp2/transport/varint.cc \
1067
+ src/core/ext/transport/chttp2/transport/write_size_policy.cc \
1065
1068
  src/core/ext/transport/chttp2/transport/writing.cc \
1066
1069
  src/core/ext/transport/inproc/inproc_plugin.cc \
1067
1070
  src/core/ext/transport/inproc/inproc_transport.cc \
@@ -1945,11 +1948,14 @@ LIBGRPC_UNSECURE_SRC = \
1945
1948
  src/core/ext/transport/chttp2/transport/http2_settings.cc \
1946
1949
  src/core/ext/transport/chttp2/transport/http_trace.cc \
1947
1950
  src/core/ext/transport/chttp2/transport/huffsyms.cc \
1951
+ src/core/ext/transport/chttp2/transport/max_concurrent_streams_policy.cc \
1948
1952
  src/core/ext/transport/chttp2/transport/parsing.cc \
1949
1953
  src/core/ext/transport/chttp2/transport/ping_abuse_policy.cc \
1954
+ src/core/ext/transport/chttp2/transport/ping_callbacks.cc \
1950
1955
  src/core/ext/transport/chttp2/transport/ping_rate_policy.cc \
1951
1956
  src/core/ext/transport/chttp2/transport/stream_lists.cc \
1952
1957
  src/core/ext/transport/chttp2/transport/varint.cc \
1958
+ src/core/ext/transport/chttp2/transport/write_size_policy.cc \
1953
1959
  src/core/ext/transport/chttp2/transport/writing.cc \
1954
1960
  src/core/ext/transport/inproc/inproc_plugin.cc \
1955
1961
  src/core/ext/transport/inproc/inproc_transport.cc \
@@ -27,20 +27,23 @@
27
27
 
28
28
  #include "absl/base/attributes.h"
29
29
  #include "absl/meta/type_traits.h"
30
- #include "absl/status/status.h"
30
+ #include "absl/strings/string_view.h"
31
31
  #include "absl/types/optional.h"
32
32
 
33
33
  #include <grpc/impl/channel_arg_names.h>
34
+ #include <grpc/status.h>
34
35
  #include <grpc/support/log.h>
35
36
 
36
37
  #include "src/core/lib/channel/channel_args.h"
37
38
  #include "src/core/lib/channel/channel_stack.h"
38
39
  #include "src/core/lib/debug/trace.h"
39
40
  #include "src/core/lib/promise/activity.h"
41
+ #include "src/core/lib/promise/context.h"
40
42
  #include "src/core/lib/promise/map.h"
41
43
  #include "src/core/lib/promise/pipe.h"
42
44
  #include "src/core/lib/promise/poll.h"
43
45
  #include "src/core/lib/promise/promise.h"
46
+ #include "src/core/lib/resource_quota/arena.h"
44
47
  #include "src/core/lib/slice/percent_encoding.h"
45
48
  #include "src/core/lib/slice/slice.h"
46
49
  #include "src/core/lib/surface/call_trace.h"
@@ -59,6 +62,15 @@ void FilterOutgoingMetadata(ServerMetadata* md) {
59
62
  PercentEncodingType::Compatible);
60
63
  }
61
64
  }
65
+
66
+ ServerMetadataHandle MalformedRequest(absl::string_view explanation) {
67
+ auto* arena = GetContext<Arena>();
68
+ auto hdl = arena->MakePooled<ServerMetadata>(arena);
69
+ hdl->Set(GrpcStatusMetadata(), GRPC_STATUS_UNKNOWN);
70
+ hdl->Set(GrpcMessageMetadata(), Slice::FromStaticString(explanation));
71
+ hdl->Set(GrpcTarPit(), Empty());
72
+ return hdl;
73
+ }
62
74
  } // namespace
63
75
 
64
76
  ArenaPromise<ServerMetadataHandle> HttpServerFilter::MakeCallPromise(
@@ -77,42 +89,35 @@ ArenaPromise<ServerMetadataHandle> HttpServerFilter::MakeCallPromise(
77
89
  ABSL_FALLTHROUGH_INTENDED;
78
90
  case HttpMethodMetadata::kInvalid:
79
91
  case HttpMethodMetadata::kGet:
80
- return Immediate(
81
- ServerMetadataFromStatus(absl::UnknownError("Bad method header")));
92
+ return Immediate(MalformedRequest("Bad method header"));
82
93
  }
83
94
  } else {
84
- return Immediate(
85
- ServerMetadataFromStatus(absl::UnknownError("Missing :method header")));
95
+ return Immediate(MalformedRequest("Missing :method header"));
86
96
  }
87
97
 
88
98
  auto te = md->Take(TeMetadata());
89
99
  if (te == TeMetadata::kTrailers) {
90
100
  // Do nothing, ok.
91
101
  } else if (!te.has_value()) {
92
- return Immediate(
93
- ServerMetadataFromStatus(absl::UnknownError("Missing :te header")));
102
+ return Immediate(MalformedRequest("Missing :te header"));
94
103
  } else {
95
- return Immediate(
96
- ServerMetadataFromStatus(absl::UnknownError("Bad :te header")));
104
+ return Immediate(MalformedRequest("Bad :te header"));
97
105
  }
98
106
 
99
107
  auto scheme = md->Take(HttpSchemeMetadata());
100
108
  if (scheme.has_value()) {
101
109
  if (*scheme == HttpSchemeMetadata::kInvalid) {
102
- return Immediate(
103
- ServerMetadataFromStatus(absl::UnknownError("Bad :scheme header")));
110
+ return Immediate(MalformedRequest("Bad :scheme header"));
104
111
  }
105
112
  } else {
106
- return Immediate(
107
- ServerMetadataFromStatus(absl::UnknownError("Missing :scheme header")));
113
+ return Immediate(MalformedRequest("Missing :scheme header"));
108
114
  }
109
115
 
110
116
  md->Remove(ContentTypeMetadata());
111
117
 
112
118
  Slice* path_slice = md->get_pointer(HttpPathMetadata());
113
119
  if (path_slice == nullptr) {
114
- return Immediate(
115
- ServerMetadataFromStatus(absl::UnknownError("Missing :path header")));
120
+ return Immediate(MalformedRequest("Missing :path header"));
116
121
  }
117
122
 
118
123
  if (md->get_pointer(HttpAuthorityMetadata()) == nullptr) {
@@ -123,8 +128,7 @@ ArenaPromise<ServerMetadataHandle> HttpServerFilter::MakeCallPromise(
123
128
  }
124
129
 
125
130
  if (md->get_pointer(HttpAuthorityMetadata()) == nullptr) {
126
- return Immediate(ServerMetadataFromStatus(
127
- absl::UnknownError("Missing :authority header")));
131
+ return Immediate(MalformedRequest("Missing :authority header"));
128
132
  }
129
133
 
130
134
  if (!surface_user_agent_) {