summaryrefslogtreecommitdiff
path: root/src/node_http2.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/node_http2.cc')
-rw-r--r--src/node_http2.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/node_http2.cc b/src/node_http2.cc
index 7170907ced..4c1e5dd583 100644
--- a/src/node_http2.cc
+++ b/src/node_http2.cc
@@ -647,7 +647,9 @@ Http2Session::Http2Session(Environment* env,
{
// Make the js_fields_ property accessible to JS land.
Local<ArrayBuffer> ab =
- ArrayBuffer::New(env->isolate(), js_fields_, kSessionUint8FieldCount);
+ ArrayBuffer::New(env->isolate(),
+ reinterpret_cast<uint8_t*>(&js_fields_),
+ kSessionUint8FieldCount);
Local<Uint8Array> uint8_arr =
Uint8Array::New(ab, 0, kSessionUint8FieldCount);
USE(wrap->Set(env->context(), env->fields_string(), uint8_arr));
@@ -1046,7 +1048,7 @@ int Http2Session::OnFrameNotSent(nghttp2_session* handle,
if (error_code == NGHTTP2_ERR_SESSION_CLOSING ||
error_code == NGHTTP2_ERR_STREAM_CLOSED ||
error_code == NGHTTP2_ERR_STREAM_CLOSING ||
- session->js_fields_[kSessionFrameErrorListenerCount] == 0) {
+ session->js_fields_.frame_error_listener_count == 0) {
return 0;
}
@@ -1349,7 +1351,7 @@ void Http2Session::HandleHeadersFrame(const nghttp2_frame* frame) {
// are considered advisory only, so this has no real effect other than to
// simply let user code know that the priority has changed.
void Http2Session::HandlePriorityFrame(const nghttp2_frame* frame) {
- if (js_fields_[kSessionPriorityListenerCount] == 0) return;
+ if (js_fields_.priority_listener_count == 0) return;
Isolate* isolate = env()->isolate();
HandleScope scope(isolate);
Local<Context> context = env()->context();
@@ -1418,7 +1420,7 @@ void Http2Session::HandleGoawayFrame(const nghttp2_frame* frame) {
// Called by OnFrameReceived when a complete ALTSVC frame has been received.
void Http2Session::HandleAltSvcFrame(const nghttp2_frame* frame) {
- if (!(js_fields_[kBitfield] & (1 << kSessionHasAltsvcListeners))) return;
+ if (!(js_fields_.bitfield & (1 << kSessionHasAltsvcListeners))) return;
Isolate* isolate = env()->isolate();
HandleScope scope(isolate);
Local<Context> context = env()->context();
@@ -1497,7 +1499,7 @@ void Http2Session::HandlePingFrame(const nghttp2_frame* frame) {
return;
}
- if (!(js_fields_[kBitfield] & (1 << kSessionHasPingListeners))) return;
+ if (!(js_fields_.bitfield & (1 << kSessionHasPingListeners))) return;
// Notify the session that a ping occurred
arg = Buffer::Copy(env(),
reinterpret_cast<const char*>(frame->ping.opaque_data),
@@ -1509,8 +1511,8 @@ void Http2Session::HandlePingFrame(const nghttp2_frame* frame) {
void Http2Session::HandleSettingsFrame(const nghttp2_frame* frame) {
bool ack = frame->hd.flags & NGHTTP2_FLAG_ACK;
if (!ack) {
- js_fields_[kBitfield] &= ~(1 << kSessionRemoteSettingsIsUpToDate);
- if (!(js_fields_[kBitfield] & (1 << kSessionHasRemoteSettingsListeners)))
+ js_fields_.bitfield &= ~(1 << kSessionRemoteSettingsIsUpToDate);
+ if (!(js_fields_.bitfield & (1 << kSessionHasRemoteSettingsListeners)))
return;
// This is not a SETTINGS acknowledgement, notify and return
MakeCallback(env()->http2session_on_settings_function(), 0, nullptr);