Skip to content

Commit

Permalink
Update yasio to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Feb 1, 2024
1 parent 41e68fe commit b6cd3e5
Show file tree
Hide file tree
Showing 61 changed files with 224 additions and 215 deletions.
2 changes: 1 addition & 1 deletion thirdparty/yasio/bindings/lyasio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//////////////////////////////////////////////////////////////////////////////////////////
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/bindings/lyasio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/bindings/yasio_axlua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/bindings/yasio_axlua.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/bindings/yasio_ni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/bindings/yasio_sol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//////////////////////////////////////////////////////////////////////////////////////////
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/buffer_alloc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/byte_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/compiler/feature_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 4 additions & 7 deletions thirdparty/yasio/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -33,7 +33,7 @@ SOFTWARE.
** Uncomment or add compiler flag -DYASIO_HEADER_ONLY to enable yasio core implementation header
** only
*/
#define YASIO_HEADER_ONLY 1
// #define YASIO_HEADER_ONLY 1

/*
** Uncomment or add compiler flag -DYASIO_VERBOSE_LOG to enable verbose log
Expand Down Expand Up @@ -74,7 +74,7 @@ SOFTWARE.
** 1. -DYASIO_SSL_BACKEND=1: OpenSSL
** 2. -DYASIO_SSL_BACKEND=2: mbedtls
*/
#define YASIO_SSL_BACKEND 1
// #define YASIO_SSL_BACKEND 1

/*
** Uncomment or add compiler flag -DYASIO_DISABLE_CONCURRENT_SINGLETON to disable concurrent
Expand Down Expand Up @@ -205,7 +205,7 @@ SOFTWARE.
/*
** The yasio version macros
*/
#define YASIO_VERSION_NUM 0x040104
#define YASIO_VERSION_NUM 0x050000

/*
** The macros used by io_service.
Expand All @@ -216,9 +216,6 @@ SOFTWARE.
// The default ttl of multicast
#define YASIO_DEFAULT_MULTICAST_TTL (int)128

// The max internet buffer size
#define YASIO_INET_BUFFER_SIZE 65536

// The max pdu buffer length, avoid large memory allocation when application decode a huge length.
#define YASIO_MAX_PDU_BUFFER_SIZE static_cast<int>(1 * 1024 * 1024)

Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/endian_portable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/errc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/ibstream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/impl/ares.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/impl/concurrent_queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/impl/epoll_io_watcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// client application.
//////////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2012-2023 HALX99 (halx99 at live dot com)
// Copyright (c) 2012-2024 HALX99 (halx99 at live dot com)
#ifndef YASIO__EPOLL_IO_WATCHER_HPP
#define YASIO__EPOLL_IO_WATCHER_HPP
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/impl/eventfd_select_interrupter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// client application.
//////////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2012-2023 HALX99 (halx99 at live dot com)
// Copyright (c) 2012-2024 HALX99 (halx99 at live dot com)
// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Roelof Naude (roelof.naude at gmail dot com)
//
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/impl/evport_io_watcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// client application.
//////////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2012-2023 HALX99 (halx99 at live dot com)
// Copyright (c) 2012-2024 HALX99 (halx99 at live dot com)
#ifndef YASIO__EVPORT_IO_WATCHER_HPP
#define YASIO__EVPORT_IO_WATCHER_HPP
#include <chrono>
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/impl/fp16.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/impl/ifaddrs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/impl/inet_ntop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/impl/kqueue_io_watcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// client application.
//////////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2012-2023 HALX99 (halx99 at live dot com)
// Copyright (c) 2012-2024 HALX99 (halx99 at live dot com)
#ifndef YASIO__KQUEUE_IO_WATCHER_HPP
#define YASIO__KQUEUE_IO_WATCHER_HPP
#include <sys/types.h>
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/impl/mbedtls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/impl/object_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
17 changes: 15 additions & 2 deletions thirdparty/yasio/impl/openssl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -49,7 +49,7 @@ YASIO__DECL yssl_ctx_st* yssl_ctx_new(const yssl_options& opts)
{
int fail_count = -1;
if (yasio__valid_str(opts.crtfile_))
{
{ // CAfile for verify
fail_count = 0;
yssl_splitpath(opts.crtfile_, [&](char* first, char* last) {
yssl_split_term null_term(last);
Expand All @@ -69,6 +69,11 @@ YASIO__DECL yssl_ctx_st* yssl_ctx_new(const yssl_options& opts)
return !ok;
});
}
/*
* client cert & key not implement yet, since it not common usecase
* SSL_CTX_use_certificate_chain_file
* SSL_CTX_use_PrivateKey_file
*/
if (!fail_count)
{
::SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, ::SSL_CTX_get_verify_callback(ctx));
Expand All @@ -93,6 +98,14 @@ YASIO__DECL yssl_ctx_st* yssl_ctx_new(const yssl_options& opts)

if (yasio__valid_str(opts.keyfile_) && ::SSL_CTX_use_PrivateKey_file(ctx, opts.keyfile_, SSL_FILETYPE_PEM) <= 0)
YASIO_LOG("[gobal] load server private key file failed!");

/*
* If client provide cert, then verify, otherwise skip verify
* Note: if SSL_VERIFY_FAIL_IF_NO_PEER_CERT specified, client must provide
* cert & key which is not common use, means 100% online servers doesn't require
* client to provide cert
*/
::SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, ::SSL_CTX_get_verify_callback(ctx));
}

return ctx;
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/impl/pipe_select_interrupter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//////////////////////////////////////////////////////////////////////////////////////////
//
//
// Copyright (c) 2012-2023 HALX99 (halx99 at live dot com)
// Copyright (c) 2012-2024 HALX99 (halx99 at live dot com)
// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Roelof Naude (roelof.naude at gmail dot com)
//
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/impl/poll_io_watcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// client application.
//////////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2012-2023 HALX99 (halx99 at live dot com)
// Copyright (c) 2012-2024 HALX99 (halx99 at live dot com)
#ifndef YASIO__POLL_IO_WATCHER_HPP
#define YASIO__POLL_IO_WATCHER_HPP
#include "yasio/pod_vector.hpp"
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/impl/select_interrupter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// client application.
//////////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2012-2023 HALX99 (halx99 at live dot com)
// Copyright (c) 2012-2024 HALX99 (halx99 at live dot com)
// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/impl/select_io_watcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// client application.
//////////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2012-2023 HALX99 (halx99 at live dot com)
// Copyright (c) 2012-2024 HALX99 (halx99 at live dot com)
#ifndef YASIO__SELECT_IO_WATCHER_HPP
#define YASIO__SELECT_IO_WATCHER_HPP
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/impl/socket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/*
The MIT License (MIT)
Copyright (c) 2012-2023 HALX99
Copyright (c) 2012-2024 HALX99
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/yasio/impl/socket_select_interrupter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//////////////////////////////////////////////////////////////////////////////////////////
//
//
// Copyright (c) 2012-2023 HALX99 (halx99 at live dot com)
// Copyright (c) 2012-2024 HALX99 (halx99 at live dot com)
// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
// Copyright (c) 2008 Roelof Naude (roelof.naude at gmail dot com)
//
Expand Down
Loading

0 comments on commit b6cd3e5

Please sign in to comment.