diff options
author | James M Snell <jasnell@gmail.com> | 2018-09-16 19:13:11 -0700 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2018-09-21 13:23:08 -0700 |
commit | b92ce5165f91eec1f312bb9f762357e673f83501 (patch) | |
tree | 26b2416d55c157aba43e76953f3abebb8e65343f /src/node_http2.h | |
parent | c55ebd8502352c6405bfd8c3b356285ccdd242fd (diff) | |
download | android-node-v8-b92ce5165f91eec1f312bb9f762357e673f83501.tar.gz android-node-v8-b92ce5165f91eec1f312bb9f762357e673f83501.tar.bz2 android-node-v8-b92ce5165f91eec1f312bb9f762357e673f83501.zip |
http2: add origin frame support
PR-URL: https://github.com/nodejs/node/pull/22956
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'src/node_http2.h')
-rw-r--r-- | src/node_http2.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/node_http2.h b/src/node_http2.h index d7f8d9acae..7fa230979a 100644 --- a/src/node_http2.h +++ b/src/node_http2.h @@ -364,7 +364,7 @@ class Http2Scope { // configured. class Http2Options { public: - explicit Http2Options(Environment* env); + Http2Options(Environment* env, nghttp2_session_type type); ~Http2Options() { nghttp2_option_del(options_); @@ -700,6 +700,8 @@ class Http2Session : public AsyncWrap, public StreamListener { size_t origin_len, uint8_t* value, size_t value_len); + void Origin(nghttp2_origin_entry* ov, size_t count); + bool Ping(v8::Local<v8::Function> function); @@ -796,6 +798,7 @@ class Http2Session : public AsyncWrap, public StreamListener { static void RefreshState(const FunctionCallbackInfo<Value>& args); static void Ping(const FunctionCallbackInfo<Value>& args); static void AltSvc(const FunctionCallbackInfo<Value>& args); + static void Origin(const FunctionCallbackInfo<Value>& args); template <get_setting fn> static void RefreshSettings(const FunctionCallbackInfo<Value>& args); @@ -871,6 +874,7 @@ class Http2Session : public AsyncWrap, public StreamListener { void HandleSettingsFrame(const nghttp2_frame* frame); void HandlePingFrame(const nghttp2_frame* frame); void HandleAltSvcFrame(const nghttp2_frame* frame); + void HandleOriginFrame(const nghttp2_frame* frame); // nghttp2 callbacks static int OnBeginHeadersCallback( @@ -1224,6 +1228,27 @@ class Headers { MaybeStackBuffer<char, 3000> buf_; }; +class Origins { + public: + Origins(Isolate* isolate, + Local<Context> context, + Local<v8::String> origin_string, + size_t origin_count); + ~Origins() {} + + nghttp2_origin_entry* operator*() { + return reinterpret_cast<nghttp2_origin_entry*>(*buf_); + } + + size_t length() const { + return count_; + } + + private: + size_t count_; + MaybeStackBuffer<char, 512> buf_; +}; + } // namespace http2 } // namespace node |