Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2007,10 +2007,9 @@ def configure_library(lib, output, pkgname=None):
output['libraries'] += [pkg_libpath]

default_libs = getattr(options, shared_lib + '_libname')
default_libs = [f'-l{l}' for l in default_libs.split(',')]

if default_libs:
output['libraries'] += default_libs
output['libraries'] += [f'-l{l}' for l in default_libs.split(',')]
elif pkg_libs:
output['libraries'] += pkg_libs.split()

Expand Down
37 changes: 34 additions & 3 deletions deps/googletest/include/gtest/internal/gtest-port.h
Original file line number Diff line number Diff line change
Expand Up @@ -1236,16 +1236,46 @@ class GTEST_API_ [[nodiscard]] AutoHandle {
// Nothing to do here.

#else
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
/* class A needs to have dll-interface to be used by clients of class B */)

// Allows a controller thread to pause execution of newly created
// threads until notified. Instances of this class must be created
// and destroyed in the controller thread.
//
// This class is only for testing Google Test's own constructs. Do not
// use it in user tests, either directly or indirectly.
// TODO(b/203539622): Replace unconditionally with absl::Notification.
#ifdef GTEST_OS_WINDOWS_MINGW
// GCC version < 13 with the win32 thread model does not provide std::mutex and
// std::condition_variable in the <mutex> and <condition_variable> headers. So
// we implement the Notification class using a Windows manual-reset event. See
// https://gcc.gnu.org/gcc-13/changes.html#windows.
class GTEST_API_ [[nodiscard]] Notification {
public:
Notification();
Notification(const Notification&) = delete;
Notification& operator=(const Notification&) = delete;
~Notification();

// Notifies all threads created with this notification to start. Must
// be called from the controller thread.
void Notify();

// Blocks until the controller thread notifies. Must be called from a test
// thread.
void WaitForNotification();

private:
// Assume that Win32 HANDLE type is equivalent to void*. Doing so allows us to
// avoid including <windows.h> in this header file. Including <windows.h> is
// undesirable because it defines a lot of symbols and macros that tend to
// conflict with client code. This assumption is verified by
// WindowsTypesTest.HANDLEIsVoidStar.
typedef void* Handle;
Handle event_;
};
#else
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
/* class A needs to have dll-interface to be used by clients of class B */)

