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
28 changes: 14 additions & 14 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@
def main(ctx):
return generate(
# Compilers
['gcc >=5.0',
'clang >=3.8',
'msvc >=14.1',
'arm64-gcc latest',
's390x-gcc latest',
'apple-clang *',
'arm64-clang latest',
's390x-clang latest',
# 'x86-msvc latest'
],
[
'gcc >=5.0',
'clang >=3.8',
'msvc >=14.1',
'arm64-gcc latest',
's390x-gcc latest',
# 'freebsd-gcc latest',
'apple-clang *',
'arm64-clang latest',
's390x-clang latest',
# 'x86-msvc latest'
],
# Standards
'>=11',
packages=['zlib1g', 'zlib1g-dev'])


# from https://github.com/boostorg/boost-ci
load("@boost_ci//ci/drone/:functions.star", "linux_cxx", "windows_cxx", "osx_cxx", "freebsd_cxx")
load("@url//:.drone.star", "generate")
# from https://github.com/cppalliance/ci-automation
load("@ci_automation//ci/drone/:functions.star", "linux_cxx", "windows_cxx", "osx_cxx", "freebsd_cxx", "generate")
17 changes: 10 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ jobs:
fail-fast: false
matrix:
include:
# - { name: Windows, os: windows-latest }
- { name: Windows, os: windows-latest }
- { name: Ubuntu, os: ubuntu-latest }
- { name: MacOS, os: macos-latest }
name: Antora Docs (${{ matrix.name }})
Expand Down Expand Up @@ -1153,8 +1153,14 @@ jobs:
with:
branch: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }}
boost-dir: boost-source
scan-modules-dir: http-proto-root
scan-modules-ignore: http_proto
cache: false
modules-exclude-paths: ''
scan-modules-dir: |
http-proto-root
buffers-root
scan-modules-ignore: |
http_proto
buffers

- name: Patch Boost
id: patch
Expand Down Expand Up @@ -1189,9 +1195,6 @@ jobs:
cp -r "$workspace_root"/http-proto-root "libs/$module"
cp -r "$workspace_root"/buffers-root libs/buffers

python3 tools/boostdep/depinst/depinst.py buffers
python3 tools/boostdep/depinst/depinst.py http_proto

- uses: actions/setup-node@v4
with:
node-version: 18
Expand Down Expand Up @@ -1223,4 +1226,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: antora-docs-${{ matrix.name }}
path: doc/build/site
path: boost-root/libs/http_proto/doc/build/site
16 changes: 11 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,24 +133,30 @@ endif ()
#
#-------------------------------------------------
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

