Skip to content

Commit

Permalink
src: silence http2 -Wunused-result warnings
Browse files Browse the repository at this point in the history
Backport-PR-URL: #18050
Backport-PR-URL: #20456
PR-URL: #17954
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
cjihrig authored and MylesBorins committed May 2, 2018
1 parent 35ee894 commit 3766e04
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/node_http2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -560,13 +560,13 @@ inline void Http2Stream::EmitStatistics() {
FIXED_ONE_BYTE_STRING(env->isolate(), "timeToFirstByte"),
Number::New(env->isolate(),
(entry->first_byte() - entry->startTimeNano()) / 1e6),
attr);
attr).FromJust();
obj->DefineOwnProperty(
context,
FIXED_ONE_BYTE_STRING(env->isolate(), "timeToFirstHeader"),
Number::New(env->isolate(),
(entry->first_header() - entry->startTimeNano()) / 1e6),
attr);
attr).FromJust();
entry->Notify(obj);
}
delete entry;
Expand All @@ -592,25 +592,29 @@ inline void Http2Session::EmitStatistics() {
String::NewFromUtf8(env->isolate(),
entry->typeName(),
v8::NewStringType::kInternalized)
.ToLocalChecked(), attr);
.ToLocalChecked(), attr).FromJust();
if (entry->ping_rtt() != 0) {
obj->DefineOwnProperty(
context,
FIXED_ONE_BYTE_STRING(env->isolate(), "pingRTT"),
Number::New(env->isolate(), entry->ping_rtt() / 1e6), attr);
Number::New(env->isolate(), entry->ping_rtt() / 1e6),
attr).FromJust();
}
obj->DefineOwnProperty(
context,
FIXED_ONE_BYTE_STRING(env->isolate(), "framesReceived"),
Integer::NewFromUnsigned(env->isolate(), entry->frame_count()), attr);
Integer::NewFromUnsigned(env->isolate(), entry->frame_count()),
attr).FromJust();
obj->DefineOwnProperty(
context,
FIXED_ONE_BYTE_STRING(env->isolate(), "streamCount"),
Integer::New(env->isolate(), entry->stream_count()), attr);
Integer::New(env->isolate(), entry->stream_count()),
attr).FromJust();
obj->DefineOwnProperty(
context,
FIXED_ONE_BYTE_STRING(env->isolate(), "streamAverageDuration"),
Number::New(env->isolate(), entry->stream_average_duration()), attr);
Number::New(env->isolate(), entry->stream_average_duration()),
attr).FromJust();
entry->Notify(obj);
}
delete entry;
Expand Down

0 comments on commit 3766e04

Please sign in to comment.