grpc 1.45.0 → 1.46.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +36 -29
- data/include/grpc/impl/codegen/grpc_types.h +7 -13
- data/src/core/ext/filters/channel_idle/channel_idle_filter.cc +309 -0
- data/src/core/ext/filters/channel_idle/channel_idle_filter.h +122 -0
- data/src/core/ext/filters/{client_idle → channel_idle}/idle_filter_state.cc +1 -1
- data/src/core/ext/filters/{client_idle → channel_idle}/idle_filter_state.h +3 -3
- data/src/core/ext/filters/client_channel/client_channel.cc +163 -96
- data/src/core/ext/filters/client_channel/client_channel.h +2 -0
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +124 -581
- data/src/core/ext/filters/client_channel/health/health_check_client.h +24 -160
- data/src/core/ext/filters/client_channel/http_proxy.cc +88 -110
- data/src/core/ext/filters/client_channel/http_proxy.h +17 -0
- data/src/core/ext/filters/client_channel/lb_policy/priority/priority.cc +182 -142
- data/src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc +2 -6
- data/src/core/ext/filters/client_channel/lb_policy/rls/rls.cc +1 -10
- data/src/core/ext/filters/client_channel/lb_policy/weighted_target/weighted_target.cc +87 -58
- data/src/core/ext/filters/client_channel/lb_policy/xds/cds.cc +51 -48
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_manager.cc +14 -7
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_cluster_resolver.cc +229 -284
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +92 -257
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +51 -221
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.cc +201 -0
- data/src/core/ext/filters/client_channel/resolver/polling_resolver.h +106 -0
- data/src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc +102 -55
- data/src/core/ext/filters/client_channel/retry_filter.cc +18 -3
- data/src/core/ext/filters/client_channel/subchannel.cc +5 -5
- data/src/core/ext/filters/client_channel/subchannel_stream_client.cc +544 -0
- data/src/core/ext/filters/client_channel/subchannel_stream_client.h +214 -0
- data/src/core/ext/filters/fault_injection/fault_injection_filter.cc +127 -367
- data/src/core/ext/filters/fault_injection/fault_injection_filter.h +24 -1
- data/src/core/ext/filters/http/client/http_client_filter.cc +78 -458
- data/src/core/ext/filters/http/client/http_client_filter.h +21 -4
- data/src/core/ext/filters/http/client_authority_filter.cc +17 -22
- data/src/core/ext/filters/http/client_authority_filter.h +6 -5
- data/src/core/ext/filters/http/http_filters_plugin.cc +9 -6
- data/src/core/ext/filters/http/server/http_server_filter.cc +2 -116
- data/src/core/ext/filters/server_config_selector/server_config_selector.cc +2 -8
- data/src/core/ext/filters/server_config_selector/server_config_selector.h +2 -2
- data/src/core/ext/filters/server_config_selector/server_config_selector_filter.cc +73 -201
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +2 -1
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +5 -4
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +139 -28
- data/src/core/ext/transport/chttp2/transport/frame_settings.cc +2 -0
- data/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +2 -6
- data/src/core/ext/transport/chttp2/transport/internal.h +4 -2
- data/src/core/ext/transport/chttp2/transport/parsing.cc +8 -0
- data/src/core/ext/transport/chttp2/transport/writing.cc +24 -13
- data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c +27 -24
- data/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h +143 -63
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +37 -35
- data/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +177 -77
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +115 -111
- data/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +547 -207
- data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h +26 -13
- data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h +23 -9
- data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c +7 -7
- data/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h +18 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h +13 -4
- data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h +9 -0
- data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.c +49 -46
- data/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h +217 -78
- data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h +10 -2
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.c +12 -12
- data/src/core/ext/upb-generated/envoy/annotations/deprecation.upb.h +40 -8
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +20 -2
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +55 -55
- data/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +289 -110
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +133 -125
- data/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +656 -267
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +24 -18
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +96 -23
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +185 -173
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +860 -309
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +10 -2
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +44 -24
- data/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +165 -40
- data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c +72 -63
- data/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h +433 -174
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +33 -31
- data/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +154 -52
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +5 -4
- data/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +14 -4
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +89 -89
- data/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +460 -166
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +76 -33
- data/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +379 -69
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +14 -6
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +5 -25
- data/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +10 -91
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h +26 -13
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +70 -68
- data/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +369 -131
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +94 -65
- data/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +447 -161
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +27 -11
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +104 -85
- data/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +378 -113
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +3 -0
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +6 -6
- data/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +30 -13
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.c +7 -7
- data/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +43 -16
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +8 -8
- data/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +58 -24
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +14 -4
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +18 -18
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +100 -43
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +31 -30
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +171 -71
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +32 -32
- data/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +196 -95
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +7 -2
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +53 -46
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +284 -129
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +56 -50
- data/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +337 -146
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +13 -11
- data/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +49 -14
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +14 -4
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h +20 -4
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +33 -32
- data/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +205 -86
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +34 -34
- data/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +175 -74
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +56 -52
- data/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +370 -146
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +27 -23
- data/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +173 -74
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +362 -341
- data/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +2056 -845
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +11 -11
- data/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +49 -16
- data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c +56 -50
- data/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h +293 -111
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h +6 -0
- data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h +10 -2
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +26 -10
- data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h +27 -12
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c +17 -16
- data/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h +83 -36
- data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h +7 -2
- data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c +8 -8
- data/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h +46 -17
- data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c +9 -9
- data/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h +38 -12
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c +7 -7
- data/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h +30 -10
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +10 -6
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +15 -15
- data/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +71 -28
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +25 -25
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +149 -65
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c +8 -7
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +30 -12
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +9 -9
- data/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +42 -15
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +173 -144
- data/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +898 -323
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +51 -45
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +261 -116
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +13 -13
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +70 -25
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +80 -55
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +410 -124
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +23 -9
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +1 -1
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +44 -44
- data/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +261 -122
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +8 -8
- data/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +47 -21
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +32 -32
- data/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +175 -66
- data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h +17 -6
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +8 -8
- data/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +38 -17
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c +8 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h +12 -0
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +7 -7
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +43 -18
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +20 -9
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +3 -3
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +24 -9
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +14 -6
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +8 -8
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +40 -16
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +9 -9
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +70 -25
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +37 -18
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +12 -12
- data/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +81 -30
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +16 -16
- data/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +76 -30
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +20 -20
- data/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +90 -30
- data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c +7 -7
- data/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h +28 -10
- data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c +2 -2
- data/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h +3 -0
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +13 -4
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +9 -9
- data/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +18 -0
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +4 -4
- data/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +9 -0
- data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.c +5 -5
- data/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h +17 -4
- data/src/core/ext/upb-generated/google/api/annotations.upb.c +3 -3
- data/src/core/ext/upb-generated/google/api/annotations.upb.h +17 -2
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +70 -66
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +410 -162
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +80 -74
- data/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +440 -158
- data/src/core/ext/upb-generated/google/api/http.upb.c +17 -17
- data/src/core/ext/upb-generated/google/api/http.upb.h +116 -43
- data/src/core/ext/upb-generated/google/api/httpbody.upb.c +4 -4
- data/src/core/ext/upb-generated/google/api/httpbody.upb.h +19 -7
- data/src/core/ext/upb-generated/google/protobuf/any.upb.c +3 -3
- data/src/core/ext/upb-generated/google/protobuf/any.upb.h +6 -0
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +163 -162
- data/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +1157 -435
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.c +3 -3
- data/src/core/ext/upb-generated/google/protobuf/duration.upb.h +10 -4
- data/src/core/ext/upb-generated/google/protobuf/empty.upb.c +1 -1
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.c +15 -15
- data/src/core/ext/upb-generated/google/protobuf/struct.upb.h +108 -40
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +3 -3
- data/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +10 -4
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +18 -18
- data/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +27 -0
- data/src/core/ext/upb-generated/google/rpc/status.upb.c +4 -4
- data/src/core/ext/upb-generated/google/rpc/status.upb.h +19 -7
- data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c +15 -15
- data/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h +65 -22
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.c +12 -12
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +49 -12
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +69 -65
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +364 -149
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +8 -7
- data/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +20 -4
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +4 -4
- data/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +6 -0
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +31 -31
- data/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +150 -58
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +11 -11
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +51 -18
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c +175 -0
- data/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h +764 -0
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +22 -22
- data/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +97 -10
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.c +6 -6
- data/src/core/ext/upb-generated/udpa/annotations/security.upb.h +23 -2
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c +3 -3
- data/src/core/ext/upb-generated/udpa/annotations/sensitive.upb.h +10 -2
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.c +6 -6
- data/src/core/ext/upb-generated/udpa/annotations/status.upb.h +27 -6
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +5 -5
- data/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +20 -2
- data/src/core/ext/upb-generated/validate/validate.upb.c +261 -250
- data/src/core/ext/upb-generated/validate/validate.upb.h +1836 -663
- data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c +22 -22
- data/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h +97 -10
- data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c +6 -6
- data/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h +23 -2
- data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.c +3 -3
- data/src/core/ext/upb-generated/xds/annotations/v3/sensitive.upb.h +10 -2
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +18 -18
- data/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +70 -10
- data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c +5 -5
- data/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h +20 -2
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +2 -2
- data/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +3 -0
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +8 -8
- data/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +38 -12
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +5 -5
- data/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +27 -10
- data/src/core/ext/upb-generated/xds/core/v3/extension.upb.c +3 -3
- data/src/core/ext/upb-generated/xds/core/v3/extension.upb.h +10 -2
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +5 -5
- data/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +21 -8
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +10 -10
- data/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +71 -30
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +5 -5
- data/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +16 -2
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.c +12 -12
- data/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +69 -26
- data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c +43 -39
- data/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h +255 -103
- data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c +4 -4
- data/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h +19 -8
- data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c +9 -9
- data/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h +70 -25
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +3 -3
- data/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +10 -2
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/circuit_breaker.upbdefs.c +50 -46
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/cluster.upbdefs.c +195 -185
- data/src/core/ext/upbdefs-generated/envoy/config/cluster/v3/outlier_detection.upbdefs.c +16 -12
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.c +129 -94
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/config_source.upbdefs.h +10 -0
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.c +18 -33
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/extension.upbdefs.h +0 -5
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.c +163 -155
- data/src/core/ext/upbdefs-generated/envoy/config/core/v3/health_check.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/config/listener/v3/listener_components.upbdefs.c +141 -138
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route.upbdefs.c +26 -20
- data/src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c +738 -730
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c +271 -251
- data/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.c +207 -193
- data/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/tls.upbdefs.h +5 -0
- data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.c +99 -0
- data/src/core/ext/upbdefs-generated/src/proto/grpc/lookup/v1/rls_config.upbdefs.h +75 -0
- data/src/core/ext/xds/certificate_provider_store.cc +8 -0
- data/src/core/ext/xds/certificate_provider_store.h +9 -0
- data/src/core/ext/xds/xds_api.cc +20 -0
- data/src/core/ext/xds/xds_bootstrap.cc +2 -2
- data/src/core/ext/xds/xds_bootstrap.h +2 -0
- data/src/core/ext/xds/xds_certificate_provider.cc +2 -0
- data/src/core/ext/xds/xds_certificate_provider.h +8 -0
- data/src/core/ext/xds/xds_client.cc +87 -95
- data/src/core/ext/xds/xds_client.h +13 -5
- data/src/core/ext/xds/xds_cluster_specifier_plugin.cc +142 -0
- data/src/core/ext/xds/xds_cluster_specifier_plugin.h +79 -0
- data/src/core/ext/xds/xds_common_types.cc +9 -9
- data/src/core/ext/xds/xds_common_types.h +3 -3
- data/src/core/ext/xds/xds_endpoint.cc +12 -5
- data/src/core/ext/xds/xds_http_fault_filter.cc +1 -1
- data/src/core/ext/xds/xds_listener.cc +1 -1
- data/src/core/ext/xds/xds_route_config.cc +162 -25
- data/src/core/ext/xds/xds_route_config.h +13 -10
- data/src/core/ext/xds/xds_server_config_fetcher.cc +17 -22
- data/src/core/lib/avl/avl.h +68 -5
- data/src/core/lib/channel/call_tracer.h +4 -1
- data/src/core/lib/channel/channel_args.cc +138 -59
- data/src/core/lib/channel/channel_args.h +210 -9
- data/src/core/lib/channel/channel_args_preconditioning.cc +3 -9
- data/src/core/lib/channel/channel_args_preconditioning.h +1 -2
- data/src/core/lib/channel/channel_stack.h +2 -5
- data/src/core/lib/channel/channel_stack_builder.cc +0 -65
- data/src/core/lib/channel/channel_stack_builder.h +27 -6
- data/src/core/lib/channel/channel_stack_builder_impl.cc +102 -0
- data/src/core/lib/channel/channel_stack_builder_impl.h +48 -0
- data/src/core/lib/channel/connected_channel.h +1 -0
- data/src/core/lib/channel/promise_based_filter.cc +495 -162
- data/src/core/lib/channel/promise_based_filter.h +55 -41
- data/src/core/lib/compression/compression_internal.cc +1 -7
- data/src/core/lib/debug/stats_data.cc +2 -6
- data/src/core/lib/debug/stats_data.h +18 -21
- data/src/core/lib/gpr/tls.h +1 -0
- data/src/core/lib/gprpp/bitset.h +12 -0
- data/src/core/lib/gprpp/cpp_impl_of.h +4 -0
- data/src/core/lib/gprpp/match.h +73 -0
- data/src/core/lib/gprpp/overload.h +59 -0
- data/src/core/lib/gprpp/ref_counted.h +2 -0
- data/src/core/lib/gprpp/single_set_ptr.h +87 -0
- data/src/core/lib/gprpp/status_helper.cc +18 -2
- data/src/core/lib/gprpp/time.cc +12 -0
- data/src/core/lib/gprpp/time.h +1 -1
- data/src/core/lib/http/format_request.cc +1 -2
- data/src/core/lib/http/httpcli_security_connector.cc +5 -5
- data/src/core/lib/http/parser.cc +80 -9
- data/src/core/lib/http/parser.h +14 -1
- data/src/core/lib/iomgr/ev_posix.cc +6 -7
- data/src/core/lib/iomgr/fork_posix.cc +1 -1
- data/src/core/lib/iomgr/port.h +0 -2
- data/src/core/lib/iomgr/tcp_client_posix.cc +2 -2
- data/src/core/lib/iomgr/tcp_posix.cc +93 -35
- data/src/core/lib/iomgr/tcp_server_posix.cc +26 -17
- data/src/core/lib/json/json_util.h +3 -3
- data/src/core/lib/promise/call_push_pull.h +144 -0
- data/src/core/lib/promise/detail/status.h +2 -1
- data/src/core/lib/promise/intra_activity_waiter.h +49 -0
- data/src/core/lib/promise/latch.h +104 -0
- data/src/core/lib/resource_quota/api.cc +5 -30
- data/src/core/lib/resource_quota/api.h +1 -1
- data/src/core/lib/resource_quota/resource_quota.h +8 -0
- data/src/core/lib/security/authorization/authorization_policy_provider.h +7 -0
- data/src/core/lib/security/authorization/grpc_server_authz_filter.cc +9 -12
- data/src/core/lib/security/authorization/grpc_server_authz_filter.h +5 -6
- data/src/core/lib/security/context/security_context.h +8 -1
- data/src/core/lib/security/credentials/alts/alts_credentials.cc +6 -5
- data/src/core/lib/security/credentials/alts/alts_credentials.h +4 -0
- data/src/core/lib/security/credentials/call_creds_util.cc +3 -3
- data/src/core/lib/security/credentials/call_creds_util.h +2 -2
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +15 -10
- data/src/core/lib/security/credentials/composite/composite_credentials.h +9 -8
- data/src/core/lib/security/credentials/credentials.h +16 -33
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +8 -12
- data/src/core/lib/security/credentials/fake/fake_credentials.h +8 -5
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +4 -0
- data/src/core/lib/security/credentials/google_default/google_default_credentials.h +3 -3
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +5 -4
- data/src/core/lib/security/credentials/iam/iam_credentials.h +6 -2
- data/src/core/lib/security/credentials/insecure/insecure_credentials.cc +22 -29
- data/src/core/lib/security/credentials/insecure/insecure_credentials.h +57 -0
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +7 -3
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +6 -2
- data/src/core/lib/security/credentials/local/local_credentials.cc +6 -6
- data/src/core/lib/security/credentials/local/local_credentials.h +4 -0
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +17 -9
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +14 -6
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +8 -6
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +8 -6
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +6 -4
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +8 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_provider.h +49 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.cc +8 -0
- data/src/core/lib/security/credentials/tls/grpc_tls_certificate_verifier.h +42 -3
- data/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h +66 -95
- data/src/core/lib/security/credentials/tls/tls_credentials.cc +9 -6
- data/src/core/lib/security/credentials/tls/tls_credentials.h +5 -5
- data/src/core/lib/security/credentials/xds/xds_credentials.cc +48 -50
- data/src/core/lib/security/credentials/xds/xds_credentials.h +31 -5
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +2 -2
- data/src/core/lib/security/security_connector/security_connector.h +9 -0
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +4 -2
- data/src/core/lib/security/security_connector/tls/tls_security_connector.cc +4 -2
- data/src/core/lib/security/transport/auth_filters.h +7 -7
- data/src/core/lib/security/transport/client_auth_filter.cc +28 -20
- data/src/core/lib/security/transport/secure_endpoint.cc +198 -129
- data/src/core/lib/security/transport/secure_endpoint.h +1 -1
- data/src/core/lib/security/transport/security_handshaker.cc +6 -4
- data/src/core/lib/surface/call.cc +1023 -903
- data/src/core/lib/surface/call.h +0 -14
- data/src/core/lib/surface/channel.cc +4 -3
- data/src/core/lib/surface/channel_init.cc +2 -3
- data/src/core/lib/surface/channel_init.h +2 -6
- data/src/core/lib/surface/init.cc +1 -1
- data/src/core/lib/surface/server.cc +3 -14
- data/src/core/lib/surface/server.h +1 -2
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/byte_stream.cc +2 -0
- data/src/core/lib/transport/metadata_batch.h +12 -8
- data/src/core/lib/transport/transport.h +20 -5
- data/src/core/lib/transport/transport_impl.h +4 -3
- data/src/core/plugin_registry/grpc_plugin_registry.cc +2 -4
- data/src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc +2 -2
- data/src/core/tsi/ssl_transport_security.cc +75 -38
- data/src/core/tsi/ssl_transport_security.h +8 -2
- data/src/core/tsi/transport_security_interface.h +2 -0
- data/src/ruby/ext/grpc/extconf.rb +1 -1
- data/src/ruby/lib/grpc/generic/active_call.rb +7 -1
- data/src/ruby/lib/grpc/grpc.rb +1 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/generate_proto_ruby.sh +1 -0
- data/src/ruby/pb/test/client.rb +769 -0
- data/src/ruby/pb/test/server.rb +252 -0
- data/src/ruby/pb/test/xds_client.rb +415 -0
- data/third_party/upb/third_party/utf8_range/utf8_range.h +1 -1
- data/third_party/upb/upb/decode.c +32 -16
- data/third_party/upb/upb/def.c +118 -55
- data/third_party/upb/upb/def.h +12 -3
- data/third_party/upb/upb/encode.c +14 -8
- data/third_party/upb/upb/json_encode.c +776 -0
- data/third_party/upb/upb/json_encode.h +62 -0
- data/third_party/upb/upb/msg.c +5 -7
- data/third_party/upb/upb/msg.h +1 -2
- data/third_party/upb/upb/msg_internal.h +49 -36
- data/third_party/upb/upb/port_def.inc +8 -0
- data/third_party/upb/upb/port_undef.inc +1 -0
- data/third_party/upb/upb/table.c +10 -6
- data/third_party/upb/upb/table_internal.h +2 -0
- data/third_party/upb/upb/upb.h +41 -11
- data/third_party/zlib/crc32.c +966 -292
- data/third_party/zlib/crc32.h +9441 -436
- data/third_party/zlib/deflate.c +78 -30
- data/third_party/zlib/deflate.h +12 -15
- data/third_party/zlib/gzguts.h +3 -2
- data/third_party/zlib/gzlib.c +5 -3
- data/third_party/zlib/gzread.c +5 -7
- data/third_party/zlib/gzwrite.c +25 -13
- data/third_party/zlib/infback.c +2 -1
- data/third_party/zlib/inffast.c +14 -14
- data/third_party/zlib/inflate.c +39 -8
- data/third_party/zlib/inflate.h +3 -2
- data/third_party/zlib/inftrees.c +3 -3
- data/third_party/zlib/trees.c +27 -48
- data/third_party/zlib/zlib.h +123 -100
- data/third_party/zlib/zutil.c +2 -2
- data/third_party/zlib/zutil.h +12 -9
- metadata +66 -45
- data/src/core/ext/filters/client_idle/client_idle_filter.cc +0 -201
- data/src/core/ext/filters/max_age/max_age_filter.cc +0 -566
- data/src/core/ext/filters/max_age/max_age_filter.h +0 -26
- data/src/core/lib/iomgr/ev_epollex_linux.cc +0 -1657
- data/src/core/lib/iomgr/ev_epollex_linux.h +0 -30
- data/src/core/lib/iomgr/is_epollexclusive_available.cc +0 -119
- data/src/core/lib/iomgr/is_epollexclusive_available.h +0 -36
- data/src/core/lib/iomgr/sys_epoll_wrapper.h +0 -30
data/third_party/zlib/deflate.c
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/* deflate.c -- compress data using the deflation algorithm
|
2
|
-
* Copyright (C) 1995-
|
2
|
+
* Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
|
3
3
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
4
4
|
*/
|
5
5
|
|
@@ -52,7 +52,7 @@
|
|
52
52
|
#include "deflate.h"
|
53
53
|
|
54
54
|
const char deflate_copyright[] =
|
55
|
-
" deflate 1.2.
|
55
|
+
" deflate 1.2.12 Copyright 1995-2022 Jean-loup Gailly and Mark Adler ";
|
56
56
|
/*
|
57
57
|
If you use the zlib library in a product, an acknowledgment is welcome
|
58
58
|
in the documentation of your product. If for some reason you cannot
|
@@ -190,8 +190,11 @@ local const config configuration_table[10] = {
|
|
190
190
|
* prev[] will be initialized on the fly.
|
191
191
|
*/
|
192
192
|
#define CLEAR_HASH(s) \
|
193
|
-
|
194
|
-
|
193
|
+
do { \
|
194
|
+
s->head[s->hash_size-1] = NIL; \
|
195
|
+
zmemzero((Bytef *)s->head, \
|
196
|
+
(unsigned)(s->hash_size-1)*sizeof(*s->head)); \
|
197
|
+
} while (0)
|
195
198
|
|
196
199
|
/* ===========================================================================
|
197
200
|
* Slide the hash table when sliding the window down (could be avoided with 32
|
@@ -252,11 +255,6 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
|
|
252
255
|
int wrap = 1;
|
253
256
|
static const char my_version[] = ZLIB_VERSION;
|
254
257
|
|
255
|
-
ushf *overlay;
|
256
|
-
/* We overlay pending_buf and d_buf+l_buf. This works since the average
|
257
|
-
* output size for (length,distance) codes is <= 24 bits.
|
258
|
-
*/
|
259
|
-
|
260
258
|
if (version == Z_NULL || version[0] != my_version[0] ||
|
261
259
|
stream_size != sizeof(z_stream)) {
|
262
260
|
return Z_VERSION_ERROR;
|
@@ -326,9 +324,47 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
|
|
326
324
|
|
327
325
|
s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
|
328
326
|
|
329
|
-
overlay
|
330
|
-
|
331
|
-
|
327
|
+
/* We overlay pending_buf and sym_buf. This works since the average size
|
328
|
+
* for length/distance pairs over any compressed block is assured to be 31
|
329
|
+
* bits or less.
|
330
|
+
*
|
331
|
+
* Analysis: The longest fixed codes are a length code of 8 bits plus 5
|
332
|
+
* extra bits, for lengths 131 to 257. The longest fixed distance codes are
|
333
|
+
* 5 bits plus 13 extra bits, for distances 16385 to 32768. The longest
|
334
|
+
* possible fixed-codes length/distance pair is then 31 bits total.
|
335
|
+
*
|
336
|
+
* sym_buf starts one-fourth of the way into pending_buf. So there are
|
337
|
+
* three bytes in sym_buf for every four bytes in pending_buf. Each symbol
|
338
|
+
* in sym_buf is three bytes -- two for the distance and one for the
|
339
|
+
* literal/length. As each symbol is consumed, the pointer to the next
|
340
|
+
* sym_buf value to read moves forward three bytes. From that symbol, up to
|
341
|
+
* 31 bits are written to pending_buf. The closest the written pending_buf
|
342
|
+
* bits gets to the next sym_buf symbol to read is just before the last
|
343
|
+
* code is written. At that time, 31*(n-2) bits have been written, just
|
344
|
+
* after 24*(n-2) bits have been consumed from sym_buf. sym_buf starts at
|
345
|
+
* 8*n bits into pending_buf. (Note that the symbol buffer fills when n-1
|
346
|
+
* symbols are written.) The closest the writing gets to what is unread is
|
347
|
+
* then n+14 bits. Here n is lit_bufsize, which is 16384 by default, and
|
348
|
+
* can range from 128 to 32768.
|
349
|
+
*
|
350
|
+
* Therefore, at a minimum, there are 142 bits of space between what is
|
351
|
+
* written and what is read in the overlain buffers, so the symbols cannot
|
352
|
+
* be overwritten by the compressed data. That space is actually 139 bits,
|
353
|
+
* due to the three-bit fixed-code block header.
|
354
|
+
*
|
355
|
+
* That covers the case where either Z_FIXED is specified, forcing fixed
|
356
|
+
* codes, or when the use of fixed codes is chosen, because that choice
|
357
|
+
* results in a smaller compressed block than dynamic codes. That latter
|
358
|
+
* condition then assures that the above analysis also covers all dynamic
|
359
|
+
* blocks. A dynamic-code block will only be chosen to be emitted if it has
|
360
|
+
* fewer bits than a fixed-code block would for the same set of symbols.
|
361
|
+
* Therefore its average symbol length is assured to be less than 31. So
|
362
|
+
* the compressed data for a dynamic block also cannot overwrite the
|
363
|
+
* symbols from which it is being constructed.
|
364
|
+
*/
|
365
|
+
|
366
|
+
s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, 4);
|
367
|
+
s->pending_buf_size = (ulg)s->lit_bufsize * 4;
|
332
368
|
|
333
369
|
if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
|
334
370
|
s->pending_buf == Z_NULL) {
|
@@ -337,8 +373,12 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
|
|
337
373
|
deflateEnd (strm);
|
338
374
|
return Z_MEM_ERROR;
|
339
375
|
}
|
340
|
-
s->
|
341
|
-
s->
|
376
|
+
s->sym_buf = s->pending_buf + s->lit_bufsize;
|
377
|
+
s->sym_end = (s->lit_bufsize - 1) * 3;
|
378
|
+
/* We avoid equality with lit_bufsize*3 because of wraparound at 64K
|
379
|
+
* on 16 bit machines and because stored blocks are restricted to
|
380
|
+
* 64K-1 bytes.
|
381
|
+
*/
|
342
382
|
|
343
383
|
s->level = level;
|
344
384
|
s->strategy = strategy;
|
@@ -488,13 +528,13 @@ int ZEXPORT deflateResetKeep (strm)
|
|
488
528
|
#ifdef GZIP
|
489
529
|
s->wrap == 2 ? GZIP_STATE :
|
490
530
|
#endif
|
491
|
-
|
531
|
+
INIT_STATE;
|
492
532
|
strm->adler =
|
493
533
|
#ifdef GZIP
|
494
534
|
s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
|
495
535
|
#endif
|
496
536
|
adler32(0L, Z_NULL, 0);
|
497
|
-
s->last_flush =
|
537
|
+
s->last_flush = -2;
|
498
538
|
|
499
539
|
_tr_init(s);
|
500
540
|
|
@@ -549,7 +589,8 @@ int ZEXPORT deflatePrime (strm, bits, value)
|
|
549
589
|
|
550
590
|
if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
|
551
591
|
s = strm->state;
|
552
|
-
if (
|
592
|
+
if (bits < 0 || bits > 16 ||
|
593
|
+
s->sym_buf < s->pending_out + ((Buf_size + 7) >> 3))
|
553
594
|
return Z_BUF_ERROR;
|
554
595
|
do {
|
555
596
|
put = Buf_size - s->bi_valid;
|
@@ -587,12 +628,12 @@ int ZEXPORT deflateParams(strm, level, strategy)
|
|
587
628
|
func = configuration_table[s->level].func;
|
588
629
|
|
589
630
|
if ((strategy != s->strategy || func != configuration_table[level].func) &&
|
590
|
-
s->
|
631
|
+
s->last_flush != -2) {
|
591
632
|
/* Flush the last buffer: */
|
592
633
|
int err = deflate(strm, Z_BLOCK);
|
593
634
|
if (err == Z_STREAM_ERROR)
|
594
635
|
return err;
|
595
|
-
if (strm->
|
636
|
+
if (strm->avail_in || (s->strstart - s->block_start) + s->lookahead)
|
596
637
|
return Z_BUF_ERROR;
|
597
638
|
}
|
598
639
|
if (s->level != level) {
|
@@ -811,6 +852,8 @@ int ZEXPORT deflate (strm, flush)
|
|
811
852
|
}
|
812
853
|
|
813
854
|
/* Write the header */
|
855
|
+
if (s->status == INIT_STATE && s->wrap == 0)
|
856
|
+
s->status = BUSY_STATE;
|
814
857
|
if (s->status == INIT_STATE) {
|
815
858
|
/* zlib header */
|
816
859
|
uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;
|
@@ -1108,7 +1151,6 @@ int ZEXPORT deflateCopy (dest, source)
|
|
1108
1151
|
#else
|
1109
1152
|
deflate_state *ds;
|
1110
1153
|
deflate_state *ss;
|
1111
|
-
ushf *overlay;
|
1112
1154
|
|
1113
1155
|
|
1114
1156
|
if (deflateStateCheck(source) || dest == Z_NULL) {
|
@@ -1128,8 +1170,7 @@ int ZEXPORT deflateCopy (dest, source)
|
|
1128
1170
|
ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte));
|
1129
1171
|
ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos));
|
1130
1172
|
ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos));
|
1131
|
-
|
1132
|
-
ds->pending_buf = (uchf *) overlay;
|
1173
|
+
ds->pending_buf = (uchf *) ZALLOC(dest, ds->lit_bufsize, 4);
|
1133
1174
|
|
1134
1175
|
if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL ||
|
1135
1176
|
ds->pending_buf == Z_NULL) {
|
@@ -1143,8 +1184,7 @@ int ZEXPORT deflateCopy (dest, source)
|
|
1143
1184
|
zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size);
|
1144
1185
|
|
1145
1186
|
ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
|
1146
|
-
ds->
|
1147
|
-
ds->l_buf = ds->pending_buf + (1+sizeof(ush))*ds->lit_bufsize;
|
1187
|
+
ds->sym_buf = ds->pending_buf + ds->lit_bufsize;
|
1148
1188
|
|
1149
1189
|
ds->l_desc.dyn_tree = ds->dyn_ltree;
|
1150
1190
|
ds->d_desc.dyn_tree = ds->dyn_dtree;
|
@@ -1513,6 +1553,8 @@ local void fill_window(s)
|
|
1513
1553
|
s->match_start -= wsize;
|
1514
1554
|
s->strstart -= wsize; /* we now have strstart >= MAX_DIST */
|
1515
1555
|
s->block_start -= (long) wsize;
|
1556
|
+
if (s->insert > s->strstart)
|
1557
|
+
s->insert = s->strstart;
|
1516
1558
|
slide_hash(s);
|
1517
1559
|
more += wsize;
|
1518
1560
|
}
|
@@ -1742,6 +1784,7 @@ local block_state deflate_stored(s, flush)
|
|
1742
1784
|
s->matches = 2; /* clear hash */
|
1743
1785
|
zmemcpy(s->window, s->strm->next_in - s->w_size, s->w_size);
|
1744
1786
|
s->strstart = s->w_size;
|
1787
|
+
s->insert = s->strstart;
|
1745
1788
|
}
|
1746
1789
|
else {
|
1747
1790
|
if (s->window_size - s->strstart <= used) {
|
@@ -1750,12 +1793,14 @@ local block_state deflate_stored(s, flush)
|
|
1750
1793
|
zmemcpy(s->window, s->window + s->w_size, s->strstart);
|
1751
1794
|
if (s->matches < 2)
|
1752
1795
|
s->matches++; /* add a pending slide_hash() */
|
1796
|
+
if (s->insert > s->strstart)
|
1797
|
+
s->insert = s->strstart;
|
1753
1798
|
}
|
1754
1799
|
zmemcpy(s->window + s->strstart, s->strm->next_in - used, used);
|
1755
1800
|
s->strstart += used;
|
1801
|
+
s->insert += MIN(used, s->w_size - s->insert);
|
1756
1802
|
}
|
1757
1803
|
s->block_start = s->strstart;
|
1758
|
-
s->insert += MIN(used, s->w_size - s->insert);
|
1759
1804
|
}
|
1760
1805
|
if (s->high_water < s->strstart)
|
1761
1806
|
s->high_water = s->strstart;
|
@@ -1770,7 +1815,7 @@ local block_state deflate_stored(s, flush)
|
|
1770
1815
|
return block_done;
|
1771
1816
|
|
1772
1817
|
/* Fill the window with any remaining input. */
|
1773
|
-
have = s->window_size - s->strstart
|
1818
|
+
have = s->window_size - s->strstart;
|
1774
1819
|
if (s->strm->avail_in > have && s->block_start >= (long)s->w_size) {
|
1775
1820
|
/* Slide the window down. */
|
1776
1821
|
s->block_start -= s->w_size;
|
@@ -1779,12 +1824,15 @@ local block_state deflate_stored(s, flush)
|
|
1779
1824
|
if (s->matches < 2)
|
1780
1825
|
s->matches++; /* add a pending slide_hash() */
|
1781
1826
|
have += s->w_size; /* more space now */
|
1827
|
+
if (s->insert > s->strstart)
|
1828
|
+
s->insert = s->strstart;
|
1782
1829
|
}
|
1783
1830
|
if (have > s->strm->avail_in)
|
1784
1831
|
have = s->strm->avail_in;
|
1785
1832
|
if (have) {
|
1786
1833
|
read_buf(s->strm, s->window + s->strstart, have);
|
1787
1834
|
s->strstart += have;
|
1835
|
+
s->insert += MIN(have, s->w_size - s->insert);
|
1788
1836
|
}
|
1789
1837
|
if (s->high_water < s->strstart)
|
1790
1838
|
s->high_water = s->strstart;
|
@@ -1912,7 +1960,7 @@ local block_state deflate_fast(s, flush)
|
|
1912
1960
|
FLUSH_BLOCK(s, 1);
|
1913
1961
|
return finish_done;
|
1914
1962
|
}
|
1915
|
-
if (s->
|
1963
|
+
if (s->sym_next)
|
1916
1964
|
FLUSH_BLOCK(s, 0);
|
1917
1965
|
return block_done;
|
1918
1966
|
}
|
@@ -2043,7 +2091,7 @@ local block_state deflate_slow(s, flush)
|
|
2043
2091
|
FLUSH_BLOCK(s, 1);
|
2044
2092
|
return finish_done;
|
2045
2093
|
}
|
2046
|
-
if (s->
|
2094
|
+
if (s->sym_next)
|
2047
2095
|
FLUSH_BLOCK(s, 0);
|
2048
2096
|
return block_done;
|
2049
2097
|
}
|
@@ -2118,7 +2166,7 @@ local block_state deflate_rle(s, flush)
|
|
2118
2166
|
FLUSH_BLOCK(s, 1);
|
2119
2167
|
return finish_done;
|
2120
2168
|
}
|
2121
|
-
if (s->
|
2169
|
+
if (s->sym_next)
|
2122
2170
|
FLUSH_BLOCK(s, 0);
|
2123
2171
|
return block_done;
|
2124
2172
|
}
|
@@ -2157,7 +2205,7 @@ local block_state deflate_huff(s, flush)
|
|
2157
2205
|
FLUSH_BLOCK(s, 1);
|
2158
2206
|
return finish_done;
|
2159
2207
|
}
|
2160
|
-
if (s->
|
2208
|
+
if (s->sym_next)
|
2161
2209
|
FLUSH_BLOCK(s, 0);
|
2162
2210
|
return block_done;
|
2163
2211
|
}
|
data/third_party/zlib/deflate.h
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/* deflate.h -- internal compression state
|
2
|
-
* Copyright (C) 1995-
|
2
|
+
* Copyright (C) 1995-2018 Jean-loup Gailly
|
3
3
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
4
4
|
*/
|
5
5
|
|
@@ -217,7 +217,7 @@ typedef struct internal_state {
|
|
217
217
|
/* Depth of each subtree used as tie breaker for trees of equal frequency
|
218
218
|
*/
|
219
219
|
|
220
|
-
uchf *
|
220
|
+
uchf *sym_buf; /* buffer for distances and literals/lengths */
|
221
221
|
|
222
222
|
uInt lit_bufsize;
|
223
223
|
/* Size of match buffer for literals/lengths. There are 4 reasons for
|
@@ -239,13 +239,8 @@ typedef struct internal_state {
|
|
239
239
|
* - I can't count above 4
|
240
240
|
*/
|
241
241
|
|
242
|
-
uInt
|
243
|
-
|
244
|
-
ushf *d_buf;
|
245
|
-
/* Buffer for distances. To simplify the code, d_buf and l_buf have
|
246
|
-
* the same number of elements. To use different lengths, an extra flag
|
247
|
-
* array would be necessary.
|
248
|
-
*/
|
242
|
+
uInt sym_next; /* running index in sym_buf */
|
243
|
+
uInt sym_end; /* symbol table full when sym_next reaches this */
|
249
244
|
|
250
245
|
ulg opt_len; /* bit length of current block with optimal trees */
|
251
246
|
ulg static_len; /* bit length of current block with static trees */
|
@@ -325,20 +320,22 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
|
|
325
320
|
|
326
321
|
# define _tr_tally_lit(s, c, flush) \
|
327
322
|
{ uch cc = (c); \
|
328
|
-
s->
|
329
|
-
s->
|
323
|
+
s->sym_buf[s->sym_next++] = 0; \
|
324
|
+
s->sym_buf[s->sym_next++] = 0; \
|
325
|
+
s->sym_buf[s->sym_next++] = cc; \
|
330
326
|
s->dyn_ltree[cc].Freq++; \
|
331
|
-
flush = (s->
|
327
|
+
flush = (s->sym_next == s->sym_end); \
|
332
328
|
}
|
333
329
|
# define _tr_tally_dist(s, distance, length, flush) \
|
334
330
|
{ uch len = (uch)(length); \
|
335
331
|
ush dist = (ush)(distance); \
|
336
|
-
s->
|
337
|
-
s->
|
332
|
+
s->sym_buf[s->sym_next++] = dist; \
|
333
|
+
s->sym_buf[s->sym_next++] = dist >> 8; \
|
334
|
+
s->sym_buf[s->sym_next++] = len; \
|
338
335
|
dist--; \
|
339
336
|
s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
|
340
337
|
s->dyn_dtree[d_code(dist)].Freq++; \
|
341
|
-
flush = (s->
|
338
|
+
flush = (s->sym_next == s->sym_end); \
|
342
339
|
}
|
343
340
|
#else
|
344
341
|
# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
|
data/third_party/zlib/gzguts.h
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/* gzguts.h -- zlib internal header definitions for gz* operations
|
2
|
-
* Copyright (C) 2004
|
2
|
+
* Copyright (C) 2004-2019 Mark Adler
|
3
3
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
4
4
|
*/
|
5
5
|
|
@@ -39,7 +39,7 @@
|
|
39
39
|
# include <io.h>
|
40
40
|
#endif
|
41
41
|
|
42
|
-
#if defined(_WIN32)
|
42
|
+
#if defined(_WIN32)
|
43
43
|
# define WIDECHAR
|
44
44
|
#endif
|
45
45
|
|
@@ -190,6 +190,7 @@ typedef struct {
|
|
190
190
|
/* just for writing */
|
191
191
|
int level; /* compression level */
|
192
192
|
int strategy; /* compression strategy */
|
193
|
+
int reset; /* true if a reset is pending after a Z_FINISH */
|
193
194
|
/* seek request */
|
194
195
|
z_off64_t skip; /* amount to skip (already rewound if backwards) */
|
195
196
|
int seek; /* true if seek request pending */
|
data/third_party/zlib/gzlib.c
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
/* gzlib.c -- zlib functions common to reading and writing gzip files
|
2
|
-
* Copyright (C) 2004-
|
2
|
+
* Copyright (C) 2004-2019 Mark Adler
|
3
3
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
4
4
|
*/
|
5
5
|
|
6
6
|
#include "gzguts.h"
|
7
7
|
|
8
|
-
#if defined(_WIN32) && !defined(__BORLANDC__)
|
8
|
+
#if defined(_WIN32) && !defined(__BORLANDC__)
|
9
9
|
# define LSEEK _lseeki64
|
10
10
|
#else
|
11
11
|
#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
|
@@ -81,6 +81,8 @@ local void gz_reset(state)
|
|
81
81
|
state->past = 0; /* have not read past end yet */
|
82
82
|
state->how = LOOK; /* look for gzip header */
|
83
83
|
}
|
84
|
+
else /* for writing ... */
|
85
|
+
state->reset = 0; /* no deflateReset pending */
|
84
86
|
state->seek = 0; /* no seek request pending */
|
85
87
|
gz_error(state, Z_OK, NULL); /* clear error */
|
86
88
|
state->x.pos = 0; /* no uncompressed data yet */
|
@@ -397,7 +399,7 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence)
|
|
397
399
|
/* if within raw area while reading, just go there */
|
398
400
|
if (state->mode == GZ_READ && state->how == COPY &&
|
399
401
|
state->x.pos + offset >= 0) {
|
400
|
-
ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
|
402
|
+
ret = LSEEK(state->fd, offset - (z_off64_t)state->x.have, SEEK_CUR);
|
401
403
|
if (ret == -1)
|
402
404
|
return -1;
|
403
405
|
state->x.have = 0;
|
data/third_party/zlib/gzread.c
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/* gzread.c -- zlib functions for reading gzip files
|
2
|
-
* Copyright (C) 2004
|
2
|
+
* Copyright (C) 2004-2017 Mark Adler
|
3
3
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
4
4
|
*/
|
5
5
|
|
@@ -314,9 +314,9 @@ local z_size_t gz_read(state, buf, len)
|
|
314
314
|
got = 0;
|
315
315
|
do {
|
316
316
|
/* set n to the maximum amount of len that fits in an unsigned int */
|
317
|
-
n = -1;
|
317
|
+
n = (unsigned)-1;
|
318
318
|
if (n > len)
|
319
|
-
n = len;
|
319
|
+
n = (unsigned)len;
|
320
320
|
|
321
321
|
/* first just try copying data from the output buffer */
|
322
322
|
if (state->x.have) {
|
@@ -397,7 +397,7 @@ int ZEXPORT gzread(file, buf, len)
|
|
397
397
|
}
|
398
398
|
|
399
399
|
/* read len or fewer bytes to buf */
|
400
|
-
len = gz_read(state, buf, len);
|
400
|
+
len = (unsigned)gz_read(state, buf, len);
|
401
401
|
|
402
402
|
/* check for an error */
|
403
403
|
if (len == 0 && state->err != Z_OK && state->err != Z_BUF_ERROR)
|
@@ -447,7 +447,6 @@ z_size_t ZEXPORT gzfread(buf, size, nitems, file)
|
|
447
447
|
int ZEXPORT gzgetc(file)
|
448
448
|
gzFile file;
|
449
449
|
{
|
450
|
-
int ret;
|
451
450
|
unsigned char buf[1];
|
452
451
|
gz_statep state;
|
453
452
|
|
@@ -469,8 +468,7 @@ int ZEXPORT gzgetc(file)
|
|
469
468
|
}
|
470
469
|
|
471
470
|
/* nothing there -- try gz_read() */
|
472
|
-
|
473
|
-
return ret < 1 ? -1 : buf[0];
|
471
|
+
return gz_read(state, buf, 1) < 1 ? -1 : buf[0];
|
474
472
|
}
|
475
473
|
|
476
474
|
int ZEXPORT gzgetc_(file)
|
data/third_party/zlib/gzwrite.c
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/* gzwrite.c -- zlib functions for writing gzip files
|
2
|
-
* Copyright (C) 2004-
|
2
|
+
* Copyright (C) 2004-2019 Mark Adler
|
3
3
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
4
4
|
*/
|
5
5
|
|
@@ -97,6 +97,15 @@ local int gz_comp(state, flush)
|
|
97
97
|
return 0;
|
98
98
|
}
|
99
99
|
|
100
|
+
/* check for a pending reset */
|
101
|
+
if (state->reset) {
|
102
|
+
/* don't start a new gzip member unless there is data to write */
|
103
|
+
if (strm->avail_in == 0)
|
104
|
+
return 0;
|
105
|
+
deflateReset(strm);
|
106
|
+
state->reset = 0;
|
107
|
+
}
|
108
|
+
|
100
109
|
/* run deflate() on provided input until it produces no more output */
|
101
110
|
ret = Z_OK;
|
102
111
|
do {
|
@@ -134,7 +143,7 @@ local int gz_comp(state, flush)
|
|
134
143
|
|
135
144
|
/* if that completed a deflate stream, allow another to start */
|
136
145
|
if (flush == Z_FINISH)
|
137
|
-
|
146
|
+
state->reset = 1;
|
138
147
|
|
139
148
|
/* all done, no errors */
|
140
149
|
return 0;
|
@@ -209,7 +218,7 @@ local z_size_t gz_write(state, buf, len)
|
|
209
218
|
state->in);
|
210
219
|
copy = state->size - have;
|
211
220
|
if (copy > len)
|
212
|
-
copy = len;
|
221
|
+
copy = (unsigned)len;
|
213
222
|
memcpy(state->in + have, buf, copy);
|
214
223
|
state->strm.avail_in += copy;
|
215
224
|
state->x.pos += copy;
|
@@ -229,7 +238,7 @@ local z_size_t gz_write(state, buf, len)
|
|
229
238
|
do {
|
230
239
|
unsigned n = (unsigned)-1;
|
231
240
|
if (n > len)
|
232
|
-
n = len;
|
241
|
+
n = (unsigned)len;
|
233
242
|
state->strm.avail_in = n;
|
234
243
|
state->x.pos += n;
|
235
244
|
if (gz_comp(state, Z_NO_FLUSH) == -1)
|
@@ -349,12 +358,11 @@ int ZEXPORT gzputc(file, c)
|
|
349
358
|
}
|
350
359
|
|
351
360
|
/* -- see zlib.h -- */
|
352
|
-
int ZEXPORT gzputs(file,
|
361
|
+
int ZEXPORT gzputs(file, s)
|
353
362
|
gzFile file;
|
354
|
-
const char *
|
363
|
+
const char *s;
|
355
364
|
{
|
356
|
-
|
357
|
-
z_size_t len;
|
365
|
+
z_size_t len, put;
|
358
366
|
gz_statep state;
|
359
367
|
|
360
368
|
/* get internal structure */
|
@@ -367,9 +375,13 @@ int ZEXPORT gzputs(file, str)
|
|
367
375
|
return -1;
|
368
376
|
|
369
377
|
/* write string */
|
370
|
-
len = strlen(
|
371
|
-
|
372
|
-
|
378
|
+
len = strlen(s);
|
379
|
+
if ((int)len < 0 || (unsigned)len != len) {
|
380
|
+
gz_error(state, Z_STREAM_ERROR, "string length does not fit in int");
|
381
|
+
return -1;
|
382
|
+
}
|
383
|
+
put = gz_write(state, s, len);
|
384
|
+
return put < len ? -1 : (int)len;
|
373
385
|
}
|
374
386
|
|
375
387
|
#if defined(STDC) || defined(Z_HAVE_STDARG_H)
|
@@ -441,7 +453,7 @@ int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va)
|
|
441
453
|
strm->avail_in = state->size;
|
442
454
|
if (gz_comp(state, Z_NO_FLUSH) == -1)
|
443
455
|
return state->err;
|
444
|
-
|
456
|
+
memmove(state->in, state->in + state->size, left);
|
445
457
|
strm->next_in = state->in;
|
446
458
|
strm->avail_in = left;
|
447
459
|
}
|
@@ -540,7 +552,7 @@ int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
|
|
540
552
|
strm->avail_in = state->size;
|
541
553
|
if (gz_comp(state, Z_NO_FLUSH) == -1)
|
542
554
|
return state->err;
|
543
|
-
|
555
|
+
memmove(state->in, state->in + state->size, left);
|
544
556
|
strm->next_in = state->in;
|
545
557
|
strm->avail_in = left;
|
546
558
|
}
|
data/third_party/zlib/infback.c
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/* infback.c -- inflate using a call-back interface
|
2
|
-
* Copyright (C) 1995-
|
2
|
+
* Copyright (C) 1995-2022 Mark Adler
|
3
3
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
4
4
|
*/
|
5
5
|
|
@@ -477,6 +477,7 @@ void FAR *out_desc;
|
|
477
477
|
}
|
478
478
|
Tracev((stderr, "inflate: codes ok\n"));
|
479
479
|
state->mode = LEN;
|
480
|
+
/* fallthrough */
|
480
481
|
|
481
482
|
case LEN:
|
482
483
|
/* use inflate_fast() if we have enough input and output */
|
data/third_party/zlib/inffast.c
CHANGED
@@ -70,7 +70,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
|
|
70
70
|
code const FAR *dcode; /* local strm->distcode */
|
71
71
|
unsigned lmask; /* mask for first level of length codes */
|
72
72
|
unsigned dmask; /* mask for first level of distance codes */
|
73
|
-
code here;
|
73
|
+
code const *here; /* retrieved table entry */
|
74
74
|
unsigned op; /* code bits, operation, extra bits, or */
|
75
75
|
/* window position, window bytes to copy */
|
76
76
|
unsigned len; /* match length, unused bytes */
|
@@ -107,20 +107,20 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
|
|
107
107
|
hold += (unsigned long)(*in++) << bits;
|
108
108
|
bits += 8;
|
109
109
|
}
|
110
|
-
here = lcode
|
110
|
+
here = lcode + (hold & lmask);
|
111
111
|
dolen:
|
112
|
-
op = (unsigned)(here
|
112
|
+
op = (unsigned)(here->bits);
|
113
113
|
hold >>= op;
|
114
114
|
bits -= op;
|
115
|
-
op = (unsigned)(here
|
115
|
+
op = (unsigned)(here->op);
|
116
116
|
if (op == 0) { /* literal */
|
117
|
-
Tracevv((stderr, here
|
117
|
+
Tracevv((stderr, here->val >= 0x20 && here->val < 0x7f ?
|
118
118
|
"inflate: literal '%c'\n" :
|
119
|
-
"inflate: literal 0x%02x\n", here
|
120
|
-
*out++ = (unsigned char)(here
|
119
|
+
"inflate: literal 0x%02x\n", here->val));
|
120
|
+
*out++ = (unsigned char)(here->val);
|
121
121
|
}
|
122
122
|
else if (op & 16) { /* length base */
|
123
|
-
len = (unsigned)(here
|
123
|
+
len = (unsigned)(here->val);
|
124
124
|
op &= 15; /* number of extra bits */
|
125
125
|
if (op) {
|
126
126
|
if (bits < op) {
|
@@ -138,14 +138,14 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
|
|
138
138
|
hold += (unsigned long)(*in++) << bits;
|
139
139
|
bits += 8;
|
140
140
|
}
|
141
|
-
here = dcode
|
141
|
+
here = dcode + (hold & dmask);
|
142
142
|
dodist:
|
143
|
-
op = (unsigned)(here
|
143
|
+
op = (unsigned)(here->bits);
|
144
144
|
hold >>= op;
|
145
145
|
bits -= op;
|
146
|
-
op = (unsigned)(here
|
146
|
+
op = (unsigned)(here->op);
|
147
147
|
if (op & 16) { /* distance base */
|
148
|
-
dist = (unsigned)(here
|
148
|
+
dist = (unsigned)(here->val);
|
149
149
|
op &= 15; /* number of extra bits */
|
150
150
|
if (bits < op) {
|
151
151
|
hold += (unsigned long)(*in++) << bits;
|
@@ -264,7 +264,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
|
|
264
264
|
}
|
265
265
|
}
|
266
266
|
else if ((op & 64) == 0) { /* 2nd level distance code */
|
267
|
-
here = dcode
|
267
|
+
here = dcode + here->val + (hold & ((1U << op) - 1));
|
268
268
|
goto dodist;
|
269
269
|
}
|
270
270
|
else {
|
@@ -274,7 +274,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
|
|
274
274
|
}
|
275
275
|
}
|
276
276
|
else if ((op & 64) == 0) { /* 2nd level length code */
|
277
|
-
here = lcode
|
277
|
+
here = lcode + here->val + (hold & ((1U << op) - 1));
|
278
278
|
goto dolen;
|
279
279
|
}
|
280
280
|
else if (op & 32) { /* end-of-block */
|