file(GLOB_RECURSE BOOST_HTTP_PROTO_HEADERS CONFIGURE_DEPENDS include/boost/*.hpp include/boost/*.natvis)
file(GLOB_RECURSE BOOST_HTTP_PROTO_SOURCES CONFIGURE_DEPENDS src/*.cpp src/*.hpp)
file(GLOB_RECURSE BOOST_HTTP_PROTO_ZLIB_SOURCES CONFIGURE_DEPENDS src_zlib/*.cpp src_zlib/*.hpp)

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include/boost PREFIX "" FILES ${BOOST_HTTP_PROTO_HEADERS})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src PREFIX "http_proto" FILES ${BOOST_HTTP_PROTO_SOURCES})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src_zlib PREFIX "http_proto" FILES ${BOOST_HTTP_PROTO_ZLIB_SOURCES})

add_library(boost_http_proto ${BOOST_HTTP_PROTO_HEADERS} ${BOOST_HTTP_PROTO_SOURCES})
add_library(Boost::http_proto ALIAS boost_http_proto)
target_compile_features(boost_http_proto PUBLIC cxx_constexpr)
target_compile_definitions(boost_http_proto PUBLIC BOOST_HTTP_PROTO_NO_LIB=1)
target_include_directories(boost_http_proto PUBLIC "${PROJECT_SOURCE_DIR}/include")
target_link_libraries(boost_http_proto PUBLIC ${BOOST_HTTP_PROTO_DEPENDENCIES})
target_compile_definitions(boost_http_proto PUBLIC $<IF:$<BOOL:${BUILD_SHARED_LIBS}>,BOOST_HTTP_PROTO_DYN_LINK=1,BOOST_HTTP_PROTO_STATIC_LINK=1>)
target_compile_definitions(boost_http_proto PUBLIC BOOST_HTTP_PROTO_NO_LIB)
target_compile_definitions(boost_http_proto PRIVATE BOOST_HTTP_PROTO_SOURCE)
if (BUILD_SHARED_LIBS)
target_compile_definitions(boost_http_proto PUBLIC BOOST_HTTP_PROTO_DYN_LINK)
else ()
target_compile_definitions(boost_http_proto PUBLIC BOOST_HTTP_PROTO_STATIC_LINK)
endif ()

find_package(ZLIB)

if (ZLIB_FOUND)
file(GLOB_RECURSE BOOST_HTTP_PROTO_ZLIB_SOURCES CONFIGURE_DEPENDS src_zlib/*.cpp src_zlib/*.hpp)
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src_zlib PREFIX "http_proto" FILES ${BOOST_HTTP_PROTO_ZLIB_SOURCES})
add_library(boost_http_proto_zlib ${BOOST_HTTP_PROTO_HEADERS} ${BOOST_HTTP_PROTO_ZLIB_SOURCES})
add_library(Boost::http_proto_zlib ALIAS boost_http_proto_zlib)
target_link_libraries(boost_http_proto_zlib PUBLIC boost_http_proto)
Expand Down
3 changes: 2 additions & 1 deletion include/boost/http_proto/detail/impl/array_of_buffers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef BOOST_HTTP_PROTO_DETAIL_IMPL_ARRAY_OF_BUFFERS_HPP
#define BOOST_HTTP_PROTO_DETAIL_IMPL_ARRAY_OF_BUFFERS_HPP

#include <boost/buffers/sans_prefix.hpp>
#include <boost/http_proto/detail/except.hpp>
#include <boost/assert.hpp>

Expand Down Expand Up @@ -100,7 +101,7 @@ consume(std::size_t n)
{
if(n < p_->size())
{
*p_ += n;
*p_ = buffers::sans_prefix(*p_, n);
return;
}
n -= p_->size();
Expand Down
2 changes: 1 addition & 1 deletion include/boost/http_proto/serializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ class BOOST_SYMBOL_VISIBLE
auto stream = sr.start_stream(req);

std::string_view msg = "Hello, world!";
auto n = buffers::buffer_copy(
auto n = buffers::copy(
stream.prepare(),
buffers::make_buffer(
msg.data(), msg.size()));
Expand Down
3 changes: 2 additions & 1 deletion src/detail/impl/filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
#ifndef BOOST_HTTP_PROTO_DETAIL_IMPL_FILTER_HPP
#define BOOST_HTTP_PROTO_DETAIL_IMPL_FILTER_HPP

#include <boost/buffers/algorithm.hpp>
#include <boost/buffers/range.hpp>
#include <boost/buffers/sans_prefix.hpp>

namespace boost {
namespace http_proto {
Expand Down
1 change: 0 additions & 1 deletion src/file_body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
//

#include <boost/http_proto/file_body.hpp>
#include <boost/buffers/algorithm.hpp>
#include <boost/assert.hpp>

namespace boost {
Expand Down
14 changes: 7 additions & 7 deletions src/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
#include <boost/http_proto/service/zlib_service.hpp>

#include <boost/assert.hpp>
#include <boost/buffers/algorithm.hpp>
#include <boost/buffers/buffer_copy.hpp>
#include <boost/buffers/buffer_size.hpp>
#include <boost/buffers/copy.hpp>
#include <boost/buffers/prefix.hpp>
#include <boost/buffers/size.hpp>
#include <boost/buffers/make_buffer.hpp>
#include <boost/url/grammar/ci_string.hpp>
#include <boost/url/grammar/hexdig_chars.hpp>
Expand Down Expand Up @@ -1205,7 +1205,7 @@
{
case how::in_place:
{
auto copied = buffers::buffer_copy(
auto copied = buffers::copy(
cb1_.prepare(cb1_.capacity()),
chunk);
chunk_remain_ -= copied;
Expand Down Expand Up @@ -1249,7 +1249,7 @@
st_ = state::reset;
return;
}
buffers::buffer_copy(
buffers::copy(

Check warning on line 1252 in src/parser.cpp

View check run for this annotation

Codecov / codecov/patch

src/parser.cpp#L1252

Added line #L1252 was not covered by tests
eb_->prepare(chunk_avail),
chunk);
chunk_remain_ -= chunk_avail;
Expand Down Expand Up @@ -1366,7 +1366,7 @@
}
// only happens when an elastic body
// is attached in header_done state
buffers::buffer_copy(
buffers::copy(
eb_->prepare(payload_avail),
cb0_.data());
cb0_.consume(payload_avail);
Expand Down Expand Up @@ -1436,7 +1436,7 @@
error::buffer_overflow);
return;
}
buffers::buffer_copy(
buffers::copy(
eb_->prepare(body_avail_),
body_buf.data());
body_buf.consume(body_avail_);
Expand Down
38 changes: 19 additions & 19 deletions src/serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

#include "detail/filter.hpp"

#include <boost/buffers/algorithm.hpp>
#include <boost/buffers/buffer_copy.hpp>
#include <boost/buffers/buffer_size.hpp>
#include <boost/buffers/copy.hpp>
#include <boost/buffers/sans_prefix.hpp>
#include <boost/buffers/size.hpp>
#include <boost/core/ignore_unused.hpp>

#include <stddef.h>
Expand Down Expand Up @@ -108,7 +108,7 @@
{
if(bytes < p->size())
{
*p += bytes;
*p = buffers::sans_prefix(*p, bytes);

Check warning on line 111 in src/serializer.cpp

View check run for this annotation

Codecov / codecov/patch

src/serializer.cpp#L111

Added line #L111 was not covered by tests
return;
}
bytes -= p->size();
Expand Down Expand Up @@ -138,22 +138,22 @@
}
buf[16] = '\r';
buf[17] = '\n';
auto n = buffers::buffer_copy(
auto n = buffers::copy(
dest0,
buffers::const_buffer(
buf, sizeof(buf)));
ignore_unused(n);
BOOST_ASSERT(n == 18);
BOOST_ASSERT(
buffers::buffer_size(dest0) == n);
buffers::size(dest0) == n);
}

template<class DynamicBuffer>
void
write_chunk_close(DynamicBuffer& db)
{
db.commit(
buffers::buffer_copy(
buffers::copy(
db.prepare(2),
buffers::const_buffer("\r\n", 2)));
}
Expand All @@ -163,7 +163,7 @@
write_last_chunk(DynamicBuffer& db)
{
db.commit(
buffers::buffer_copy(
buffers::copy(
db.prepare(5),
buffers::const_buffer("0\r\n\r\n", 5)));
}
Expand Down Expand Up @@ -246,7 +246,7 @@

// TODO: This is a temporary solution until we refactor
// the implementation for efficient partial buffer consumption.
if( is_chunked_ && buffers::buffer_size(prepped_) && is_header_done_ )
if( is_chunked_ && buffers::size(prepped_) && is_header_done_ )
return const_buffers_type(
prepped_.data(), prepped_.size());

Expand Down Expand Up @@ -278,7 +278,7 @@
{
if( st_ == style::buffers )
{
if( buffers::buffer_size(buf_) == 0 )
if( buffers::size(buf_) == 0 )
return {};

auto buf = *(buf_.data());
Expand Down Expand Up @@ -322,7 +322,7 @@
if( st_ == style::buffers )
{
buf_.consume(n);
if( buffers::buffer_size(buf_) == 0 )
if( buffers::size(buf_) == 0 )
more_ = false;
}
else
Expand Down Expand Up @@ -404,7 +404,7 @@
auto cbs = const_buffers_type(
prepped_.data(), prepped_.size());

BOOST_ASSERT(buffers::buffer_size(cbs) > 0);
BOOST_ASSERT(buffers::size(cbs) > 0);
return cbs;
}

Expand Down Expand Up @@ -444,7 +444,7 @@
BOOST_ASSERT(st_ != style::empty);
out_->consume(n);
}
auto is_empty = (buffers::buffer_size(prepped_) == 0);
auto is_empty = (buffers::size(prepped_) == 0);

if( st_ == style::buffers && !filter_ && is_empty )
more_ = false;
Expand Down Expand Up @@ -529,9 +529,9 @@
p + chunk_header_len_ + crlf_len_,
last_chunk_len_);

buffers::buffer_copy(
buffers::copy(
chunk_close_, buffers::const_buffer("\r\n", 2));
buffers::buffer_copy(
buffers::copy(
last_chunk_,
buffers::const_buffer("0\r\n\r\n", 5));
}
Expand Down Expand Up @@ -564,7 +564,7 @@

buffers::mutable_buffer dest(
ws_.data(), 5);
buffers::buffer_copy(
buffers::copy(
dest,
buffers::const_buffer(
"0\r\n\r\n", 5));
Expand Down Expand Up @@ -594,13 +594,13 @@

copy(&prepped_[1], buf_.data(), buf_.size());

more_ = (buffers::buffer_size(buf_) > 0);
more_ = (buffers::size(buf_) > 0);
return;
}

if( !filter_ && is_chunked_ )
{
if( buffers::buffer_size(buf_) == 0 )
if( buffers::size(buf_) == 0 )
{
prepped_ = make_array(
1 + // header
Expand All @@ -614,7 +614,7 @@
}

write_chunk_header(
chunk_header_, buffers::buffer_size(buf_));
chunk_header_, buffers::size(buf_));

prepped_ = make_array(
1 + // header
Expand Down
Loading
Loading