class GTEST_API_ [[nodiscard]] Notification {
public:
Notification() : notified_(false) {}
Expand Down Expand Up @@ -1273,6 +1303,7 @@ class GTEST_API_ [[nodiscard]] Notification {
bool notified_;
};
GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
#endif // GTEST_OS_WINDOWS_MINGW
#endif // GTEST_HAS_NOTIFICATION_

// On MinGW, we can have both GTEST_OS_WINDOWS and GTEST_HAS_PTHREAD
Expand Down
16 changes: 16 additions & 0 deletions deps/googletest/src/gtest-port.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,22 @@ bool AutoHandle::IsCloseable() const {
return handle_ != nullptr && handle_ != INVALID_HANDLE_VALUE;
}

#if !GTEST_HAS_NOTIFICATION_ && defined(GTEST_OS_WINDOWS_MINGW)
Notification::Notification() {
// Create a manual-reset event object.
event_ = ::CreateEvent(nullptr, TRUE, FALSE, nullptr);
GTEST_CHECK_(event_ != nullptr);
}

Notification::~Notification() { ::CloseHandle(event_); }

void Notification::Notify() { GTEST_CHECK_(::SetEvent(event_)); }

void Notification::WaitForNotification() {
GTEST_CHECK_(::WaitForSingleObject(event_, INFINITE) == WAIT_OBJECT_0);
}
#endif // !GTEST_HAS_NOTIFICATION_ && defined(GTEST_OS_WINDOWS_MINGW)

Mutex::Mutex()
: owner_thread_id_(0),
type_(kDynamic),
Expand Down
4 changes: 4 additions & 0 deletions deps/ncrypto/ncrypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,9 @@ class EVPKeyPointer final {
DER,
PEM,
JWK,
RAW_PUBLIC,
RAW_PRIVATE,
RAW_SEED,
};

enum class PKParseError { NOT_RECOGNIZED, NEED_PASSPHRASE, FAILED };
Expand All @@ -867,6 +870,7 @@ class EVPKeyPointer final {
bool output_key_object = false;
PKFormatType format = PKFormatType::DER;
PKEncodingType type = PKEncodingType::PKCS8;
int ec_point_form = POINT_CONVERSION_UNCOMPRESSED;
AsymmetricKeyEncodingConfig() = default;
AsymmetricKeyEncodingConfig(bool output_key_object,
PKFormatType format,
Expand Down
10 changes: 5 additions & 5 deletions deps/ngtcp2/ngtcp2/examples/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1049,17 +1049,16 @@ ngtcp2_ssize write_pkt(ngtcp2_conn *conn, ngtcp2_path *path,
ngtcp2_ssize Client::write_pkt(ngtcp2_path *path, ngtcp2_pkt_info *pi,
uint8_t *dest, size_t destlen,
ngtcp2_tstamp ts) {
std::array<SharedVec, 16> vec;
std::array<nghttp3_vec, 16> vec;

for (;;) {
int64_t stream_id = -1;
int fin = 0;
nghttp3_ssize sveccnt = 0;

if (httpconn_ && ngtcp2_conn_get_max_data_left(conn_)) {
sveccnt = nghttp3_conn_writev_stream(
httpconn_, &stream_id, &fin,
reinterpret_cast<nghttp3_vec *>(vec.data()), vec.size());
sveccnt = nghttp3_conn_writev_stream(httpconn_, &stream_id, &fin,
vec.data(), vec.size());
if (sveccnt < 0) {
std::cerr << "nghttp3_conn_writev_stream: "
<< nghttp3_strerror(static_cast<int>(sveccnt)) << std::endl;
Expand All @@ -1072,6 +1071,7 @@ ngtcp2_ssize Client::write_pkt(ngtcp2_path *path, ngtcp2_pkt_info *pi,
}

ngtcp2_ssize ndatalen;
auto v = vec.data();
auto vcnt = static_cast<size_t>(sveccnt);

uint32_t flags = NGTCP2_WRITE_STREAM_FLAG_MORE;
Expand All @@ -1081,7 +1081,7 @@ ngtcp2_ssize Client::write_pkt(ngtcp2_path *path, ngtcp2_pkt_info *pi,

auto nwrite = ngtcp2_conn_writev_stream(
conn_, path, pi, dest, destlen, &ndatalen, flags, stream_id,
reinterpret_cast<const ngtcp2_vec *>(vec.data()), vcnt, ts);
reinterpret_cast<const ngtcp2_vec *>(v), vcnt, ts);
if (nwrite < 0) {
switch (nwrite) {
case NGTCP2_ERR_STREAM_DATA_BLOCKED:
Expand Down
10 changes: 5 additions & 5 deletions deps/ngtcp2/ngtcp2/examples/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1652,17 +1652,16 @@ ngtcp2_ssize write_pkt(ngtcp2_conn *conn, ngtcp2_path *path,
ngtcp2_ssize Handler::write_pkt(ngtcp2_path *path, ngtcp2_pkt_info *pi,
uint8_t *dest, size_t destlen,
ngtcp2_tstamp ts) {
std::array<SharedVec, 16> vec;
std::array<nghttp3_vec, 16> vec;

for (;;) {
int64_t stream_id = -1;
int fin = 0;
nghttp3_ssize sveccnt = 0;

if (httpconn_ && ngtcp2_conn_get_max_data_left(conn_)) {
sveccnt = nghttp3_conn_writev_stream(
httpconn_, &stream_id, &fin,
reinterpret_cast<nghttp3_vec *>(vec.data()), vec.size());
sveccnt = nghttp3_conn_writev_stream(httpconn_, &stream_id, &fin,
vec.data(), vec.size());
if (sveccnt < 0) {
std::cerr << "nghttp3_conn_writev_stream: "
<< nghttp3_strerror(static_cast<int>(sveccnt)) << std::endl;
Expand All @@ -1675,6 +1674,7 @@ ngtcp2_ssize Handler::write_pkt(ngtcp2_path *path, ngtcp2_pkt_info *pi,
}

ngtcp2_ssize ndatalen;
auto v = vec.data();
auto vcnt = static_cast<size_t>(sveccnt);

uint32_t flags =
Expand All @@ -1685,7 +1685,7 @@ ngtcp2_ssize Handler::write_pkt(ngtcp2_path *path, ngtcp2_pkt_info *pi,

auto nwrite = ngtcp2_conn_writev_stream(
conn_, path, pi, dest, destlen, &ndatalen, flags, stream_id,
reinterpret_cast<const ngtcp2_vec *>(vec.data()), vcnt, ts);
reinterpret_cast<const ngtcp2_vec *>(v), vcnt, ts);
if (nwrite < 0) {
switch (nwrite) {
case NGTCP2_ERR_STREAM_DATA_BLOCKED:
Expand Down
6 changes: 0 additions & 6 deletions deps/ngtcp2/ngtcp2/examples/shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <span>

#include <ngtcp2/ngtcp2.h>
#include <nghttp3/nghttp3.h>

#include "network.h"

Expand Down Expand Up @@ -64,11 +63,6 @@ inline constexpr uint32_t TLS_ALERT_ECH_REQUIRED = 121;

inline constexpr size_t MAX_RECV_PKTS = 64;

union SharedVec {
ngtcp2_vec v2;
nghttp3_vec v3;
};

// msghdr_get_ecn gets ECN bits from |msg|. |family| is the address
// family from which packet is received.
uint8_t msghdr_get_ecn(msghdr *msg, int family);
Expand Down
6 changes: 3 additions & 3 deletions deps/ngtcp2/ngtcp2/lib/includes/ngtcp2/ngtcp2.h
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,7 @@ typedef struct ngtcp2_sockaddr_in {
} ngtcp2_sockaddr_in;

typedef struct ngtcp2_in6_addr {
uint8_t in6_addr[16];
uint8_t s6_addr[16];
} ngtcp2_in6_addr;

typedef struct ngtcp2_sockaddr_in6 {
Expand Down Expand Up @@ -1866,8 +1866,8 @@ typedef struct ngtcp2_settings {
uint64_t max_stream_window;
/**
* :member:`ack_thresh` is the minimum number of the received ACK
* eliciting packets that trigger the immediate acknowledgement from
* the local endpoint.
* eliciting packets that triggers the immediate acknowledgement
* from the local endpoint.
*/
size_t ack_thresh;
/**
Expand Down
4 changes: 2 additions & 2 deletions deps/ngtcp2/ngtcp2/lib/includes/ngtcp2/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*
* Version number of the ngtcp2 library release.
*/
#define NGTCP2_VERSION "1.20.0"
#define NGTCP2_VERSION "1.21.0"

/**
* @macro
Expand All @@ -46,6 +46,6 @@
* number, 8 bits for minor and 8 bits for patch. Version 1.2.3
* becomes 0x010203.
*/
#define NGTCP2_VERSION_NUM 0x011400
#define NGTCP2_VERSION_NUM 0x011500

#endif /* !defined(NGTCP2_VERSION_H) */
Loading
Loading