@@ -647,7 +647,9 @@ Http2Session::Http2Session(Environment* env,
647
647
{
648
648
// Make the js_fields_ property accessible to JS land.
649
649
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 );
651
653
Local<Uint8Array> uint8_arr =
652
654
Uint8Array::New (ab, 0 , kSessionUint8FieldCount );
653
655
USE (wrap->Set (env->context (), env->fields_string (), uint8_arr));
@@ -1046,7 +1048,7 @@ int Http2Session::OnFrameNotSent(nghttp2_session* handle,
1046
1048
if (error_code == NGHTTP2_ERR_SESSION_CLOSING ||
1047
1049
error_code == NGHTTP2_ERR_STREAM_CLOSED ||
1048
1050
error_code == NGHTTP2_ERR_STREAM_CLOSING ||
1049
- session->js_fields_ [ kSessionFrameErrorListenerCount ] == 0 ) {
1051
+ session->js_fields_ . frame_error_listener_count == 0 ) {
1050
1052
return 0 ;
1051
1053
}
1052
1054
@@ -1349,7 +1351,7 @@ void Http2Session::HandleHeadersFrame(const nghttp2_frame* frame) {
1349
1351
// are considered advisory only, so this has no real effect other than to
1350
1352
// simply let user code know that the priority has changed.
1351
1353
void Http2Session::HandlePriorityFrame (const nghttp2_frame* frame) {
1352
- if (js_fields_[ kSessionPriorityListenerCount ] == 0 ) return ;
1354
+ if (js_fields_. priority_listener_count == 0 ) return ;
1353
1355
Isolate* isolate = env ()->isolate ();
1354
1356
HandleScope scope (isolate);
1355
1357
Local<Context> context = env ()->context ();
@@ -1418,7 +1420,7 @@ void Http2Session::HandleGoawayFrame(const nghttp2_frame* frame) {
1418
1420
1419
1421
// Called by OnFrameReceived when a complete ALTSVC frame has been received.
1420
1422
void Http2Session::HandleAltSvcFrame (const nghttp2_frame* frame) {
1421
- if (!(js_fields_[ kBitfield ] & (1 << kSessionHasAltsvcListeners ))) return ;
1423
+ if (!(js_fields_. bitfield & (1 << kSessionHasAltsvcListeners ))) return ;
1422
1424
Isolate* isolate = env ()->isolate ();
1423
1425
HandleScope scope (isolate);
1424
1426
Local<Context> context = env ()->context ();
@@ -1497,7 +1499,7 @@ void Http2Session::HandlePingFrame(const nghttp2_frame* frame) {
1497
1499
return ;
1498
1500
}
1499
1501
1500
- if (!(js_fields_[ kBitfield ] & (1 << kSessionHasPingListeners ))) return ;
1502
+ if (!(js_fields_. bitfield & (1 << kSessionHasPingListeners ))) return ;
1501
1503
// Notify the session that a ping occurred
1502
1504
arg = Buffer::Copy (env (),
1503
1505
reinterpret_cast <const char *>(frame->ping .opaque_data ),
@@ -1509,8 +1511,8 @@ void Http2Session::HandlePingFrame(const nghttp2_frame* frame) {
1509
1511
void Http2Session::HandleSettingsFrame (const nghttp2_frame* frame) {
1510
1512
bool ack = frame->hd .flags & NGHTTP2_FLAG_ACK;
1511
1513
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 )))
1514
1516
return ;
1515
1517
// This is not a SETTINGS acknowledgement, notify and return
1516
1518
MakeCallback (env ()->http2session_on_settings_function (), 0 , nullptr );
0 commit comments