Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
quic: address build issues on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Dec 4, 2019
1 parent 04dd27d commit 85c628c
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/node_quic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "node_quic_stream.h"
#include "node_quic_state.h"
#include "node_quic_util-inl.h"
#include "node_sockaddr-inl.h"

#include <memory>
#include <utility>
Expand Down
1 change: 1 addition & 0 deletions src/node_quic_default_application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "node_quic_session-inl.h"
#include "node_quic_stream.h"
#include "node_quic_util-inl.h"
#include "node_sockaddr-inl.h"
#include <ngtcp2/ngtcp2.h>

namespace node {
Expand Down
5 changes: 4 additions & 1 deletion src/node_quic_http3_application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "node_quic_session-inl.h"
#include "node_quic_stream.h"
#include "node_quic_util-inl.h"
#include "node_sockaddr-inl.h"
#include "node_http_common-inl.h"

#include <nghttp3/nghttp3.h>
Expand Down Expand Up @@ -536,7 +537,9 @@ ssize_t Http3Application::H3ReadData(
// available to send but there might be later, so return WOULDBLOCK
// to tell nghttp3 to hold off attempting to serialize any more
// data for this stream until it is resumed.
return count == 0 ? NGHTTP3_ERR_WOULDBLOCK : count;
if (count == 0)
return NGHTTP3_ERR_WOULDBLOCK;
return count;
}

// Outgoing data is retained in memory until it is acknowledged.
Expand Down
1 change: 1 addition & 0 deletions src/node_quic_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "node_quic_stream.h"
#include "node_quic_socket.h"
#include "node_quic_util-inl.h"
#include "node_sockaddr-inl.h"
#include "v8.h"
#include "uv.h"

Expand Down
16 changes: 9 additions & 7 deletions src/node_quic_util-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,15 @@ QuicError::QuicError(
break;
case QUIC_ERROR_APPLICATION:
code = code_;
break;
default:
UNREACHABLE();
}
}

QuicError::QuicError(ngtcp2_connection_close_error_code ccec) :
code(ccec.error_code), family(QUIC_ERROR_SESSION) {
family(QUIC_ERROR_SESSION),
code(ccec.error_code) {
switch (ccec.type) {
case NGTCP2_CONNECTION_CLOSE_ERROR_CODE_TYPE_APPLICATION:
family = QUIC_ERROR_APPLICATION;
Expand All @@ -201,12 +203,12 @@ QuicError::QuicError(ngtcp2_connection_close_error_code ccec) :
}

QuicError::QuicError(
Environment* env,
v8::Local<v8::Value> codeArg,
v8::Local<v8::Value> familyArg,
int32_t family_) :
code(NGTCP2_NO_ERROR),
family(family_) {
Environment* env,
v8::Local<v8::Value> codeArg,
v8::Local<v8::Value> familyArg,
int32_t family_) :
family(family_),
code(NGTCP2_NO_ERROR) {
if (codeArg->IsBigInt()) {
code = codeArg.As<v8::BigInt>()->Int64Value();
} else if (codeArg->IsNumber()) {
Expand Down
3 changes: 2 additions & 1 deletion src/node_sockaddr-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ SocketAddress& SocketAddress::operator=(const sockaddr* addr) {

SocketAddress& SocketAddress::operator=(const SocketAddress& addr) {
memcpy(&address_, &addr.address_, addr.GetLength());
return *this;
}

const sockaddr* SocketAddress::operator*() const {
Expand Down Expand Up @@ -166,7 +167,7 @@ void SocketAddress::Update(uint8_t* data, size_t len) {
}

template <typename T, typename F>
static SocketAddress* SocketAddress::FromUVHandle(
SocketAddress* SocketAddress::FromUVHandle(
F fn,
T* handle,
SocketAddress* addr) {
Expand Down
2 changes: 2 additions & 0 deletions test/cctest/test_quic_verifyhostnameidentity.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

#include "base_object-inl.h"
#include "node_quic_crypto.h"
#include "node_quic_util-inl.h"
#include "node_sockaddr-inl.h"
#include "util.h"
#include "gtest/gtest.h"

Expand Down

0 comments on commit 85c628c

Please sign in to comment.