@@ -647,7 +647,9 @@ Http2Session::Http2Session(Environment* env,
647647 {
648648 // Make the js_fields_ property accessible to JS land.
649649 Local<ArrayBuffer> ab =
650- ArrayBuffer::New (env->isolate (), js_fields_, kSessionUint8FieldCount );
650+ ArrayBuffer::New (env->isolate (),
651+ reinterpret_cast <uint8_t *>(&js_fields_),
652+ kSessionUint8FieldCount );
651653 Local<Uint8Array> uint8_arr =
652654 Uint8Array::New (ab, 0 , kSessionUint8FieldCount );
653655 USE (wrap->Set (env->context (), env->fields_string (), uint8_arr));
@@ -1046,7 +1048,7 @@ int Http2Session::OnFrameNotSent(nghttp2_session* handle,
10461048 if (error_code == NGHTTP2_ERR_SESSION_CLOSING ||
10471049 error_code == NGHTTP2_ERR_STREAM_CLOSED ||
10481050 error_code == NGHTTP2_ERR_STREAM_CLOSING ||
1049- session->js_fields_ [ kSessionFrameErrorListenerCount ] == 0 ) {
1051+ session->js_fields_ . frame_error_listener_count == 0 ) {
10501052 return 0 ;
10511053 }
10521054
@@ -1349,7 +1351,7 @@ void Http2Session::HandleHeadersFrame(const nghttp2_frame* frame) {
13491351// are considered advisory only, so this has no real effect other than to
13501352// simply let user code know that the priority has changed.
13511353void Http2Session::HandlePriorityFrame (const nghttp2_frame* frame) {
1352- if (js_fields_[ kSessionPriorityListenerCount ] == 0 ) return ;
1354+ if (js_fields_. priority_listener_count == 0 ) return ;
13531355 Isolate* isolate = env ()->isolate ();
13541356 HandleScope scope (isolate);
13551357 Local<Context> context = env ()->context ();
@@ -1418,7 +1420,7 @@ void Http2Session::HandleGoawayFrame(const nghttp2_frame* frame) {
14181420
14191421// Called by OnFrameReceived when a complete ALTSVC frame has been received.
14201422void Http2Session::HandleAltSvcFrame (const nghttp2_frame* frame) {
1421- if (!(js_fields_[ kBitfield ] & (1 << kSessionHasAltsvcListeners ))) return ;
1423+ if (!(js_fields_. bitfield & (1 << kSessionHasAltsvcListeners ))) return ;
14221424 Isolate* isolate = env ()->isolate ();
14231425 HandleScope scope (isolate);
14241426 Local<Context> context = env ()->context ();
@@ -1497,7 +1499,7 @@ void Http2Session::HandlePingFrame(const nghttp2_frame* frame) {
14971499 return ;
14981500 }
14991501
1500- if (!(js_fields_[ kBitfield ] & (1 << kSessionHasPingListeners ))) return ;
1502+ if (!(js_fields_. bitfield & (1 << kSessionHasPingListeners ))) return ;
15011503 // Notify the session that a ping occurred
15021504 arg = Buffer::Copy (env (),
15031505 reinterpret_cast <const char *>(frame->ping .opaque_data ),
@@ -1509,8 +1511,8 @@ void Http2Session::HandlePingFrame(const nghttp2_frame* frame) {
15091511void Http2Session::HandleSettingsFrame (const nghttp2_frame* frame) {
15101512 bool ack = frame->hd .flags & NGHTTP2_FLAG_ACK;
15111513 if (!ack) {
1512- js_fields_[ kBitfield ] &= ~(1 << kSessionRemoteSettingsIsUpToDate );
1513- if (!(js_fields_[ kBitfield ] & (1 << kSessionHasRemoteSettingsListeners )))
1514+ js_fields_. bitfield &= ~(1 << kSessionRemoteSettingsIsUpToDate );
1515+ if (!(js_fields_. bitfield & (1 << kSessionHasRemoteSettingsListeners )))
15141516 return ;
15151517 // This is not a SETTINGS acknowledgement, notify and return
15161518 MakeCallback (env ()->http2session_on_settings_function (), 0 , nullptr );
0 commit comments