diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35184112..48b506f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # -# Official repository: https://github.com/CPPAlliance/http_proto/ +# Official repository: https://github.com/CPPAlliance/http/ # name: CI @@ -858,10 +858,10 @@ jobs: tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217 ldd /__e/node20/bin/node - - name: Clone Boost.HTTP.Proto + - name: Clone Boost.HTTP uses: actions/checkout@v3 with: - path: http-proto-root + path: http-root - name: Clone Boost.Buffers uses: actions/checkout@v3 @@ -904,11 +904,11 @@ jobs: boost-dir: boost-source modules-exclude-paths: '' scan-modules-dir: | - http-proto-root + http-root buffers-root capy-root scan-modules-ignore: | - http_proto + http buffers capy @@ -978,7 +978,7 @@ jobs: echo -E "boost_root=$boost_root" >> $GITHUB_OUTPUT # Patch boost-root with workspace module - cp -r "$workspace_root"/http-proto-root "libs/$module" + cp -r "$workspace_root"/http-root "libs/$module" cp -r "$workspace_root"/buffers-root libs/buffers cp -r "$workspace_root"/capy-root libs/capy @@ -989,7 +989,7 @@ jobs: ASAN_OPTIONS: ${{ ((matrix.compiler == 'apple-clang' || matrix.compiler == 'clang') && 'detect_invalid_pointer_pairs=0:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1') || 'detect_invalid_pointer_pairs=2:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1' }} with: source-dir: boost-root - modules: http_proto + modules: http toolset: ${{ matrix.b2-toolset }} build-variant: ${{ matrix.build-type }} cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx || '' }} @@ -1029,7 +1029,7 @@ jobs: export-compile-commands: ${{ matrix.time-trace }} package: false package-artifact: false - ref-source-dir: boost-root/libs/http_proto + ref-source-dir: boost-root/libs/http toolchain: ${{ (startsWith(matrix.runs-on, 'windows') && steps.patch-user-config.outputs.toolchain) || '' }} - name: Set Path @@ -1061,7 +1061,7 @@ jobs: # extra-args: | # -D BOOST_CI_INSTALL_TEST=ON # -D CMAKE_PREFIX_PATH=${{ steps.patch.outputs.workspace_root }}/.local -# ref-source-dir: boost-root/libs/http_proto +# ref-source-dir: boost-root/libs/http # trace-commands: true # toolchain: ${{ (startsWith(matrix.runs-on, 'windows') && steps.patch-user-config.outputs.toolchain) || '' }} @@ -1083,7 +1083,7 @@ jobs: # install: false # cmake-version: '>=3.20' # extra-args: -D BOOST_CI_INSTALL_TEST=OFF -# ref-source-dir: boost-root/libs/http_proto/test/cmake_test +# ref-source-dir: boost-root/libs/http/test/cmake_test # toolchain: ${{ (startsWith(matrix.runs-on, 'windows') && steps.patch-user-config.outputs.toolchain) || '' }} - name: Root Project CMake Workflow @@ -1114,7 +1114,7 @@ jobs: uses: alandefreitas/cpp-actions/flamegraph@v1.9.0 if: matrix.time-trace with: - source-dir: boost-root/libs/http_proto + source-dir: boost-root/libs/http build-dir: boost-root/__build_cmake_test__ github_token: ${{ secrets.GITHUB_TOKEN }} @@ -1157,7 +1157,7 @@ jobs: timeout-minutes: 120 steps: - - name: Clone Boost.HTTProto + - name: Clone Boost.HTTP uses: actions/checkout@v3 with: # Avoid the common API rate limit exceeded error in boostorg by including 100 latest commits in any case @@ -1191,10 +1191,10 @@ jobs: with: apt-get: git cmake - - name: Clone Boost.Http.Proto + - name: Clone Boost.HTTP uses: actions/checkout@v3 with: - path: http-proto-root + path: http-root - name: Clone Boost.Buffers uses: actions/checkout@v3 @@ -1218,11 +1218,11 @@ jobs: boost-dir: boost-source modules-exclude-paths: '' scan-modules-dir: | - http-proto-root + http-root buffers-root capy-root scan-modules-ignore: | - http_proto + http buffers capy @@ -1256,7 +1256,7 @@ jobs: echo -E "boost_root=$boost_root" >> $GITHUB_OUTPUT # Patch boost-root with workspace module - cp -r "$workspace_root"/http-proto-root "libs/$module" + cp -r "$workspace_root"/http-root "libs/$module" cp -r "$workspace_root"/buffers-root libs/buffers cp -r "$workspace_root"/capy-root libs/capy @@ -1276,7 +1276,7 @@ jobs: BOOST_SRC_DIR="$(pwd)/boost-root" export BOOST_SRC_DIR - cd boost-root/libs/http_proto + cd boost-root/libs/http cd doc bash ./build_antora.sh @@ -1291,4 +1291,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: antora-docs-${{ matrix.name }} - path: boost-root/libs/http_proto/doc/build/site + path: boost-root/libs/http/doc/build/site diff --git a/CLAUDE.md b/CLAUDE.md index 3057a717..9c7d844e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -67,7 +67,7 @@ T default_value(); ## Structure * Boost.Beast2 refers to both the library which uses Boost.Asio and the collection of - libraries which includes Boost.Capy, Boost.Buffers, Boost.Http (http-proto), and Boost.Beast2 + libraries which includes Boost.Capy, Boost.Buffers, Boost.Http (http), and Boost.Beast2 * Boost.Capy contains general purpose data structures and algorithms diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ce646aa..f1961cf7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # -# Official repository: https://github.com/cppalliance/http_proto +# Official repository: https://github.com/cppalliance/http # #------------------------------------------------- @@ -16,14 +16,14 @@ # #------------------------------------------------- cmake_minimum_required(VERSION 3.8...3.20) -set(BOOST_HTTP_PROTO_VERSION 1) +set(BOOST_HTTP_VERSION 1) if (BOOST_SUPERPROJECT_VERSION) - set(BOOST_HTTP_PROTO_VERSION ${BOOST_SUPERPROJECT_VERSION}) + set(BOOST_HTTP_VERSION ${BOOST_SUPERPROJECT_VERSION}) endif () -project(boost_http_proto VERSION "${BOOST_HTTP_PROTO_VERSION}" LANGUAGES CXX) -set(BOOST_HTTP_PROTO_IS_ROOT OFF) +project(boost_http VERSION "${BOOST_HTTP_VERSION}" LANGUAGES CXX) +set(BOOST_HTTP_IS_ROOT OFF) if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - set(BOOST_HTTP_PROTO_IS_ROOT ON) + set(BOOST_HTTP_IS_ROOT ON) endif () set(__ignore__ ${CMAKE_C_COMPILER}) @@ -32,12 +32,12 @@ set(__ignore__ ${CMAKE_C_COMPILER}) # Options # #------------------------------------------------- -if (BOOST_HTTP_PROTO_IS_ROOT) +if (BOOST_HTTP_IS_ROOT) include(CTest) endif () -option(BOOST_HTTP_PROTO_BUILD_TESTS "Build boost::http_proto tests" ${BUILD_TESTING}) -option(BOOST_HTTP_PROTO_BUILD_EXAMPLES "Build boost::http_proto examples" ${BOOST_HTTP_PROTO_IS_ROOT}) -option(BOOST_HTTP_PROTO_MRDOCS_BUILD "Build the target for MrDocs: see mrdocs.yml" OFF) +option(BOOST_HTTP_BUILD_TESTS "Build boost::http tests" ${BUILD_TESTING}) +option(BOOST_HTTP_BUILD_EXAMPLES "Build boost::http examples" ${BOOST_HTTP_IS_ROOT}) +option(BOOST_HTTP_MRDOCS_BUILD "Build the target for MrDocs: see mrdocs.yml" OFF) # Check if environment variable BOOST_SRC_DIR is set if (NOT DEFINED BOOST_SRC_DIR AND DEFINED ENV{BOOST_SRC_DIR}) @@ -53,7 +53,7 @@ set(BOOST_SRC_DIR ${DEFAULT_BOOST_SRC_DIR} CACHE STRING "Boost source dir to use # #------------------------------------------------- # The boost super-project requires one explicit dependency per-line. -set(BOOST_HTTP_PROTO_DEPENDENCIES +set(BOOST_HTTP_DEPENDENCIES Boost::assert Boost::buffers Boost::capy @@ -66,33 +66,32 @@ set(BOOST_HTTP_PROTO_DEPENDENCIES Boost::throw_exception Boost::type_traits Boost::url - Boost::winapi - ) + Boost::winapi) -foreach (BOOST_HTTP_PROTO_DEPENDENCY ${BOOST_HTTP_PROTO_DEPENDENCIES}) - if (BOOST_HTTP_PROTO_DEPENDENCY MATCHES "^[ ]*Boost::([A-Za-z0-9_]+)[ ]*$") - list(APPEND BOOST_HTTP_PROTO_INCLUDE_LIBRARIES ${CMAKE_MATCH_1}) +foreach (BOOST_HTTP_DEPENDENCY ${BOOST_HTTP_DEPENDENCIES}) + if (BOOST_HTTP_DEPENDENCY MATCHES "^[ ]*Boost::([A-Za-z0-9_]+)[ ]*$") + list(APPEND BOOST_HTTP_INCLUDE_LIBRARIES ${CMAKE_MATCH_1}) endif () endforeach () # Conditional dependencies if (NOT BOOST_URL_MRDOCS_BUILD) - if (BOOST_HTTP_PROTO_BUILD_TESTS) - set(BOOST_HTTP_PROTO_UNIT_TEST_LIBRARIES filesystem) + if (BOOST_HTTP_BUILD_TESTS) + set(BOOST_HTTP_UNIT_TEST_LIBRARIES filesystem) endif () - if (BOOST_HTTP_PROTO_BUILD_EXAMPLES) - # set(BOOST_HTTP_PROTO_EXAMPLE_LIBRARIES json) + if (BOOST_HTTP_BUILD_EXAMPLES) + # set(BOOST_HTTP_EXAMPLE_LIBRARIES json) endif () endif () # Complete dependency list -set(BOOST_INCLUDE_LIBRARIES ${BOOST_HTTP_PROTO_INCLUDE_LIBRARIES} ${BOOST_HTTP_PROTO_UNIT_TEST_LIBRARIES} ${BOOST_HTTP_PROTO_EXAMPLE_LIBRARIES}) -set(BOOST_EXCLUDE_LIBRARIES http_proto) +set(BOOST_INCLUDE_LIBRARIES ${BOOST_HTTP_INCLUDE_LIBRARIES} ${BOOST_HTTP_UNIT_TEST_LIBRARIES} ${BOOST_HTTP_EXAMPLE_LIBRARIES}) +set(BOOST_EXCLUDE_LIBRARIES http) #------------------------------------------------- # # Add Boost Subdirectory # #------------------------------------------------- -if (BOOST_HTTP_PROTO_IS_ROOT) +if (BOOST_HTTP_IS_ROOT) set(CMAKE_FOLDER Dependencies) # Find absolute BOOST_SRC_DIR if (NOT IS_ABSOLUTE ${BOOST_SRC_DIR}) @@ -140,46 +139,46 @@ 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_HEADERS CONFIGURE_DEPENDS include/boost/*.hpp include/boost/*.natvis) +file(GLOB_RECURSE BOOST_HTTP_SOURCES CONFIGURE_DEPENDS src/*.cpp src/*.hpp) -source_group("" FILES "include/boost/http_proto.hpp" "build/Jamfile") -source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include/boost/http_proto PREFIX "include" FILES ${BOOST_HTTP_PROTO_HEADERS}) -source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src PREFIX "src" FILES ${BOOST_HTTP_PROTO_SOURCES}) +source_group("" FILES "include/boost/http.hpp" "build/Jamfile") +source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include/boost/http PREFIX "include" FILES ${BOOST_HTTP_HEADERS}) +source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src PREFIX "src" FILES ${BOOST_HTTP_SOURCES}) -function(boost_http_proto_setup_properties target) +function(boost_http_setup_properties target) target_compile_features(${target} PUBLIC cxx_constexpr) target_include_directories(${target} PUBLIC "${PROJECT_SOURCE_DIR}/include") target_include_directories(${target} PRIVATE "${PROJECT_SOURCE_DIR}") - target_link_libraries(${target} PUBLIC ${BOOST_HTTP_PROTO_DEPENDENCIES}) - target_compile_definitions(${target} PUBLIC BOOST_HTTP_PROTO_NO_LIB) - target_compile_definitions(${target} PRIVATE BOOST_HTTP_PROTO_SOURCE) + target_link_libraries(${target} PUBLIC ${BOOST_HTTP_DEPENDENCIES}) + target_compile_definitions(${target} PUBLIC BOOST_HTTP_NO_LIB) + target_compile_definitions(${target} PRIVATE BOOST_HTTP_SOURCE) if (BUILD_SHARED_LIBS) - target_compile_definitions(${target} PUBLIC BOOST_HTTP_PROTO_DYN_LINK) + target_compile_definitions(${target} PUBLIC BOOST_HTTP_DYN_LINK) else () - target_compile_definitions(${target} PUBLIC BOOST_HTTP_PROTO_STATIC_LINK) + target_compile_definitions(${target} PUBLIC BOOST_HTTP_STATIC_LINK) endif () endfunction() -if (BOOST_HTTP_PROTO_MRDOCS_BUILD) - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp" "#include \n") - add_library(boost_http_proto_mrdocs "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp") - boost_http_proto_setup_properties(boost_http_proto_mrdocs) - target_compile_definitions(boost_http_proto_mrdocs PUBLIC BOOST_HTTP_PROTO_MRDOCS) - set_target_properties(boost_http_proto_mrdocs PROPERTIES EXPORT_COMPILE_COMMANDS ON) +if (BOOST_HTTP_MRDOCS_BUILD) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp" "#include \n") + add_library(boost_http_mrdocs "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp") + boost_http_setup_properties(boost_http_mrdocs) + target_compile_definitions(boost_http_mrdocs PUBLIC BOOST_HTTP_MRDOCS) + set_target_properties(boost_http_mrdocs PROPERTIES EXPORT_COMPILE_COMMANDS ON) return() endif () -add_library(boost_http_proto include/boost/http_proto.hpp build/Jamfile ${BOOST_HTTP_PROTO_HEADERS} ${BOOST_HTTP_PROTO_SOURCES}) -add_library(Boost::http_proto ALIAS boost_http_proto) -boost_http_proto_setup_properties(boost_http_proto) +add_library(boost_http include/boost/http.hpp build/Jamfile ${BOOST_HTTP_HEADERS} ${BOOST_HTTP_SOURCES}) +add_library(Boost::http ALIAS boost_http) +boost_http_setup_properties(boost_http) #------------------------------------------------- # # Tests # #------------------------------------------------- -if (BOOST_HTTP_PROTO_BUILD_TESTS) +if (BOOST_HTTP_BUILD_TESTS) add_subdirectory(test) endif () @@ -188,6 +187,6 @@ endif () # Examples # #------------------------------------------------- -if (BOOST_HTTP_PROTO_BUILD_EXAMPLES) +if (BOOST_HTTP_BUILD_EXAMPLES) # add_subdirectory(example) endif () diff --git a/README.adoc b/README.adoc index aa15b77a..18494428 100644 --- a/README.adoc +++ b/README.adoc @@ -1,44 +1,44 @@ -http://master.http-proto.cpp.al/[image:doc/modules/ROOT/images/repo-logo.png[Boost.Http.Proto]] +http://master.http.cpp.al/[image:doc/modules/ROOT/images/repo-logo.png[Boost.HTTP]] [width="100%",cols="7%,66%,27%",options="header",] |=== |Branch -|https://github.com/cppalliance/http_proto/tree/master[`master`] -|https://github.com/cppalliance/http_proto/tree/develop[`develop`] +|https://github.com/cppalliance/http/tree/master[`master`] +|https://github.com/cppalliance/http/tree/develop[`develop`] -|https://develop.http-proto.cpp.al/[Docs] -|https://master.http-proto.cpp.al/[image:https://img.shields.io/badge/docs-master-brightgreen.svg[Documentation]] -|https://develop.http-proto.cpp.al/[image:https://img.shields.io/badge/docs-develop-brightgreen.svg[Documentation]] +|https://develop.http.cpp.al/[Docs] +|https://master.http.cpp.al/[image:https://img.shields.io/badge/docs-master-brightgreen.svg[Documentation]] +|https://develop.http.cpp.al/[image:https://img.shields.io/badge/docs-develop-brightgreen.svg[Documentation]] |https://github.com/[GitHub Actions] -|https://github.com/cppalliance/http_proto/actions/workflows/ci.yml?query=branch%3Amaster[image:https://github.com/cppalliance/http_proto/actions/workflows/ci.yml/badge.svg?branch=master[CI]] -|https://github.com/cppalliance/http_proto/actions/workflows/ci.yml?query=branch%3Adevelop[image:https://github.com/cppalliance/http_proto/actions/workflows/ci.yml/badge.svg?branch=develop[CI]] +|https://github.com/cppalliance/http/actions/workflows/ci.yml?query=branch%3Amaster[image:https://github.com/cppalliance/http/actions/workflows/ci.yml/badge.svg?branch=master[CI]] +|https://github.com/cppalliance/http/actions/workflows/ci.yml?query=branch%3Adevelop[image:https://github.com/cppalliance/http/actions/workflows/ci.yml/badge.svg?branch=develop[CI]] |https://drone.io/[Drone] -|https://drone.cpp.al/cppalliance/http_proto/branches[image:https://drone.cpp.al/api/badges/cppalliance/http_proto/status.svg?ref=refs/heads/master[Build Status]] -|https://drone.cpp.al/cppalliance/http_proto/branches[image:https://drone.cpp.al/api/badges/cppalliance/http_proto/status.svg?ref=refs/heads/develop[Build Status]] +|https://drone.cpp.al/cppalliance/http/branches[image:https://drone.cpp.al/api/badges/cppalliance/http/status.svg?ref=refs/heads/master[Build Status]] +|https://drone.cpp.al/cppalliance/http/branches[image:https://drone.cpp.al/api/badges/cppalliance/http/status.svg?ref=refs/heads/develop[Build Status]] |https://codecov.io[Codecov] -|https://app.codecov.io/gh/cppalliance/http_proto/tree/master[image:https://codecov.io/gh/cppalliance/http_proto/branch/master/graph/badge.svg[codecov]] -|https://app.codecov.io/gh/cppalliance/http_proto/tree/develop[image:https://codecov.io/gh/cppalliance/http_proto/branch/develop/graph/badge.svg[codecov]] +|https://app.codecov.io/gh/cppalliance/http/tree/master[image:https://codecov.io/gh/cppalliance/http/branch/master/graph/badge.svg[codecov]] +|https://app.codecov.io/gh/cppalliance/http/tree/develop[image:https://codecov.io/gh/cppalliance/http/branch/develop/graph/badge.svg[codecov]] |=== -== Boost.Http.Proto +== Boost.HTTP === This is currently **NOT** an official Boost library. === Overview -Boost.Http.Proto is a portable, low-level C++ library which provides containers +Boost.HTTP is a portable, low-level C++ library which provides containers and algorithms for implementing the HTTP/1.1 protocol described in the document https://datatracker.ietf.org/doc/html/rfc7230[Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing], henceforth referred to as https://datatracker.ietf.org/doc/html/rfc7230[rfc7230]. -Boost.Http.Proto offers these features: +Boost.HTTP offers these features: * Require only C++11 * Works without exceptions @@ -55,20 +55,20 @@ Boost.Http.Proto offers these features: ==== Header-Only To eliminate the requirement to link a program to a static or dynamic -Boost.Http.Proto library, simply place the following line in *exactly one* +Boost.HTTP library, simply place the following line in *exactly one* source file in your project. ``` -#include +#include ``` ==== Embedded -Boost.HTTP.Proto works great on embedded devices. +Boost.HTTP works great on embedded devices. It is designed to work without exceptions if desired. ==== Supported Compilers -Boost.Http.Proto has been tested with the following compilers: +Boost.HTTP has been tested with the following compilers: * clang: 3.8, 4, 5, 6, 7, 8, 9, 10, 11, 12 * gcc: 5, 6, 7, 8, 9, 10, 11, 12 diff --git a/build/Jamfile b/build/Jamfile index 8e688b72..53226f29 100644 --- a/build/Jamfile +++ b/build/Jamfile @@ -4,7 +4,7 @@ # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # -# Official repository: https://github.com/vinniefalco/http_proto +# Official repository: https://github.com/vinniefalco/http # import ../../config/checks/config : requires ; @@ -19,32 +19,32 @@ constant c11-requires : ] ; -path-constant HTTP_PROTO_ROOT : .. ; +path-constant HTTP_ROOT : .. ; -project boost/http_proto +project boost/http : requirements $(c11-requires) - shared:BOOST_HTTP_PROTO_DYN_LINK=1 - static:BOOST_HTTP_PROTO_STATIC_LINK=1 + shared:BOOST_HTTP_DYN_LINK=1 + static:BOOST_HTTP_STATIC_LINK=1 : usage-requirements - shared:BOOST_HTTP_PROTO_DYN_LINK=1 - static:BOOST_HTTP_PROTO_STATIC_LINK=1 - : source-location $(HTTP_PROTO_ROOT) + shared:BOOST_HTTP_DYN_LINK=1 + static:BOOST_HTTP_STATIC_LINK=1 + : source-location $(HTTP_ROOT) ; -alias http_proto_sources : [ glob-tree-ex ./src : *.cpp ] ; +alias http_sources : [ glob-tree-ex ./src : *.cpp ] ; -explicit http_proto_sources ; +explicit http_sources ; -lib boost_http_proto - : http_proto_sources +lib boost_http + : http_sources : requirements /boost//buffers /boost//capy /boost/json//boost_json/off /boost//url ../ - BOOST_HTTP_PROTO_SOURCE + BOOST_HTTP_SOURCE : usage-requirements /boost//buffers /boost//capy @@ -52,4 +52,4 @@ lib boost_http_proto /boost//url ; -boost-install boost_http_proto ; +boost-install boost_http ; diff --git a/doc/antora.yml b/doc/antora.yml index 4c187e85..b5cd2c30 100644 --- a/doc/antora.yml +++ b/doc/antora.yml @@ -1,6 +1,6 @@ -name: http_proto +name: http version: ~ -title: Boost.HTTP.Proto +title: Boost.HTTP start_page: index.adoc asciidoc: attributes: @@ -13,4 +13,4 @@ ext: config: doc/mrdocs.yml cpp-tagfiles: using-namespaces: - - boost::http_proto + - boost::http diff --git a/doc/local-playbook.yml b/doc/local-playbook.yml index 9cc60082..48a32651 100644 --- a/doc/local-playbook.yml +++ b/doc/local-playbook.yml @@ -1,16 +1,16 @@ site: - title: Boost.Http.Proto + title: Boost.HTTP url: https://antora.cppalliance.org/develop/lib/doc - start_page: http_proto::index.adoc + start_page: http::index.adoc robots: allow keys: - repo_url: 'https://github.com/cppalliance/http_proto' + repo_url: 'https://github.com/cppalliance/http' content: sources: - url: .. start_path: doc - edit_url: 'https://github.com/cppalliance/http_proto/edit/{refname}/{path}' + edit_url: 'https://github.com/cppalliance/http/edit/{refname}/{path}' ui: bundle: diff --git a/doc/modules/ROOT/nav.adoc b/doc/modules/ROOT/nav.adoc index 22df34d1..a97bbd4b 100644 --- a/doc/modules/ROOT/nav.adoc +++ b/doc/modules/ROOT/nav.adoc @@ -17,5 +17,5 @@ * Design Requirements ** xref:design_requirements/serializer.adoc[Serializer] ** xref:design_requirements/parser.adoc[Parser] -// * xref:reference:boost/http_proto.adoc[Reference] +// * xref:reference:boost/http.adoc[Reference] * xref:reference.adoc[Reference] diff --git a/doc/modules/ROOT/pages/1.primer.adoc b/doc/modules/ROOT/pages/1.primer.adoc index 949f878e..427f5546 100644 --- a/doc/modules/ROOT/pages/1.primer.adoc +++ b/doc/modules/ROOT/pages/1.primer.adoc @@ -42,7 +42,7 @@ User-Agent: Boost\r\n [source] ---- HTTP/1.1 200 OK\r\n -Server: Boost.Http.Proto\r\n +Server: Boost.HTTP\r\n Content-Length: 13\r\n \r\n Hello, world! diff --git a/doc/modules/ROOT/pages/2.messages.adoc b/doc/modules/ROOT/pages/2.messages.adoc index b003c7a3..2cb3c354 100644 --- a/doc/modules/ROOT/pages/2.messages.adoc +++ b/doc/modules/ROOT/pages/2.messages.adoc @@ -4,7 +4,7 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // = Messages diff --git a/doc/modules/ROOT/pages/design_requirements/parser.adoc b/doc/modules/ROOT/pages/design_requirements/parser.adoc index 204756eb..8c213541 100644 --- a/doc/modules/ROOT/pages/design_requirements/parser.adoc +++ b/doc/modules/ROOT/pages/design_requirements/parser.adoc @@ -4,7 +4,7 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // = Parser Design Requirements @@ -35,7 +35,7 @@ Meanwhile parsers and serializes suffer from these problems: ==== Message Container -In HTTP.Proto the message container implementation always stores the complete +In HTTP the message container implementation always stores the complete message or fields in its correctly serialized form. Insertions and modifications are performed in linear time. When the container is reused, the amortized cost of reallocation becomes zero. A small lookup table is stored past the end of @@ -43,7 +43,7 @@ the serialized message, permitting iteration in constant time. ==== Parser -The HTTP.Proto parser is designed to persist for the lifetime of the connection +The HTTP parser is designed to persist for the lifetime of the connection or application. It allocates a fixed size memory buffer upon construction and uses this memory region to perform type-erasure and apply or remove content encodings to the body. The parser is a regular class instead of a class @@ -223,7 +223,7 @@ pr.start(); read_header(stream, pr); -http_proto::file file; +http::file file; system::error_code ec; file.open("./index.html", file_mode::write_new, ec); if(ec.failed()) diff --git a/doc/modules/ROOT/pages/design_requirements/serializer.adoc b/doc/modules/ROOT/pages/design_requirements/serializer.adoc index 57ed7f49..45f7feef 100644 --- a/doc/modules/ROOT/pages/design_requirements/serializer.adoc +++ b/doc/modules/ROOT/pages/design_requirements/serializer.adoc @@ -4,7 +4,7 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // = Serializer Design Requirements @@ -49,7 +49,7 @@ handle_request( res.set_keep_alive(req.keep_alive()); res.set_chunked(true); - http_proto::file file; + http::file file; system::error_code ec; file.open("./index.html", file_mode::scan, ec); if (ec.failed()) diff --git a/doc/modules/ROOT/pages/index.adoc b/doc/modules/ROOT/pages/index.adoc index 975cfb76..5ed994b5 100644 --- a/doc/modules/ROOT/pages/index.adoc +++ b/doc/modules/ROOT/pages/index.adoc @@ -4,10 +4,10 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -= Boost.HTTP.Proto += Boost.HTTP This is a portable C++ library offering containers and algorithms for implementing the HTTP/1.1 protocol. The format is widely used to deliver content on the Internet, @@ -29,9 +29,9 @@ any actual network activity as the logic is completely isolated from the underlying I/O operations. The implementation manages state, ensures RFC compliance, and provides the application-level interface for building and inspecting HTTP messages and their payloads, and it is necessary to use or -write the interfacing network implementation on top of HTTP.Proto. +write the interfacing network implementation on top of HTTP. -The companion library Boost.HTTP.IO uses Boost.HTTP.Proto to implement network +The companion library Boost.HTTP.IO uses Boost.HTTP to implement network I/O using Boost.Asio. The https://sans-io.readthedocs.io/[sans-I/O] website goes into more depth regarding this innovative approach to designing protocol libraries. @@ -44,7 +44,7 @@ this innovative approach to designing protocol libraries. == Tested Compilers -Boost.HTTP.Proto is tested with the following compiler versions: +Boost.HTTP is tested with the following compiler versions: * gcc: 5 to 14 (except 8.0.1) * clang: 3.9, 4 to 18 diff --git a/doc/modules/ROOT/pages/reference.adoc b/doc/modules/ROOT/pages/reference.adoc index 75fb2387..9c2152df 100644 --- a/doc/modules/ROOT/pages/reference.adoc +++ b/doc/modules/ROOT/pages/reference.adoc @@ -13,130 +13,130 @@ [width=100%] |=== -3+| *HTTP PROTO* | *RFC* +3+| *HTTP* | *RFC* | *Types (1/2)* -cpp:boost::http_proto::fields[fields] +cpp:boost::http::fields[fields] -cpp:boost::http_proto::fields_base[fields_base] +cpp:boost::http::fields_base[fields_base] -cpp:boost::http_proto::file[file] +cpp:boost::http::file[file] -cpp:boost::http_proto::file_sink[file_sink] +cpp:boost::http::file_sink[file_sink] -cpp:boost::http_proto::file_source[file_source] +cpp:boost::http::file_source[file_source] -cpp:boost::http_proto::header_limits[header_limits] +cpp:boost::http::header_limits[header_limits] -cpp:boost::http_proto::message_base[message_base] +cpp:boost::http::message_base[message_base] -cpp:boost::http_proto::metadata[metadata] +cpp:boost::http::metadata[metadata] -cpp:boost::http_proto::parser[parser] +cpp:boost::http::parser[parser] -cpp:boost::http_proto::request[request] +cpp:boost::http::request[request] -cpp:boost::http_proto::request_base[request_base] +cpp:boost::http::request_base[request_base] -cpp:boost::http_proto::request_parser[request_parser] +cpp:boost::http::request_parser[request_parser] -cpp:boost::http_proto::response[response] +cpp:boost::http::response[response] -cpp:boost::http_proto::response_base[response_base] +cpp:boost::http::response_base[response_base] -cpp:boost::http_proto::response_parser[response_parser] +cpp:boost::http::response_parser[response_parser] -cpp:boost::http_proto::serializer[serializer] +cpp:boost::http::serializer[serializer] | **Types (2/2)** -cpp:boost::http_proto::sink[sink] +cpp:boost::http::sink[sink] -cpp:boost::http_proto::source[source] +cpp:boost::http::source[source] -cpp:boost::http_proto::static_request[static_request] +cpp:boost::http::static_request[static_request] -cpp:boost::http_proto::static_response[static_response] +cpp:boost::http::static_response[static_response] -cpp:boost::http_proto::string_body[string_body] +cpp:boost::http::string_body[string_body] **Functions** -cpp:boost::http_proto::combine_field_values[combine_field_values] +cpp:boost::http::combine_field_values[combine_field_values] -cpp:boost::http_proto::install_parser_service[install_parser_service] +cpp:boost::http::install_parser_service[install_parser_service] -cpp:boost::http_proto::install_serializer_service[install_serializer_service] +cpp:boost::http::install_serializer_service[install_serializer_service] -cpp:boost::http_proto::int_to_status[int_to_status] +cpp:boost::http::int_to_status[int_to_status] -cpp:boost::http_proto::obsolete_reason[obsolete_reason] +cpp:boost::http::obsolete_reason[obsolete_reason] -cpp:boost::http_proto::string_to_field[string_to_field] +cpp:boost::http::string_to_field[string_to_field] -cpp:boost::http_proto::string_to_method[string_to_method] +cpp:boost::http::string_to_method[string_to_method] -cpp:boost::http_proto::to_status_class[to_status_class] +cpp:boost::http::to_status_class[to_status_class] -cpp:boost::http_proto::to_string[to_string] +cpp:boost::http::to_string[to_string] -// cpp:boost::http_proto::operator<<[operator<<] +// cpp:boost::http::operator<<[operator<<] | **Constants** -cpp:boost::http_proto::condition[condition] +cpp:boost::http::condition[condition] -cpp:boost::http_proto::content_coding[content_coding] +cpp:boost::http::content_coding[content_coding] -cpp:boost::http_proto::error[error] +cpp:boost::http::error[error] -cpp:boost::http_proto::field[field] +cpp:boost::http::field[field] -cpp:boost::http_proto::file_mode[file_mode] +cpp:boost::http::file_mode[file_mode] -cpp:boost::http_proto::method[method] +cpp:boost::http::method[method] -cpp:boost::http_proto::payload[payload] +cpp:boost::http::payload[payload] -cpp:boost::http_proto::status[status] +cpp:boost::http::status[status] -cpp:boost::http_proto::status_class[status_class] +cpp:boost::http::status_class[status_class] -cpp:boost::http_proto::version[version] +cpp:boost::http::version[version] **Type Traits** -cpp:boost::http_proto::is_sink[is_sink] +cpp:boost::http::is_sink[is_sink] -cpp:boost::http_proto::is_source[is_source] +cpp:boost::http::is_source[is_source] | **Grammar** -cpp:boost::http_proto::parameter_rule[parameter_rule] +cpp:boost::http::parameter_rule[parameter_rule] -cpp:boost::http_proto::quoted_token_rule[quoted_token_rule] +cpp:boost::http::quoted_token_rule[quoted_token_rule] -cpp:boost::http_proto::token_rule[token_rule] +cpp:boost::http::token_rule[token_rule] -cpp:boost::http_proto::upgrade_protocol_rule[upgrade_protocol_rule] +cpp:boost::http::upgrade_protocol_rule[upgrade_protocol_rule] -cpp:boost::http_proto::upgrade_rule[upgrade_rule] +cpp:boost::http::upgrade_rule[upgrade_rule] **Types** -cpp:boost::http_proto::upgrade_protocol[upgrade_protocol] +cpp:boost::http::upgrade_protocol[upgrade_protocol] -cpp:boost::http_proto::parameter[parameter] +cpp:boost::http::parameter[parameter] -cpp:boost::http_proto::quoted_token_view[quoted_token_view] +cpp:boost::http::quoted_token_view[quoted_token_view] **Functions** -cpp:boost::http_proto::list_rule[list_rule] +cpp:boost::http::list_rule[list_rule] **Constants** -cpp:boost::http_proto::tchars[tchars] +cpp:boost::http::tchars[tchars] |=== diff --git a/doc/modules/ROOT/pages/sans_io_philosophy.adoc b/doc/modules/ROOT/pages/sans_io_philosophy.adoc index c32bb296..7e2bc0cb 100644 --- a/doc/modules/ROOT/pages/sans_io_philosophy.adoc +++ b/doc/modules/ROOT/pages/sans_io_philosophy.adoc @@ -4,7 +4,7 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // diff --git a/doc/modules/ROOT/pages/server/router.adoc b/doc/modules/ROOT/pages/server/router.adoc index 06567ec6..ed181fc7 100644 --- a/doc/modules/ROOT/pages/server/router.adoc +++ b/doc/modules/ROOT/pages/server/router.adoc @@ -4,7 +4,7 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // = Server @@ -41,9 +41,9 @@ appropriate handlers in order. [source,cpp] ---- -#include +#include -using namespace boost::http_proto; +using namespace boost::http; basic_router router; @@ -259,9 +259,9 @@ basic_router router( [source,cpp] ---- -#include +#include -using namespace boost::http_proto; +using namespace boost::http; int main() { diff --git a/doc/mrdocs.yml b/doc/mrdocs.yml index 85090b54..e3c2180f 100644 --- a/doc/mrdocs.yml +++ b/doc/mrdocs.yml @@ -9,26 +9,26 @@ file-patterns: # Filters include-symbols: - - 'boost::http_proto::**' + - 'boost::http::**' exclude-symbols: - - 'boost::http_proto::fields_view_base::reference::operator->' + - 'boost::http::fields_view_base::reference::operator->' see-below: - - 'boost::http_proto::fields_view_base::iterator' - - 'boost::http_proto::fields_view_base::reverse_iterator' - - 'boost::http_proto::fields_view_base::subrange' - - 'boost::http_proto::file::native_handle_type' + - 'boost::http::fields_view_base::iterator' + - 'boost::http::fields_view_base::reverse_iterator' + - 'boost::http::fields_view_base::subrange' + - 'boost::http::file::native_handle_type' implementation-defined: - - 'boost::http_proto::*::detail' - - 'boost::http_proto::detail' - - 'boost::http_proto::implementation_defined' - - 'boost::http_proto::make_error_code' - - 'boost::http_proto::make_error_condition' + - 'boost::http::*::detail' + - 'boost::http::detail' + - 'boost::http::implementation_defined' + - 'boost::http::make_error_code' + - 'boost::http::make_error_condition' inaccessible-members: never inaccessible-bases: never # Generator generate: adoc -base-url: https://www.github.com/cppalliance/http_proto/blob/develop/ +base-url: https://www.github.com/cppalliance/http/blob/develop/ # Style verbose: true @@ -40,4 +40,4 @@ use-system-stdlib: true warn-unnamed-param: true warn-if-undoc-enum-val: false -cmake: '-DCMAKE_CXX_STANDARD=20 -DBOOST_HTTP_PROTO_MRDOCS_BUILD=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF' +cmake: '-DCMAKE_CXX_STANDARD=20 -DBOOST_HTTP_MRDOCS_BUILD=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF' diff --git a/include/boost/http.hpp b/include/boost/http.hpp new file mode 100644 index 00000000..46cd02d1 --- /dev/null +++ b/include/boost/http.hpp @@ -0,0 +1,53 @@ +// +// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// Official repository: https://github.com/cppalliance/http +// + +#ifndef BOOST_HTTP_HPP +#define BOOST_HTTP_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +//#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/http_proto/detail/config.hpp b/include/boost/http/detail/config.hpp similarity index 51% rename from include/boost/http_proto/detail/config.hpp rename to include/boost/http/detail/config.hpp index 4f661e6b..078743f2 100644 --- a/include/boost/http_proto/detail/config.hpp +++ b/include/boost/http/detail/config.hpp @@ -5,43 +5,43 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_DETAIL_CONFIG_HPP -#define BOOST_HTTP_PROTO_DETAIL_CONFIG_HPP +#ifndef BOOST_HTTP_DETAIL_CONFIG_HPP +#define BOOST_HTTP_DETAIL_CONFIG_HPP #include #include namespace boost { -namespace http_proto { +namespace http { //------------------------------------------------ -# if (defined(BOOST_HTTP_PROTO_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_HTTP_PROTO_STATIC_LINK) -# if defined(BOOST_HTTP_PROTO_SOURCE) -# define BOOST_HTTP_PROTO_DECL BOOST_SYMBOL_EXPORT -# define BOOST_HTTP_PROTO_BUILD_DLL +# if (defined(BOOST_HTTP_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_HTTP_STATIC_LINK) +# if defined(BOOST_HTTP_SOURCE) +# define BOOST_HTTP_DECL BOOST_SYMBOL_EXPORT +# define BOOST_HTTP_BUILD_DLL # else -# define BOOST_HTTP_PROTO_DECL BOOST_SYMBOL_IMPORT +# define BOOST_HTTP_DECL BOOST_SYMBOL_IMPORT # endif # endif // shared lib -# ifndef BOOST_HTTP_PROTO_DECL -# define BOOST_HTTP_PROTO_DECL +# ifndef BOOST_HTTP_DECL +# define BOOST_HTTP_DECL # endif #if defined(__MINGW32__) - #define BOOST_HTTP_PROTO_SYMBOL_VISIBLE BOOST_HTTP_PROTO_DECL + #define BOOST_HTTP_SYMBOL_VISIBLE BOOST_HTTP_DECL #else - #define BOOST_HTTP_PROTO_SYMBOL_VISIBLE BOOST_SYMBOL_VISIBLE + #define BOOST_HTTP_SYMBOL_VISIBLE BOOST_SYMBOL_VISIBLE #endif -# if !defined(BOOST_HTTP_PROTO_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_HTTP_PROTO_NO_LIB) -# define BOOST_LIB_NAME boost_http_proto -# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_HTTP_PROTO_DYN_LINK) +# if !defined(BOOST_HTTP_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_HTTP_NO_LIB) +# define BOOST_LIB_NAME boost_http +# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_HTTP_DYN_LINK) # define BOOST_DYN_LINK # endif # include @@ -50,42 +50,42 @@ namespace http_proto { //----------------------------------------------- #if defined(__cpp_lib_coroutine) && __cpp_lib_coroutine >= 201902L -# define BOOST_HTTP_PROTO_HAS_CORO 1 +# define BOOST_HTTP_HAS_CORO 1 #elif defined(__cpp_impl_coroutine) && __cpp_impl_coroutines >= 201902L -# define BOOST_HTTP_PROTO_HAS_CORO 1 +# define BOOST_HTTP_HAS_CORO 1 #endif //----------------------------------------------- #if defined(BOOST_NO_CXX14_AGGREGATE_NSDMI) -# define BOOST_HTTP_PROTO_AGGREGATE_WORKAROUND +# define BOOST_HTTP_AGGREGATE_WORKAROUND #endif // Add source location to error codes -#ifdef BOOST_HTTP_PROTO_NO_SOURCE_LOCATION -# define BOOST_HTTP_PROTO_ERR(ev) (::boost::system::error_code(ev)) -# define BOOST_HTTP_PROTO_RETURN_EC(ev) return (ev) +#ifdef BOOST_HTTP_NO_SOURCE_LOCATION +# define BOOST_HTTP_ERR(ev) (::boost::system::error_code(ev)) +# define BOOST_HTTP_RETURN_EC(ev) return (ev) #else -# define BOOST_HTTP_PROTO_ERR(ev) ( \ +# define BOOST_HTTP_ERR(ev) ( \ ::boost::system::error_code( (ev), [] { \ static constexpr auto loc((BOOST_CURRENT_LOCATION)); \ return &loc; }())) -# define BOOST_HTTP_PROTO_RETURN_EC(ev) \ +# define BOOST_HTTP_RETURN_EC(ev) \ do { \ static constexpr auto loc ## __LINE__((BOOST_CURRENT_LOCATION)); \ return ::boost::system::error_code((ev), &loc ## __LINE__); \ } while(0) #endif -} // http_proto +} // http // lift grammar into our namespace namespace urls { namespace grammar {} } -namespace http_proto { +namespace http { namespace grammar = ::boost::urls::grammar; -} // http_proto +} // http } // boost diff --git a/include/boost/http_proto/detail/except.hpp b/include/boost/http/detail/except.hpp similarity index 55% rename from include/boost/http_proto/detail/except.hpp rename to include/boost/http/detail/except.hpp index 49d258eb..f0249f07 100644 --- a/include/boost/http_proto/detail/except.hpp +++ b/include/boost/http/detail/except.hpp @@ -4,56 +4,56 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_DETAIL_EXCEPT_HPP -#define BOOST_HTTP_PROTO_DETAIL_EXCEPT_HPP +#ifndef BOOST_HTTP_DETAIL_EXCEPT_HPP +#define BOOST_HTTP_DETAIL_EXCEPT_HPP -#include +#include #include namespace boost { -namespace http_proto { +namespace http { namespace detail { -BOOST_HTTP_PROTO_DECL void BOOST_NORETURN throw_bad_alloc( +BOOST_HTTP_DECL void BOOST_NORETURN throw_bad_alloc( source_location const& loc = BOOST_CURRENT_LOCATION); -BOOST_HTTP_PROTO_DECL void BOOST_NORETURN throw_invalid_argument( +BOOST_HTTP_DECL void BOOST_NORETURN throw_invalid_argument( source_location const& loc = BOOST_CURRENT_LOCATION); -BOOST_HTTP_PROTO_DECL void BOOST_NORETURN throw_invalid_argument( +BOOST_HTTP_DECL void BOOST_NORETURN throw_invalid_argument( char const* what, source_location const& loc = BOOST_CURRENT_LOCATION); -BOOST_HTTP_PROTO_DECL void BOOST_NORETURN throw_length_error( +BOOST_HTTP_DECL void BOOST_NORETURN throw_length_error( source_location const& loc = BOOST_CURRENT_LOCATION); -BOOST_HTTP_PROTO_DECL void BOOST_NORETURN throw_length_error( +BOOST_HTTP_DECL void BOOST_NORETURN throw_length_error( char const* what, source_location const& loc = BOOST_CURRENT_LOCATION); -BOOST_HTTP_PROTO_DECL void BOOST_NORETURN throw_logic_error( +BOOST_HTTP_DECL void BOOST_NORETURN throw_logic_error( source_location const& loc = BOOST_CURRENT_LOCATION); -BOOST_HTTP_PROTO_DECL void BOOST_NORETURN throw_out_of_range( +BOOST_HTTP_DECL void BOOST_NORETURN throw_out_of_range( source_location const& loc = BOOST_CURRENT_LOCATION); -BOOST_HTTP_PROTO_DECL void BOOST_NORETURN throw_runtime_error( +BOOST_HTTP_DECL void BOOST_NORETURN throw_runtime_error( char const* what, source_location const& loc = BOOST_CURRENT_LOCATION); -BOOST_HTTP_PROTO_DECL void BOOST_NORETURN throw_system_error( +BOOST_HTTP_DECL void BOOST_NORETURN throw_system_error( system::error_code const& ec, source_location const& loc = BOOST_CURRENT_LOCATION); -BOOST_HTTP_PROTO_DECL void BOOST_NORETURN throw_system_error( +BOOST_HTTP_DECL void BOOST_NORETURN throw_system_error( error e, source_location const& loc = BOOST_CURRENT_LOCATION); } // detail -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/detail/header.hpp b/include/boost/http/detail/header.hpp similarity index 86% rename from include/boost/http_proto/detail/header.hpp rename to include/boost/http/detail/header.hpp index 7c54bb63..cead9747 100644 --- a/include/boost/http_proto/detail/header.hpp +++ b/include/boost/http/detail/header.hpp @@ -5,19 +5,19 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_DETAIL_HEADER_HPP -#define BOOST_HTTP_PROTO_DETAIL_HEADER_HPP +#ifndef BOOST_HTTP_DETAIL_HEADER_HPP +#define BOOST_HTTP_DETAIL_HEADER_HPP -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -25,7 +25,7 @@ #include namespace boost { -namespace http_proto { +namespace http { class fields_base; struct header_limits; @@ -52,7 +52,7 @@ struct header // ^ ^ ^ ^ // buf buf+prefix buf+size buf+cap -#ifdef BOOST_HTTP_PROTO_TEST_LIMITS +#ifdef BOOST_HTTP_TEST_LIMITS using offset_type = std::uint8_t; #else using offset_type = std::uint32_t; @@ -112,13 +112,13 @@ struct header { offset_type method_len; offset_type target_len; - http_proto::method method; + http::method method; }; struct res_t { unsigned short status_int; - http_proto::status status; + http::status status; }; //-------------------------------------------- @@ -132,8 +132,8 @@ struct header offset_type count = 0; offset_type prefix = 0; - http_proto::version version = - http_proto::version::http_1_1; + http::version version = + http::version::http_1_1; metadata md; union @@ -157,20 +157,20 @@ struct header static header& get(fields_base& f) noexcept; - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL static header const* get_default(detail::kind k) noexcept; // called from parser explicit header(empty) noexcept; - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL header(detail::kind) noexcept; - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void swap(header&) noexcept; - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL bool keep_alive() const noexcept; static std::size_t bytes_needed( @@ -223,7 +223,7 @@ struct header }; } // detail -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/detail/impl/workspace.hpp b/include/boost/http/detail/impl/workspace.hpp similarity index 92% rename from include/boost/http_proto/detail/impl/workspace.hpp rename to include/boost/http/detail/impl/workspace.hpp index 63e265bc..b417e56f 100644 --- a/include/boost/http_proto/detail/impl/workspace.hpp +++ b/include/boost/http/detail/impl/workspace.hpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_DETAIL_IMPL_WORKSPACE_HPP -#define BOOST_HTTP_PROTO_DETAIL_IMPL_WORKSPACE_HPP +#ifndef BOOST_HTTP_DETAIL_IMPL_WORKSPACE_HPP +#define BOOST_HTTP_DETAIL_IMPL_WORKSPACE_HPP #include namespace boost { -namespace http_proto { +namespace http { namespace detail { #if defined(BOOST_MSVC) @@ -25,7 +25,7 @@ struct workspace::any { any* next = nullptr; - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL virtual ~any() = 0; }; @@ -165,7 +165,7 @@ push_array( #endif } // detail -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/detail/sv.hpp b/include/boost/http/detail/sv.hpp similarity index 77% rename from include/boost/http_proto/detail/sv.hpp rename to include/boost/http/detail/sv.hpp index e7c3b1f6..c891cc1d 100644 --- a/include/boost/http_proto/detail/sv.hpp +++ b/include/boost/http/detail/sv.hpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_DETAIL_SV_HPP -#define BOOST_HTTP_PROTO_DETAIL_SV_HPP +#ifndef BOOST_HTTP_DETAIL_SV_HPP +#define BOOST_HTTP_DETAIL_SV_HPP #include namespace boost { -namespace http_proto { +namespace http { namespace detail { // Pulling in the UDL directly breaks in some places on MSVC, @@ -30,7 +30,7 @@ operator""_sv( } // string_literals } // detail -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/detail/type_traits.hpp b/include/boost/http/detail/type_traits.hpp similarity index 89% rename from include/boost/http_proto/detail/type_traits.hpp rename to include/boost/http/detail/type_traits.hpp index bb3c3eb1..2cda16eb 100644 --- a/include/boost/http_proto/detail/type_traits.hpp +++ b/include/boost/http/detail/type_traits.hpp @@ -4,11 +4,11 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_DETAIL_TYPE_TRAITS_HPP -#define BOOST_HTTP_PROTO_DETAIL_TYPE_TRAITS_HPP +#ifndef BOOST_HTTP_DETAIL_TYPE_TRAITS_HPP +#define BOOST_HTTP_DETAIL_TYPE_TRAITS_HPP #if __cplusplus >= 202002L #include @@ -18,7 +18,7 @@ #include namespace boost { -namespace http_proto { +namespace http { namespace detail { template struct make_void { typedef void type; }; @@ -85,7 +85,7 @@ using derived_from = std::integral_constant::value>; } // detail -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/detail/workspace.hpp b/include/boost/http/detail/workspace.hpp similarity index 88% rename from include/boost/http_proto/detail/workspace.hpp rename to include/boost/http/detail/workspace.hpp index 9e24fd82..a5a7cc14 100644 --- a/include/boost/http_proto/detail/workspace.hpp +++ b/include/boost/http/detail/workspace.hpp @@ -5,13 +5,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_DETAIL_WORKSPACE_HPP -#define BOOST_HTTP_PROTO_DETAIL_WORKSPACE_HPP +#ifndef BOOST_HTTP_DETAIL_WORKSPACE_HPP +#define BOOST_HTTP_DETAIL_WORKSPACE_HPP -#include +#include #include #include #include @@ -19,7 +19,7 @@ #include // ::max_align_t namespace boost { -namespace http_proto { +namespace http { namespace detail { /** A contiguous buffer of storage used by algorithms. @@ -121,7 +121,7 @@ class workspace /** Clear the contents while preserving capacity. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void clear() noexcept; @@ -129,7 +129,7 @@ class workspace @throw std::invalid_argument n >= this->size() */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL unsigned char* reserve_front( std::size_t n); @@ -138,7 +138,7 @@ class workspace @return nullptr if n >= this->size() */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL unsigned char* try_reserve_front( std::size_t n) noexcept; @@ -153,13 +153,13 @@ class workspace std::size_t n, T const& t); - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL unsigned char* reserve_back( std::size_t n); private: - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL unsigned char* bump_down( std::size_t size, @@ -167,9 +167,9 @@ class workspace }; } // detail -} // http_proto +} // http } // boost -#include +#include #endif diff --git a/include/boost/http_proto/error.hpp b/include/boost/http/error.hpp similarity index 93% rename from include/boost/http_proto/error.hpp rename to include/boost/http/error.hpp index 9927521e..7b487d99 100644 --- a/include/boost/http_proto/error.hpp +++ b/include/boost/http/error.hpp @@ -5,16 +5,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_ERROR_HPP -#define BOOST_HTTP_PROTO_ERROR_HPP +#ifndef BOOST_HTTP_ERROR_HPP +#define BOOST_HTTP_ERROR_HPP -#include +#include namespace boost { -namespace http_proto { +namespace http { /** Error codes returned from HTTP algorithms and operations. */ @@ -219,9 +219,9 @@ enum class condition invalid_payload }; -} // http_proto +} // http } // boost -#include +#include #endif diff --git a/include/boost/http_proto/field.hpp b/include/boost/http/field.hpp similarity index 96% rename from include/boost/http_proto/field.hpp rename to include/boost/http/field.hpp index 6e5e7c74..31da5cf6 100644 --- a/include/boost/http_proto/field.hpp +++ b/include/boost/http/field.hpp @@ -5,19 +5,19 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_FIELD_HPP -#define BOOST_HTTP_PROTO_FIELD_HPP +#ifndef BOOST_HTTP_FIELD_HPP +#define BOOST_HTTP_FIELD_HPP -#include +#include #include #include #include namespace boost { -namespace http_proto { +namespace http { /** HTTP field name constants. */ @@ -387,7 +387,7 @@ enum class field : unsigned short @param f The field name constant to convert. */ -BOOST_HTTP_PROTO_DECL +BOOST_HTTP_DECL core::string_view to_string(field f); @@ -397,7 +397,7 @@ to_string(field f); @param s The string representing a header name. */ -BOOST_HTTP_PROTO_DECL +BOOST_HTTP_DECL boost::optional string_to_field( core::string_view s) noexcept; @@ -410,11 +410,11 @@ string_to_field( @param f The field name constant to use. */ -BOOST_HTTP_PROTO_DECL +BOOST_HTTP_DECL std::ostream& operator<<(std::ostream& os, field f); -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/fields.hpp b/include/boost/http/fields.hpp similarity index 96% rename from include/boost/http_proto/fields.hpp rename to include/boost/http/fields.hpp index 607e8e51..ac2cb04d 100644 --- a/include/boost/http_proto/fields.hpp +++ b/include/boost/http/fields.hpp @@ -6,17 +6,17 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_FIELDS_HPP -#define BOOST_HTTP_PROTO_FIELDS_HPP +#ifndef BOOST_HTTP_FIELDS_HPP +#define BOOST_HTTP_FIELDS_HPP -#include -#include +#include +#include namespace boost { -namespace http_proto { +namespace http { /** A modifiable container of HTTP fields. @@ -92,7 +92,7 @@ class fields final @par Example @code fields f( - "Server: Boost.HttpProto\r\n" + "Server: Boost.HTTP\r\n" "Content-Type: text/plain\r\n" "Connection: close\r\n" "Content-Length: 73\r\n" @@ -343,7 +343,7 @@ class fields final } }; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/fields_base.hpp b/include/boost/http/fields_base.hpp similarity index 95% rename from include/boost/http_proto/fields_base.hpp rename to include/boost/http/fields_base.hpp index 01b96f04..c1c32a7d 100644 --- a/include/boost/http_proto/fields_base.hpp +++ b/include/boost/http/fields_base.hpp @@ -6,21 +6,21 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_FIELDS_BASE_HPP -#define BOOST_HTTP_PROTO_FIELDS_BASE_HPP +#ifndef BOOST_HTTP_FIELDS_BASE_HPP +#define BOOST_HTTP_FIELDS_BASE_HPP -#include -#include -#include +#include +#include +#include #include #include namespace boost { -namespace http_proto { +namespace http { /** Mixin for modifiable HTTP fields. @@ -74,32 +74,32 @@ class fields_base friend class parser; friend class serializer; - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL explicit fields_base( detail::kind k) noexcept; - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL fields_base( detail::kind k, void* storage, std::size_t cap) noexcept; - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL fields_base( detail::kind k, core::string_view s); - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL explicit fields_base( detail::header const& h); - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL fields_base( fields_base const&); - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL fields_base( detail::header const& h, void* storage, @@ -168,7 +168,7 @@ class fields_base std::string value; /// Constructor. - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL value_type( reference const& other); @@ -211,7 +211,7 @@ class fields_base /** Destructor. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL ~fields_base(); //-------------------------------------------- @@ -283,7 +283,7 @@ class fields_base @param id The field name constant. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL core::string_view at(field id) const; @@ -305,13 +305,13 @@ class fields_base @param name The field name. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL core::string_view at(core::string_view name) const; /** Return true if a field exists. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL bool exists(field id) const noexcept; @@ -323,7 +323,7 @@ class fields_base @param name The field name. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL bool exists( core::string_view name) const noexcept; @@ -332,7 +332,7 @@ class fields_base @param id The field name constant. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL std::size_t count(field id) const noexcept; @@ -344,7 +344,7 @@ class fields_base @param name The field name. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL std::size_t count( core::string_view name) const noexcept; @@ -353,7 +353,7 @@ class fields_base @param id The field name constant. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL iterator find(field id) const noexcept; @@ -365,7 +365,7 @@ class fields_base @param name The field name. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL iterator find( core::string_view name) const noexcept; @@ -377,7 +377,7 @@ class fields_base @param id The field name constant. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL iterator find( iterator from, @@ -394,7 +394,7 @@ class fields_base @param name The field name. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL iterator find( iterator from, @@ -408,7 +408,7 @@ class fields_base @param id The field name constant. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL iterator find_last( iterator before, @@ -426,7 +426,7 @@ class fields_base @param name The field name. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL iterator find_last( iterator before, @@ -439,7 +439,7 @@ class fields_base @param s The value to be returned if field does not exist. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL core::string_view value_or( field id, @@ -456,7 +456,7 @@ class fields_base @param s The value to be returned if field does not exist. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL core::string_view value_or( core::string_view name, @@ -466,7 +466,7 @@ class fields_base @param id The field name constant. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL subrange find_all(field id) const noexcept; @@ -478,7 +478,7 @@ class fields_base @param name The field name. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL subrange find_all( core::string_view name) const noexcept; @@ -519,7 +519,7 @@ class fields_base @par Complexity Constant. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void clear() noexcept; @@ -545,7 +545,7 @@ class fields_base @param n The capacity in bytes. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void reserve_bytes(std::size_t n); @@ -574,7 +574,7 @@ class fields_base @param n The maximum allowed capacity in bytes. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void set_max_capacity_in_bytes(std::size_t n); @@ -584,7 +584,7 @@ class fields_base Strong guarantee. Calls to allocate may throw. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void shrink_to_fit(); @@ -835,7 +835,7 @@ class fields_base @param value The value which must be semantically valid for the message. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL iterator insert( iterator before, @@ -884,7 +884,7 @@ class fields_base @param ec Set to the error if input is invalid. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL iterator insert( iterator before, @@ -936,7 +936,7 @@ class fields_base @param value The value which must be semantically valid for the message. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL iterator insert( iterator before, @@ -985,7 +985,7 @@ class fields_base @param ec Set to the error if input is invalid. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL iterator insert( iterator before, @@ -1012,7 +1012,7 @@ class fields_base @param it The iterator to the element to erase. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL iterator erase(iterator it) noexcept; @@ -1033,7 +1033,7 @@ class fields_base @param id The field name constant. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL std::size_t erase(field id) noexcept; @@ -1054,7 +1054,7 @@ class fields_base @param name The header name. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL std::size_t erase( core::string_view name) noexcept; @@ -1091,7 +1091,7 @@ class fields_base @param value The value which must be semantically valid for the message. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void set(iterator it, core::string_view value); @@ -1123,7 +1123,7 @@ class fields_base @param ec Set to the error if input is invalid. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void set( iterator it, @@ -1210,7 +1210,7 @@ class fields_base @param ec Set to the error if input is invalid. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void set( field id, @@ -1296,7 +1296,7 @@ class fields_base @param ec Set to the error if input is invalid. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void set( core::string_view name, @@ -1337,19 +1337,19 @@ class fields_base @param f The container to write. */ friend - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL std::ostream& operator<<( std::ostream& os, const fields_base& f); private: - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void copy_impl( detail::header const&); - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void insert_impl( optional id, @@ -1392,9 +1392,9 @@ class fields_base std::size_t i) const noexcept; }; -} // http_proto +} // http } // boost -#include +#include #endif diff --git a/include/boost/http_proto/file_sink.hpp b/include/boost/http/file_sink.hpp similarity index 77% rename from include/boost/http_proto/file_sink.hpp rename to include/boost/http/file_sink.hpp index 2cbc7fab..2dd2fe2c 100644 --- a/include/boost/http_proto/file_sink.hpp +++ b/include/boost/http/file_sink.hpp @@ -5,18 +5,18 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_FILE_SINK_HPP -#define BOOST_HTTP_PROTO_FILE_SINK_HPP +#ifndef BOOST_HTTP_FILE_SINK_HPP +#define BOOST_HTTP_FILE_SINK_HPP -#include -#include +#include +#include #include namespace boost { -namespace http_proto { +namespace http { /** Writes a message body to a file. @@ -47,7 +47,7 @@ class file_sink @param f An open @ref file object that will receive the body data. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL explicit file_sink(capy::file&& f) noexcept; @@ -56,22 +56,22 @@ class file_sink /** Constructor. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL file_sink(file_sink&&) noexcept; /** Destructor. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL ~file_sink(); private: - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL results on_write( buffers::const_buffer, bool) override; }; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/file_source.hpp b/include/boost/http/file_source.hpp similarity index 80% rename from include/boost/http_proto/file_source.hpp rename to include/boost/http/file_source.hpp index a7f71555..141aa88b 100644 --- a/include/boost/http_proto/file_source.hpp +++ b/include/boost/http/file_source.hpp @@ -5,19 +5,19 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_FILE_SOURCE_HPP -#define BOOST_HTTP_PROTO_FILE_SOURCE_HPP +#ifndef BOOST_HTTP_FILE_SOURCE_HPP +#define BOOST_HTTP_FILE_SOURCE_HPP -#include -#include +#include +#include #include #include namespace boost { -namespace http_proto { +namespace http { /** Reads a message body from a file. @@ -55,7 +55,7 @@ class file_source exceeds the size of the file, the entire file will be read. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL file_source( capy::file&& f, std::uint64_t limit = @@ -66,22 +66,22 @@ class file_source /** Constructor. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL file_source(file_source&&) noexcept; /** Destructor. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL ~file_source(); private: - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL results on_read( buffers::mutable_buffer b) override; }; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/header_limits.hpp b/include/boost/http/header_limits.hpp similarity index 93% rename from include/boost/http_proto/header_limits.hpp rename to include/boost/http/header_limits.hpp index 0f8be356..b8057fc3 100644 --- a/include/boost/http_proto/header_limits.hpp +++ b/include/boost/http/header_limits.hpp @@ -4,17 +4,17 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_HEADER_LIMITS_HPP -#define BOOST_HTTP_PROTO_HEADER_LIMITS_HPP +#ifndef BOOST_HTTP_HEADER_LIMITS_HPP +#define BOOST_HTTP_HEADER_LIMITS_HPP -#include +#include #include namespace boost { -namespace http_proto { +namespace http { /** Configurable limits for HTTP headers. @@ -116,12 +116,12 @@ struct header_limits number of contiguous bytes of storage that would be needed at these settings. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL std::size_t valid_space_needed() const; }; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/http_proto.natvis b/include/boost/http/http_proto.natvis similarity index 85% rename from include/boost/http_proto/http_proto.natvis rename to include/boost/http/http_proto.natvis index efd3005c..8c41cba1 100644 --- a/include/boost/http_proto/http_proto.natvis +++ b/include/boost/http/http_proto.natvis @@ -1,13 +1,13 @@ - + [{count}] {cbuf,[prefix-2]s} [{count}] - + @@ -32,14 +32,14 @@ - + { h_ } h_ - + { h_ } h_ diff --git a/include/boost/http_proto/impl/error.hpp b/include/boost/http/impl/error.hpp similarity index 73% rename from include/boost/http_proto/impl/error.hpp rename to include/boost/http/impl/error.hpp index a04362bd..af8db908 100644 --- a/include/boost/http_proto/impl/error.hpp +++ b/include/boost/http/impl/error.hpp @@ -4,11 +4,11 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_IMPL_ERROR_HPP -#define BOOST_HTTP_PROTO_IMPL_ERROR_HPP +#ifndef BOOST_HTTP_IMPL_ERROR_HPP +#define BOOST_HTTP_IMPL_ERROR_HPP #include #include @@ -21,14 +21,14 @@ namespace system { template<> struct is_error_code_enum< - ::boost::http_proto::error> + ::boost::http::error> { static bool const value = true; }; template<> struct is_error_condition_enum< - ::boost::http_proto::condition> + ::boost::http::condition> { static bool const value = true; }; @@ -37,19 +37,19 @@ struct is_error_condition_enum< //----------------------------------------------- -namespace http_proto { +namespace http { namespace detail { -struct BOOST_HTTP_PROTO_SYMBOL_VISIBLE +struct BOOST_HTTP_SYMBOL_VISIBLE error_cat_type : system::error_category { - BOOST_HTTP_PROTO_DECL const char* name( + BOOST_HTTP_DECL const char* name( ) const noexcept override; - BOOST_HTTP_PROTO_DECL std::string message( + BOOST_HTTP_DECL std::string message( int) const override; - BOOST_HTTP_PROTO_DECL char const* message( + BOOST_HTTP_DECL char const* message( int, char*, std::size_t ) const noexcept override; BOOST_SYSTEM_CONSTEXPR error_cat_type() @@ -58,18 +58,18 @@ struct BOOST_HTTP_PROTO_SYMBOL_VISIBLE } }; -struct BOOST_HTTP_PROTO_SYMBOL_VISIBLE +struct BOOST_HTTP_SYMBOL_VISIBLE condition_cat_type : system::error_category { - BOOST_HTTP_PROTO_DECL const char* name( + BOOST_HTTP_DECL const char* name( ) const noexcept override; - BOOST_HTTP_PROTO_DECL std::string message( + BOOST_HTTP_DECL std::string message( int) const override; - BOOST_HTTP_PROTO_DECL char const* message( + BOOST_HTTP_DECL char const* message( int, char*, std::size_t ) const noexcept override; - BOOST_HTTP_PROTO_DECL bool equivalent( + BOOST_HTTP_DECL bool equivalent( system::error_code const&, int ) const noexcept override; BOOST_SYSTEM_CONSTEXPR condition_cat_type() @@ -78,9 +78,9 @@ struct BOOST_HTTP_PROTO_SYMBOL_VISIBLE } }; -BOOST_HTTP_PROTO_DECL extern +BOOST_HTTP_DECL extern error_cat_type error_cat; -BOOST_HTTP_PROTO_DECL extern +BOOST_HTTP_DECL extern condition_cat_type condition_cat; } // detail @@ -109,7 +109,7 @@ make_error_condition( detail::condition_cat}; } -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/impl/fields_base.hpp b/include/boost/http/impl/fields_base.hpp similarity index 95% rename from include/boost/http_proto/impl/fields_base.hpp rename to include/boost/http/impl/fields_base.hpp index 576780b9..d0eb986e 100644 --- a/include/boost/http_proto/impl/fields_base.hpp +++ b/include/boost/http/impl/fields_base.hpp @@ -4,17 +4,17 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_IMPL_FIELDS_BASE_HPP -#define BOOST_HTTP_PROTO_IMPL_FIELDS_BASE_HPP +#ifndef BOOST_HTTP_IMPL_FIELDS_BASE_HPP +#define BOOST_HTTP_IMPL_FIELDS_BASE_HPP #include #include namespace boost { -namespace http_proto { +namespace http { //------------------------------------------------ // @@ -72,7 +72,7 @@ class fields_base::iterator return !(*this == other); } - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL reference operator*() const noexcept; @@ -175,7 +175,7 @@ class fields_base::reverse_iterator return !(*this == other); } - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL reference operator*() const noexcept; @@ -278,13 +278,13 @@ class fields_base::subrange:: friend class fields_base::subrange; - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL iterator( detail::header const* ph, std::size_t i) noexcept; // end - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL iterator( detail::header const* ph) noexcept; @@ -329,7 +329,7 @@ class fields_base::subrange:: return !(*this == other); } - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL reference const operator*() const noexcept; @@ -339,7 +339,7 @@ class fields_base::subrange:: return *(*this); } - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL iterator& operator++() noexcept; @@ -423,7 +423,7 @@ rend() const noexcept -> return reverse_iterator(begin()); } -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/impl/parser.hpp b/include/boost/http/impl/parser.hpp similarity index 88% rename from include/boost/http_proto/impl/parser.hpp rename to include/boost/http/impl/parser.hpp index 51f79a7f..5f67b827 100644 --- a/include/boost/http_proto/impl/parser.hpp +++ b/include/boost/http/impl/parser.hpp @@ -4,22 +4,22 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // we need a pragma once for the circular includes required // clangd's intellisense #pragma once -#ifndef BOOST_HTTP_PROTO_IMPL_PARSER_HPP -#define BOOST_HTTP_PROTO_IMPL_PARSER_HPP +#ifndef BOOST_HTTP_IMPL_PARSER_HPP +#define BOOST_HTTP_IMPL_PARSER_HPP -#include -#include -#include +#include +#include +#include namespace boost { -namespace http_proto { +namespace http { template typename std::enable_if< @@ -108,7 +108,7 @@ set_body(Args&&... args) return s; } -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/impl/serializer.hpp b/include/boost/http/impl/serializer.hpp similarity index 93% rename from include/boost/http_proto/impl/serializer.hpp rename to include/boost/http/impl/serializer.hpp index 1613dc6b..2f7bba99 100644 --- a/include/boost/http_proto/impl/serializer.hpp +++ b/include/boost/http/impl/serializer.hpp @@ -5,16 +5,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_IMPL_SERIALIZER_HPP -#define BOOST_HTTP_PROTO_IMPL_SERIALIZER_HPP +#ifndef BOOST_HTTP_IMPL_SERIALIZER_HPP +#define BOOST_HTTP_IMPL_SERIALIZER_HPP -#include +#include namespace boost { -namespace http_proto { +namespace http { class serializer::cbs_gen { @@ -156,7 +156,7 @@ start( return source; } -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/impl/sink.hpp b/include/boost/http/impl/sink.hpp similarity index 85% rename from include/boost/http_proto/impl/sink.hpp rename to include/boost/http/impl/sink.hpp index f2d53331..7dff144d 100644 --- a/include/boost/http_proto/impl/sink.hpp +++ b/include/boost/http/impl/sink.hpp @@ -4,19 +4,19 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_IMPL_SINK_HPP -#define BOOST_HTTP_PROTO_IMPL_SINK_HPP +#ifndef BOOST_HTTP_IMPL_SINK_HPP +#define BOOST_HTTP_IMPL_SINK_HPP #include #include -#include +#include #include namespace boost { -namespace http_proto { +namespace http { inline auto @@ -68,7 +68,7 @@ write_impl( return rv; } -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/impl/source.hpp b/include/boost/http/impl/source.hpp similarity index 94% rename from include/boost/http_proto/impl/source.hpp rename to include/boost/http/impl/source.hpp index 30eada32..7207e7c9 100644 --- a/include/boost/http_proto/impl/source.hpp +++ b/include/boost/http/impl/source.hpp @@ -10,11 +10,11 @@ #ifndef BOOST_BUFFERS_IMPL_SOURCE_HPP #define BOOST_BUFFERS_IMPL_SOURCE_HPP -#include +#include #include namespace boost { -namespace http_proto { +namespace http { inline auto @@ -69,7 +69,7 @@ read_impl( return rv; } -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/json.hpp b/include/boost/http/json.hpp similarity index 57% rename from include/boost/http_proto/json.hpp rename to include/boost/http/json.hpp index 50399c89..c3c83cd3 100644 --- a/include/boost/http_proto/json.hpp +++ b/include/boost/http/json.hpp @@ -4,19 +4,19 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_JSON_HPP -#define BOOST_HTTP_PROTO_JSON_HPP +#ifndef BOOST_HTTP_JSON_HPP +#define BOOST_HTTP_JSON_HPP -#include +#include #include namespace boost { -namespace http_proto { +namespace http { -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/message_base.hpp b/include/boost/http/message_base.hpp similarity index 89% rename from include/boost/http_proto/message_base.hpp rename to include/boost/http/message_base.hpp index 24e3a995..8307d0e7 100644 --- a/include/boost/http_proto/message_base.hpp +++ b/include/boost/http/message_base.hpp @@ -5,18 +5,18 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_MESSAGE_BASE_HPP -#define BOOST_HTTP_PROTO_MESSAGE_BASE_HPP +#ifndef BOOST_HTTP_MESSAGE_BASE_HPP +#define BOOST_HTTP_MESSAGE_BASE_HPP -#include -#include +#include +#include #include namespace boost { -namespace http_proto { +namespace http { /** Mixin for modifing common metadata in HTTP request and response messages. @@ -51,7 +51,7 @@ class message_base */ auto payload() const noexcept -> - http_proto::payload + http::payload { return h_.md.payload; } @@ -86,7 +86,7 @@ class message_base */ auto metadata() const noexcept -> - http_proto::metadata const& + http::metadata const& { return h_.md; } @@ -102,7 +102,7 @@ class message_base /** Return the HTTP-version. */ - http_proto::version + http::version version() const noexcept { return h_.version; @@ -126,7 +126,7 @@ class message_base @param n The payload size to set. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void set_payload_size( std::uint64_t n); @@ -143,7 +143,7 @@ class message_base @param n The Content-Length to set. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void set_content_length( std::uint64_t n); @@ -160,7 +160,7 @@ class message_base @param value The value to set. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void set_chunked(bool value); @@ -182,12 +182,12 @@ class message_base @param value The value to set. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void set_keep_alive(bool value); }; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/metadata.hpp b/include/boost/http/metadata.hpp similarity index 91% rename from include/boost/http_proto/metadata.hpp rename to include/boost/http/metadata.hpp index c71c6748..26fe98c6 100644 --- a/include/boost/http_proto/metadata.hpp +++ b/include/boost/http/metadata.hpp @@ -5,19 +5,19 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_METADATA_HPP -#define BOOST_HTTP_PROTO_METADATA_HPP +#ifndef BOOST_HTTP_METADATA_HPP +#define BOOST_HTTP_METADATA_HPP -#include +#include #include #include #include namespace boost { -namespace http_proto { +namespace http { /** Identifies the payload type of a message. */ @@ -87,7 +87,7 @@ struct metadata */ bool upgrade = false; - #ifdef BOOST_HTTP_PROTO_AGGREGATE_WORKAROUND + #ifdef BOOST_HTTP_AGGREGATE_WORKAROUND constexpr connection_t() = default; @@ -127,7 +127,7 @@ struct metadata content_coding coding = content_coding::identity; - #ifdef BOOST_HTTP_PROTO_AGGREGATE_WORKAROUND + #ifdef BOOST_HTTP_AGGREGATE_WORKAROUND constexpr content_encoding_t() = default; @@ -166,7 +166,7 @@ struct metadata */ std::uint64_t value = 0; - #ifdef BOOST_HTTP_PROTO_AGGREGATE_WORKAROUND + #ifdef BOOST_HTTP_AGGREGATE_WORKAROUND constexpr content_length_t() = default; @@ -201,7 +201,7 @@ struct metadata */ bool is_100_continue = false; - #ifdef BOOST_HTTP_PROTO_AGGREGATE_WORKAROUND + #ifdef BOOST_HTTP_AGGREGATE_WORKAROUND constexpr expect_t() = default; @@ -236,7 +236,7 @@ struct metadata */ bool is_chunked = false; - #ifdef BOOST_HTTP_PROTO_AGGREGATE_WORKAROUND + #ifdef BOOST_HTTP_AGGREGATE_WORKAROUND constexpr transfer_encoding_t() = default; @@ -271,7 +271,7 @@ struct metadata */ bool websocket = false; - #ifdef BOOST_HTTP_PROTO_AGGREGATE_WORKAROUND + #ifdef BOOST_HTTP_AGGREGATE_WORKAROUND constexpr upgrade_t() = default; @@ -300,13 +300,13 @@ struct metadata /** The type of payload. */ - http_proto::payload payload = - http_proto::payload::none; + http::payload payload = + http::payload::none; /** The size of the payload if known. This is only valid when @ref payload - equals @ref http_proto::payload::size. + equals @ref http::payload::size. */ std::uint64_t payload_size = 0; @@ -345,7 +345,7 @@ struct metadata constexpr metadata() = default; }; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/method.hpp b/include/boost/http/method.hpp similarity index 93% rename from include/boost/http_proto/method.hpp rename to include/boost/http/method.hpp index 472b57f5..8dbb7fce 100644 --- a/include/boost/http_proto/method.hpp +++ b/include/boost/http/method.hpp @@ -4,18 +4,18 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_METHOD_HPP -#define BOOST_HTTP_PROTO_METHOD_HPP +#ifndef BOOST_HTTP_METHOD_HPP +#define BOOST_HTTP_METHOD_HPP -#include +#include #include #include namespace boost { -namespace http_proto { +namespace http { /** HTTP request methods. @@ -137,7 +137,7 @@ enum class method : char @param s The string representing a request method. */ -BOOST_HTTP_PROTO_DECL +BOOST_HTTP_DECL method string_to_method( core::string_view s); @@ -146,7 +146,7 @@ string_to_method( @param v The method to use. */ -BOOST_HTTP_PROTO_DECL +BOOST_HTTP_DECL core::string_view to_string(method v); @@ -161,7 +161,7 @@ to_string(method v); std::ostream& operator<<(std::ostream& os, method v); -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/parser.hpp b/include/boost/http/parser.hpp similarity index 93% rename from include/boost/http_proto/parser.hpp rename to include/boost/http/parser.hpp index 5441d236..9a8cbbe8 100644 --- a/include/boost/http_proto/parser.hpp +++ b/include/boost/http/parser.hpp @@ -5,18 +5,18 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_PARSER_HPP -#define BOOST_HTTP_PROTO_PARSER_HPP +#ifndef BOOST_HTTP_PARSER_HPP +#define BOOST_HTTP_PARSER_HPP -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -27,7 +27,7 @@ #include namespace boost { -namespace http_proto { +namespace http { // Forward declaration class request_parser; @@ -98,7 +98,7 @@ class parser @ref response_parser::get, @ref request_parser::get. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL bool got_header() const noexcept; @@ -112,14 +112,14 @@ class parser @ref body, @ref start. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL bool is_complete() const noexcept; #if 0 /** Return true if any input was committed. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL bool got_some() const noexcept; @@ -153,7 +153,7 @@ class parser This function must be called before parsing the first message in a new stream. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void reset() noexcept; @@ -167,7 +167,7 @@ class parser first message being read from the stream or if the previous message has been fully parsed. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void start(); @@ -195,7 +195,7 @@ class parser @ref commit, @ref commit_eof. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL mutable_buffers_type prepare(); @@ -223,7 +223,7 @@ class parser @ref parse, @ref prepare. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void commit( std::size_t n); @@ -241,7 +241,7 @@ class parser @ref parse, @ref prepare. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void commit_eof(); @@ -282,14 +282,14 @@ class parser @ref commit, @ref commit_eof. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void parse( system::error_code& ec); /** Return true if a body has been attached. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL bool is_body_set() const noexcept; @@ -499,7 +499,7 @@ class parser @see @ref config_base::body_limit. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void set_body_limit(std::uint64_t n); @@ -537,7 +537,7 @@ class parser @see @ref consume_body. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL const_buffers_type pull_body(); @@ -557,7 +557,7 @@ class parser @see @ref pull_body. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void consume_body(std::size_t n); @@ -593,7 +593,7 @@ class parser @see @ref is_complete. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL core::string_view body() const; @@ -611,7 +611,7 @@ class parser @ref metadata::upgrade, @ref metadata::connection. */ // VFALCO rename to get_leftovers()? - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL core::string_view release_buffered_data() noexcept; @@ -620,13 +620,13 @@ class parser friend class response_parser; class impl; - BOOST_HTTP_PROTO_DECL ~parser(); - BOOST_HTTP_PROTO_DECL parser() noexcept; - BOOST_HTTP_PROTO_DECL parser(parser&& other) noexcept; - BOOST_HTTP_PROTO_DECL parser(capy::polystore&, detail::kind); - BOOST_HTTP_PROTO_DECL void assign(parser&& other) noexcept; + BOOST_HTTP_DECL ~parser(); + BOOST_HTTP_DECL parser() noexcept; + BOOST_HTTP_DECL parser(parser&& other) noexcept; + BOOST_HTTP_DECL parser(capy::polystore&, detail::kind); + BOOST_HTTP_DECL void assign(parser&& other) noexcept; - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void start_impl(bool); @@ -636,15 +636,15 @@ class parser static_response const& safe_get_response() const; - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL detail::workspace& ws() noexcept; - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void set_body_impl(buffers::any_dynamic_buffer&) noexcept; - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void set_body_impl(sink&) noexcept; @@ -768,15 +768,15 @@ struct parser::config_base @ref request_parser::config, @ref request_parser. */ -BOOST_HTTP_PROTO_DECL +BOOST_HTTP_DECL void install_parser_service( capy::polystore& ctx, parser::config_base const& cfg); -} // http_proto +} // http } // boost -#include +#include #endif diff --git a/include/boost/http_proto/request.hpp b/include/boost/http/request.hpp similarity index 96% rename from include/boost/http_proto/request.hpp rename to include/boost/http/request.hpp index 075d9bcb..42af75fd 100644 --- a/include/boost/http_proto/request.hpp +++ b/include/boost/http/request.hpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_REQUEST_HPP -#define BOOST_HTTP_PROTO_REQUEST_HPP +#ifndef BOOST_HTTP_REQUEST_HPP +#define BOOST_HTTP_REQUEST_HPP -#include +#include namespace boost { -namespace http_proto { +namespace http { /** A modifiable container for HTTP requests. @@ -140,9 +140,9 @@ class request @param v The version to set. */ request( - http_proto::method m, + http::method m, core::string_view t, - http_proto::version v) noexcept + http::version v) noexcept : request() { set_start_line(m, t, v); @@ -171,10 +171,10 @@ class request @param t The string representing a target. */ request( - http_proto::method m, + http::method m, core::string_view t) : request( - m, t, http_proto::version::http_1_1) + m, t, http::version::http_1_1) { } @@ -452,7 +452,7 @@ class request } }; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/request_base.hpp b/include/boost/http/request_base.hpp similarity index 90% rename from include/boost/http_proto/request_base.hpp rename to include/boost/http/request_base.hpp index 450158d3..89a7b019 100644 --- a/include/boost/http_proto/request_base.hpp +++ b/include/boost/http/request_base.hpp @@ -5,17 +5,17 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_REQUEST_BASE_HPP -#define BOOST_HTTP_PROTO_REQUEST_BASE_HPP +#ifndef BOOST_HTTP_REQUEST_BASE_HPP +#define BOOST_HTTP_REQUEST_BASE_HPP -#include -#include +#include +#include namespace boost { -namespace http_proto { +namespace http { /** Mixin for modifing HTTP requests. @@ -63,7 +63,7 @@ class request_base be obtained as a string instead, by calling @ref method_text. */ - http_proto::method + http::method method() const noexcept { return h_.req.method; @@ -110,7 +110,7 @@ class request_base */ void set_method( - http_proto::method m) + http::method m) { set_start_line_impl( m, @@ -194,7 +194,7 @@ class request_base */ void set_version( - http_proto::version v) + http::version v) { set_start_line_impl( h_.req.method, @@ -229,10 +229,10 @@ class request_base */ void set_start_line( - http_proto::method m, + http::method m, core::string_view t, - http_proto::version v = - http_proto::version::http_1_1) + http::version v = + http::version::http_1_1) { set_start_line_impl(m, to_string(m), t, v); } @@ -266,8 +266,8 @@ class request_base set_start_line( core::string_view m, core::string_view t, - http_proto::version v = - http_proto::version::http_1_1) + http::version v = + http::version::http_1_1) { set_start_line_impl(string_to_method(m), m, t, v); } @@ -285,21 +285,21 @@ class request_base @param b If `true` sets `Expect: 100-continue` header otherwise erase it. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void set_expect_100_continue(bool b); private: - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void set_start_line_impl( - http_proto::method m, + http::method m, core::string_view ms, core::string_view t, - http_proto::version v); + http::version v); }; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/request_parser.hpp b/include/boost/http/request_parser.hpp similarity index 89% rename from include/boost/http_proto/request_parser.hpp rename to include/boost/http/request_parser.hpp index 9c4ef457..9abdc8e8 100644 --- a/include/boost/http_proto/request_parser.hpp +++ b/include/boost/http/request_parser.hpp @@ -5,20 +5,20 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_REQUEST_PARSER_HPP -#define BOOST_HTTP_PROTO_REQUEST_PARSER_HPP +#ifndef BOOST_HTTP_REQUEST_PARSER_HPP +#define BOOST_HTTP_REQUEST_PARSER_HPP -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace boost { -namespace http_proto { +namespace http { /// @copydoc parser /// @brief A parser for HTTP/1 requests. @@ -138,7 +138,7 @@ class request_parser @ref install_parser_service, @ref config. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL explicit request_parser(capy::polystore& ctx); @@ -160,12 +160,12 @@ class request_parser @see @ref got_header. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL static_request const& get() const; }; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/response.hpp b/include/boost/http/response.hpp similarity index 95% rename from include/boost/http_proto/response.hpp rename to include/boost/http/response.hpp index e4086ec2..e0f36b65 100644 --- a/include/boost/http_proto/response.hpp +++ b/include/boost/http/response.hpp @@ -6,16 +6,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_RESPONSE_HPP -#define BOOST_HTTP_PROTO_RESPONSE_HPP +#ifndef BOOST_HTTP_RESPONSE_HPP +#define BOOST_HTTP_RESPONSE_HPP -#include +#include namespace boost { -namespace http_proto { +namespace http { /** A modifiable container for HTTP responses. @@ -31,13 +31,13 @@ namespace http_proto { @code response res(status::not_found); - res.set(field::server, "Boost.HttpProto"); + res.set(field::server, "Boost.HTTP"); res.set(field::content_type, "text/plain"); res.set_content_length(80); assert(res.buffer() == "HTTP/1.1 404 Not Found\r\n" - "Server: Boost.HttpProto\r\n" + "Server: Boost.HTTP\r\n" "Content-Type: text/plain\r\n" "Content-Length: 80\r\n" "\r\n"); @@ -89,7 +89,7 @@ class response @code response res( "HTTP/1.1 404 Not Found\r\n" - "Server: Boost.HttpProto\r\n" + "Server: Boost.HTTP\r\n" "Content-Type: text/plain\r\n" "\r\n"); @endcode @@ -175,8 +175,8 @@ class response @param v The HTTP version. */ response( - http_proto::status sc, - http_proto::version v) + http::status sc, + http::version v) : response() { set_start_line(sc, v); @@ -204,9 +204,9 @@ class response */ explicit response( - http_proto::status sc) + http::status sc) : response( - sc, http_proto::version::http_1_1) + sc, http::version::http_1_1) { } @@ -448,7 +448,7 @@ class response } }; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/response_base.hpp b/include/boost/http/response_base.hpp similarity index 86% rename from include/boost/http_proto/response_base.hpp rename to include/boost/http/response_base.hpp index aea2ddb9..94e65434 100644 --- a/include/boost/http_proto/response_base.hpp +++ b/include/boost/http/response_base.hpp @@ -6,18 +6,18 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_RESPONSE_BASE_HPP -#define BOOST_HTTP_PROTO_RESPONSE_BASE_HPP +#ifndef BOOST_HTTP_RESPONSE_BASE_HPP +#define BOOST_HTTP_RESPONSE_BASE_HPP -#include -#include -#include +#include +#include +#include namespace boost { -namespace http_proto { +namespace http { /** Mixin for modifing HTTP responses. @@ -74,7 +74,7 @@ class response_base /** Return the status code. */ - http_proto::status + http::status status() const noexcept { return h_.res.status; @@ -120,9 +120,9 @@ class response_base */ void set_start_line( - http_proto::status sc, - http_proto::version v = - http_proto::version::http_1_1) + http::status sc, + http::version v = + http::version::http_1_1) { set_start_line_impl(sc, static_cast(sc), @@ -141,10 +141,10 @@ class response_base @param v The version to set. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void set_version( - http_proto::version v); + http::version v); /** Set the status code of the response. @@ -167,9 +167,9 @@ class response_base */ void set_status( - http_proto::status sc) + http::status sc) { - if(sc == http_proto::status::unknown) + if(sc == http::status::unknown) detail::throw_invalid_argument(); set_start_line_impl(sc, static_cast(sc), @@ -210,8 +210,8 @@ class response_base set_start_line( unsigned short si, core::string_view reason, - http_proto::version v = - http_proto::version::http_1_1) + http::version v = + http::version::http_1_1) { set_start_line_impl( int_to_status(si), @@ -221,16 +221,16 @@ class response_base } private: - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void set_start_line_impl( - http_proto::status sc, + http::status sc, unsigned short si, core::string_view reason, - http_proto::version v); + http::version v); }; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/response_parser.hpp b/include/boost/http/response_parser.hpp similarity index 91% rename from include/boost/http_proto/response_parser.hpp rename to include/boost/http/response_parser.hpp index 97f935c5..f17a2763 100644 --- a/include/boost/http_proto/response_parser.hpp +++ b/include/boost/http/response_parser.hpp @@ -5,20 +5,20 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_RESPONSE_PARSER_HPP -#define BOOST_HTTP_PROTO_RESPONSE_PARSER_HPP +#ifndef BOOST_HTTP_RESPONSE_PARSER_HPP +#define BOOST_HTTP_RESPONSE_PARSER_HPP -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace boost { -namespace http_proto { +namespace http { /// @copydoc parser /// @brief A parser for HTTP/1 responses. @@ -138,7 +138,7 @@ class response_parser @ref install_parser_service, @ref config. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL explicit response_parser(capy::polystore& ctx); @@ -189,12 +189,12 @@ class response_parser @see @ref got_header. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL static_response const& get() const; }; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/rfc/combine_field_values.hpp b/include/boost/http/rfc/combine_field_values.hpp similarity index 82% rename from include/boost/http_proto/rfc/combine_field_values.hpp rename to include/boost/http/rfc/combine_field_values.hpp index 1811a870..bcef648a 100644 --- a/include/boost/http_proto/rfc/combine_field_values.hpp +++ b/include/boost/http/rfc/combine_field_values.hpp @@ -4,20 +4,20 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_RFC_COMBINE_FIELD_VALUES_HPP -#define BOOST_HTTP_PROTO_RFC_COMBINE_FIELD_VALUES_HPP +#ifndef BOOST_HTTP_RFC_COMBINE_FIELD_VALUES_HPP +#define BOOST_HTTP_RFC_COMBINE_FIELD_VALUES_HPP -#include -#include +#include +#include #include #include #include namespace boost { -namespace http_proto { +namespace http { //------------------------------------------------ @@ -52,13 +52,13 @@ namespace http_proto { which may be used if necessary. The pointer may be empty. */ -BOOST_HTTP_PROTO_DECL +BOOST_HTTP_DECL core::string_view combine_field_values( fields_base::subrange const& vr, grammar::recycled_ptr& temp); -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/rfc/detail/ws.hpp b/include/boost/http/rfc/detail/ws.hpp similarity index 71% rename from include/boost/http_proto/rfc/detail/ws.hpp rename to include/boost/http/rfc/detail/ws.hpp index 20bcb04e..2125d096 100644 --- a/include/boost/http_proto/rfc/detail/ws.hpp +++ b/include/boost/http/rfc/detail/ws.hpp @@ -4,14 +4,14 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_RFC_DETAIL_WS_HPP -#define BOOST_HTTP_PROTO_RFC_DETAIL_WS_HPP +#ifndef BOOST_HTTP_RFC_DETAIL_WS_HPP +#define BOOST_HTTP_RFC_DETAIL_WS_HPP namespace boost { -namespace http_proto { +namespace http { namespace detail { // WS = SP / HTAB @@ -28,7 +28,7 @@ struct ws_t constexpr ws_t ws{}; } // detail -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/rfc/impl/list_rule.hpp b/include/boost/http/rfc/impl/list_rule.hpp similarity index 94% rename from include/boost/http_proto/rfc/impl/list_rule.hpp rename to include/boost/http/rfc/impl/list_rule.hpp index f1d65c34..5072a2bf 100644 --- a/include/boost/http_proto/rfc/impl/list_rule.hpp +++ b/include/boost/http/rfc/impl/list_rule.hpp @@ -4,13 +4,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_RFC_IMPL_LIST_RULE_HPP -#define BOOST_HTTP_PROTO_RFC_IMPL_LIST_RULE_HPP +#ifndef BOOST_HTTP_RFC_IMPL_LIST_RULE_HPP +#define BOOST_HTTP_RFC_IMPL_LIST_RULE_HPP -#include +#include #include #include @@ -18,7 +18,7 @@ #include namespace boost { -namespace http_proto { +namespace http { namespace detail { @@ -195,7 +195,7 @@ parse( } } // implementation_defined -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/rfc/list_rule.hpp b/include/boost/http/rfc/list_rule.hpp similarity index 89% rename from include/boost/http_proto/rfc/list_rule.hpp rename to include/boost/http/rfc/list_rule.hpp index 0002eab3..b27b44dd 100644 --- a/include/boost/http_proto/rfc/list_rule.hpp +++ b/include/boost/http/rfc/list_rule.hpp @@ -4,18 +4,18 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_RFC_LIST_RULE_HPP -#define BOOST_HTTP_PROTO_RFC_LIST_RULE_HPP +#ifndef BOOST_HTTP_RFC_LIST_RULE_HPP +#define BOOST_HTTP_RFC_LIST_RULE_HPP -#include +#include #include #include namespace boost { -namespace http_proto { +namespace http { namespace implementation_defined { template @@ -102,9 +102,9 @@ list_rule( return implementation_defined::list_rule_t(r, n, m); } -} // http_proto +} // http } // boost -#include +#include #endif diff --git a/include/boost/http_proto/rfc/media_type.hpp b/include/boost/http/rfc/media_type.hpp similarity index 82% rename from include/boost/http_proto/rfc/media_type.hpp rename to include/boost/http/rfc/media_type.hpp index b3747118..23083d78 100644 --- a/include/boost/http_proto/rfc/media_type.hpp +++ b/include/boost/http/rfc/media_type.hpp @@ -4,18 +4,18 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_RFC_MEDIA_TYPE_HPP -#define BOOST_HTTP_PROTO_RFC_MEDIA_TYPE_HPP +#ifndef BOOST_HTTP_RFC_MEDIA_TYPE_HPP +#define BOOST_HTTP_RFC_MEDIA_TYPE_HPP -#include -#include +#include +#include #include namespace boost { -namespace http_proto { +namespace http { /** A mime-type */ @@ -53,7 +53,7 @@ struct media_type_rule_t { using value_type = media_type; - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL auto parse( char const*& it, @@ -81,7 +81,7 @@ struct media_type_rule_t */ BOOST_INLINE_CONSTEXPR implementation_defined::media_type_rule_t media_type_rule{}; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/rfc/parameter.hpp b/include/boost/http/rfc/parameter.hpp similarity index 82% rename from include/boost/http_proto/rfc/parameter.hpp rename to include/boost/http/rfc/parameter.hpp index 8d4f917a..5309125c 100644 --- a/include/boost/http_proto/rfc/parameter.hpp +++ b/include/boost/http/rfc/parameter.hpp @@ -4,18 +4,18 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_RFC_PARAMETER_HPP -#define BOOST_HTTP_PROTO_RFC_PARAMETER_HPP +#ifndef BOOST_HTTP_RFC_PARAMETER_HPP +#define BOOST_HTTP_RFC_PARAMETER_HPP -#include -#include +#include +#include #include namespace boost { -namespace http_proto { +namespace http { /** An HTTP header parameter @@ -41,7 +41,7 @@ struct parameter_rule_t { using value_type = parameter; - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL auto parse( char const*&, @@ -75,7 +75,7 @@ struct parameter_rule_t */ BOOST_INLINE_CONSTEXPR implementation_defined::parameter_rule_t parameter_rule{}; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/rfc/quoted_token_rule.hpp b/include/boost/http/rfc/quoted_token_rule.hpp similarity index 80% rename from include/boost/http_proto/rfc/quoted_token_rule.hpp rename to include/boost/http/rfc/quoted_token_rule.hpp index c78fc33b..68f6a6e4 100644 --- a/include/boost/http_proto/rfc/quoted_token_rule.hpp +++ b/include/boost/http/rfc/quoted_token_rule.hpp @@ -4,26 +4,26 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_RFC_QUOTED_TOKEN_RULE_HPP -#define BOOST_HTTP_PROTO_RFC_QUOTED_TOKEN_RULE_HPP +#ifndef BOOST_HTTP_RFC_QUOTED_TOKEN_RULE_HPP +#define BOOST_HTTP_RFC_QUOTED_TOKEN_RULE_HPP -#include -#include +#include +#include #include #include namespace boost { -namespace http_proto { +namespace http { namespace implementation_defined { struct quoted_token_rule_t { using value_type = quoted_token_view; - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL auto parse( char const*& it, @@ -63,7 +63,7 @@ struct quoted_token_rule_t */ BOOST_INLINE_CONSTEXPR implementation_defined::quoted_token_rule_t quoted_token_rule{}; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/rfc/quoted_token_view.hpp b/include/boost/http/rfc/quoted_token_view.hpp similarity index 88% rename from include/boost/http_proto/rfc/quoted_token_view.hpp rename to include/boost/http/rfc/quoted_token_view.hpp index c31650ed..ce0cb178 100644 --- a/include/boost/http_proto/rfc/quoted_token_view.hpp +++ b/include/boost/http/rfc/quoted_token_view.hpp @@ -4,18 +4,18 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_RFC_QUOTED_TOKEN_VIEW_HPP -#define BOOST_HTTP_PROTO_RFC_QUOTED_TOKEN_VIEW_HPP +#ifndef BOOST_HTTP_RFC_QUOTED_TOKEN_VIEW_HPP +#define BOOST_HTTP_RFC_QUOTED_TOKEN_VIEW_HPP -#include +#include #include #include namespace boost { -namespace http_proto { +namespace http { namespace implementation_defined { struct quoted_token_rule_t; @@ -94,7 +94,7 @@ class quoted_token_view final } }; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/rfc/token_rule.hpp b/include/boost/http/rfc/token_rule.hpp similarity index 85% rename from include/boost/http_proto/rfc/token_rule.hpp rename to include/boost/http/rfc/token_rule.hpp index 4c90b831..cbeb53ba 100644 --- a/include/boost/http_proto/rfc/token_rule.hpp +++ b/include/boost/http/rfc/token_rule.hpp @@ -4,18 +4,18 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_RFC_TOKEN_RULE_HPP -#define BOOST_HTTP_PROTO_RFC_TOKEN_RULE_HPP +#ifndef BOOST_HTTP_RFC_TOKEN_RULE_HPP +#define BOOST_HTTP_RFC_TOKEN_RULE_HPP -#include +#include #include #include namespace boost { -namespace http_proto { +namespace http { /** The set of token characters @@ -60,7 +60,7 @@ BOOST_INLINE_CONSTEXPR grammar::lut_chars tchars = */ BOOST_INLINE_CONSTEXPR auto token_rule = grammar::token_rule( tchars ); -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/rfc/upgrade_rule.hpp b/include/boost/http/rfc/upgrade_rule.hpp similarity index 87% rename from include/boost/http_proto/rfc/upgrade_rule.hpp rename to include/boost/http/rfc/upgrade_rule.hpp index 80a89673..f3fd5d73 100644 --- a/include/boost/http_proto/rfc/upgrade_rule.hpp +++ b/include/boost/http/rfc/upgrade_rule.hpp @@ -4,18 +4,18 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_RFC_UPGRADE_RULE_HPP -#define BOOST_HTTP_PROTO_RFC_UPGRADE_RULE_HPP +#ifndef BOOST_HTTP_RFC_UPGRADE_RULE_HPP +#define BOOST_HTTP_RFC_UPGRADE_RULE_HPP -#include -#include +#include +#include #include namespace boost { -namespace http_proto { +namespace http { //------------------------------------------------ @@ -42,7 +42,7 @@ struct upgrade_protocol_rule_t { using value_type = upgrade_protocol; - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL auto parse( char const*& it, @@ -109,7 +109,7 @@ BOOST_INLINE_CONSTEXPR implementation_defined::upgrade_protocol_rule_t upgrade_p */ BOOST_INLINE_CONSTEXPR auto upgrade_rule = list_rule( upgrade_protocol_rule, 1 ); -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/serializer.hpp b/include/boost/http/serializer.hpp similarity index 96% rename from include/boost/http_proto/serializer.hpp rename to include/boost/http/serializer.hpp index e0e65d08..396d7b24 100644 --- a/include/boost/http_proto/serializer.hpp +++ b/include/boost/http/serializer.hpp @@ -5,15 +5,15 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_SERIALIZER_HPP -#define BOOST_HTTP_PROTO_SERIALIZER_HPP +#ifndef BOOST_HTTP_SERIALIZER_HPP +#define BOOST_HTTP_SERIALIZER_HPP -#include -#include -#include +#include +#include +#include #include #include @@ -24,7 +24,7 @@ #include namespace boost { -namespace http_proto { +namespace http { // Forward declaration class message_base; @@ -68,7 +68,7 @@ class serializer /** Destructor */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL ~serializer(); /** Constructor @@ -100,7 +100,7 @@ class serializer @param other The serializer to move from. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL serializer( serializer&& other) noexcept; @@ -119,7 +119,7 @@ class serializer @param other The serializer to move from. @return A reference to this object. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL serializer& operator=(serializer&& other) noexcept; @@ -168,7 +168,7 @@ class serializer @ref install_serializer_service, @ref config. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL explicit serializer( capy::polystore& ctx); @@ -179,7 +179,7 @@ class serializer prepares the serializer to start serialization of a new message. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void reset() noexcept; @@ -217,7 +217,7 @@ class serializer @ref message_base. */ void - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL start(message_base const& m); /** Start serializing a message with a buffer sequence body @@ -424,7 +424,7 @@ class serializer @ref stream, @ref message_base. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL stream start_stream( message_base const& m); @@ -484,7 +484,7 @@ class serializer @ref is_done, @ref const_buffers_type. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL auto prepare() -> system::result< @@ -524,13 +524,13 @@ class serializer @ref is_done, @ref const_buffers_type. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void consume(std::size_t n); /** Return true if serialization is complete. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL bool is_done() const noexcept; @@ -540,22 +540,22 @@ class serializer template class cbs_gen_impl; - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL detail::workspace& ws(); - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void start_init( message_base const&); - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void start_buffers( message_base const&, cbs_gen&); - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void start_source( message_base const&, @@ -665,7 +665,7 @@ struct serializer::config @ref serializer::config, @ref serializer. */ -BOOST_HTTP_PROTO_DECL +BOOST_HTTP_DECL void install_serializer_service( capy::polystore& ctx, @@ -774,7 +774,7 @@ class serializer::stream @throw std::logic_error `this->is_open() == false`. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL std::size_t capacity() const; @@ -805,7 +805,7 @@ class serializer::stream @ref commit, @ref capacity. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL mutable_buffers_type prepare(); @@ -837,7 +837,7 @@ class serializer::stream @ref prepare, @ref capacity. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void commit(std::size_t n); @@ -855,7 +855,7 @@ class serializer::stream this->is_open() == false @endcode */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void close() noexcept; @@ -880,9 +880,9 @@ class serializer::stream serializer::impl* impl_ = nullptr; }; -} // http_proto +} // http } // boost -#include +#include #endif diff --git a/include/boost/http_proto/server/basic_router.hpp b/include/boost/http/server/basic_router.hpp similarity index 94% rename from include/boost/http_proto/server/basic_router.hpp rename to include/boost/http/server/basic_router.hpp index d7dab1d3..db24769a 100644 --- a/include/boost/http_proto/server/basic_router.hpp +++ b/include/boost/http/server/basic_router.hpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_SERVER_BASIC_ROUTER_HPP -#define BOOST_HTTP_PROTO_SERVER_BASIC_ROUTER_HPP +#ifndef BOOST_HTTP_SERVER_BASIC_ROUTER_HPP +#define BOOST_HTTP_SERVER_BASIC_ROUTER_HPP -#include -#include -#include -#include +#include +#include +#include +#include #include // VFALCO fix #include #include @@ -23,7 +23,7 @@ #include namespace boost { -namespace http_proto { +namespace http { template class basic_router; @@ -144,10 +144,10 @@ class any_router { private: template - friend class http_proto::basic_router; + friend class http::basic_router; using opt_flags = unsigned int; - struct BOOST_HTTP_PROTO_DECL any_handler + struct BOOST_HTTP_DECL any_handler { virtual ~any_handler() = default; virtual std::size_t count() const noexcept = 0; @@ -168,25 +168,25 @@ class any_router struct layer; struct impl; - BOOST_HTTP_PROTO_DECL ~any_router(); - BOOST_HTTP_PROTO_DECL any_router(opt_flags); - BOOST_HTTP_PROTO_DECL any_router(any_router&&) noexcept; - BOOST_HTTP_PROTO_DECL any_router(any_router const&) noexcept; - BOOST_HTTP_PROTO_DECL any_router& operator=(any_router&&) noexcept; - BOOST_HTTP_PROTO_DECL any_router& operator=(any_router const&) noexcept; - BOOST_HTTP_PROTO_DECL std::size_t count() const noexcept; - BOOST_HTTP_PROTO_DECL layer& new_layer(core::string_view pattern); - BOOST_HTTP_PROTO_DECL void add_impl(core::string_view, handler_list const&); - BOOST_HTTP_PROTO_DECL void add_impl(layer&, - http_proto::method, handler_list const&); - BOOST_HTTP_PROTO_DECL void add_impl(layer&, + BOOST_HTTP_DECL ~any_router(); + BOOST_HTTP_DECL any_router(opt_flags); + BOOST_HTTP_DECL any_router(any_router&&) noexcept; + BOOST_HTTP_DECL any_router(any_router const&) noexcept; + BOOST_HTTP_DECL any_router& operator=(any_router&&) noexcept; + BOOST_HTTP_DECL any_router& operator=(any_router const&) noexcept; + BOOST_HTTP_DECL std::size_t count() const noexcept; + BOOST_HTTP_DECL layer& new_layer(core::string_view pattern); + BOOST_HTTP_DECL void add_impl(core::string_view, handler_list const&); + BOOST_HTTP_DECL void add_impl(layer&, + http::method, handler_list const&); + BOOST_HTTP_DECL void add_impl(layer&, core::string_view, handler_list const&); - BOOST_HTTP_PROTO_DECL route_result resume_impl( + BOOST_HTTP_DECL route_result resume_impl( route_params_base&, route_result ec) const; - BOOST_HTTP_PROTO_DECL route_result dispatch_impl(http_proto::method, + BOOST_HTTP_DECL route_result dispatch_impl(http::method, core::string_view, urls::url_view const&, route_params_base&) const; - BOOST_HTTP_PROTO_DECL route_result dispatch_impl( + BOOST_HTTP_DECL route_result dispatch_impl( route_params_base&) const; route_result do_dispatch(route_params_base&) const; @@ -675,7 +675,7 @@ class basic_router : public /*detail::*/any_router */ template void add( - http_proto::method verb, + http::method verb, core::string_view pattern, H1&& h1, HN&&... hn) { @@ -755,7 +755,7 @@ class basic_router : public /*detail::*/any_router must use distinct params objects. @param verb The HTTP method to match. This must not be - @ref http_proto::method::unknown. + @ref http::method::unknown. @param url The full request target used for route matching. @@ -764,16 +764,16 @@ class basic_router : public /*detail::*/any_router @return The @ref route_result describing how routing completed. @throws std::invalid_argument If @p verb is - @ref http_proto::method::unknown. + @ref http::method::unknown. */ auto dispatch( - http_proto::method verb, + http::method verb, urls::url_view const& url, Params& p) const -> route_result { - if(verb == http_proto::method::unknown) + if(verb == http::method::unknown) detail::throw_invalid_argument(); return dispatch_impl(verb, core::string_view(), url, p); @@ -784,7 +784,7 @@ class basic_router : public /*detail::*/any_router This runs the routing and error-dispatch logic for the given HTTP method string and target URL, as described in the @ref basic_router class documentation. This overload is intended for method tokens - that are not represented by @ref http_proto::method. + that are not represented by @ref http::method. @par Thread Safety @@ -814,7 +814,7 @@ class basic_router : public /*detail::*/any_router if(verb.empty()) detail::throw_invalid_argument(); return dispatch_impl( - http_proto::method::unknown, + http::method::unknown, verb, url, p); } @@ -936,10 +936,10 @@ class basic_router : public /*detail::*/any_router route_params_base& p_(p); if( p_.ec_.failed() || p_.ep_) - return http_proto::route::next; + return http::route::next; set_resume u(p_); auto rv = h(p); - if(rv == http_proto::route::suspend) + if(rv == http::route::suspend) { u.apply(); return rv; @@ -954,10 +954,10 @@ class basic_router : public /*detail::*/any_router { route_params_base& p_(p); if(! p_.ec_.failed()) - return http_proto::route::next; + return http::route::next; set_resume u(p_); auto rv = h(p, p_.ec_); - if(rv == http_proto::route::suspend) + if(rv == http::route::suspend) { u.apply(); return rv; @@ -974,7 +974,7 @@ class basic_router : public /*detail::*/any_router ( ! p_.ec_.failed() && ! p_.ep_)) return h.dispatch_impl(p); - return http_proto::route::next; + return http::route::next; } }; @@ -1002,7 +1002,7 @@ class basic_router : public /*detail::*/any_router #ifndef BOOST_NO_EXCEPTIONS route_params_base& p_(p); if(! p_.ep_) - return http_proto::route::next; + return http::route::next; try { std::rethrow_exception(p_.ep_); @@ -1021,7 +1021,7 @@ class basic_router : public /*detail::*/any_router set_resume u(p_); // VFALCO What if h throws? auto rv = h(p, ex); - if(rv == http_proto::route::suspend) + if(rv == http::route::suspend) { u.apply(); return rv; @@ -1031,11 +1031,11 @@ class basic_router : public /*detail::*/any_router catch(...) { BOOST_ASSERT(p_.ep_); - return http_proto::route::next; + return http::route::next; } #else (void)p; - return http_proto::route::next; + return http::route::next; #endif } }; @@ -1105,7 +1105,7 @@ class basic_router : public /*detail::*/any_router } void append(layer& e, - http_proto::method verb, + http::method verb, handler_list const& handlers) { add_impl(e, verb, handlers); @@ -1179,7 +1179,7 @@ class basic_router:: */ template auto add( - http_proto::method verb, + http::method verb, H1&& h1, HN&&... hn) -> fluent_route { @@ -1197,7 +1197,7 @@ class basic_router:: This registers regular handlers for the given HTTP method string on the current route, participating in dispatch as described in the @ref basic_router class documentation. This overload is - intended for methods not represented by @ref http_proto::method. + intended for methods not represented by @ref http::method. Handlers are appended to the route's handler sequence and invoked in registration order whenever a preceding handler returns @ref route::next. Error handlers and routers cannot be passed here. @@ -1240,7 +1240,7 @@ class basic_router:: basic_router& owner_; }; -} // http_proto +} // http } // boost #endif \ No newline at end of file diff --git a/include/boost/http_proto/server/cors.hpp b/include/boost/http/server/cors.hpp similarity index 66% rename from include/boost/http_proto/server/cors.hpp rename to include/boost/http/server/cors.hpp index b936ed0a..b69cae58 100644 --- a/include/boost/http_proto/server/cors.hpp +++ b/include/boost/http/server/cors.hpp @@ -4,19 +4,19 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_SERVER_CORS_HPP -#define BOOST_HTTP_PROTO_SERVER_CORS_HPP +#ifndef BOOST_HTTP_SERVER_CORS_HPP +#define BOOST_HTTP_SERVER_CORS_HPP -#include -#include -#include +#include +#include +#include #include namespace boost { -namespace http_proto { +namespace http { struct cors_options { @@ -33,11 +33,11 @@ struct cors_options class cors { public: - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL explicit cors( cors_options options = {}) noexcept; - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL route_result operator()(route_params& p) const; @@ -45,7 +45,7 @@ class cors cors_options options_; }; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/server/route_handler.hpp b/include/boost/http/server/route_handler.hpp similarity index 84% rename from include/boost/http_proto/server/route_handler.hpp rename to include/boost/http/server/route_handler.hpp index 391813b9..f85d14ed 100644 --- a/include/boost/http_proto/server/route_handler.hpp +++ b/include/boost/http/server/route_handler.hpp @@ -4,28 +4,28 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_SERVER_ROUTE_HANDLER_HPP -#define BOOST_HTTP_PROTO_SERVER_ROUTE_HANDLER_HPP +#ifndef BOOST_HTTP_SERVER_ROUTE_HANDLER_HPP +#define BOOST_HTTP_SERVER_ROUTE_HANDLER_HPP -#include -#include +#include +#include #include #include #include -#include // VFALCO forward declare? -#include // VFALCO forward declare? -#include // VFALCO forward declare? -#include // VFALCO forward declare? +#include // VFALCO forward declare? +#include // VFALCO forward declare? +#include // VFALCO forward declare? +#include // VFALCO forward declare? #include #include #include #include namespace boost { -namespace http_proto { +namespace http { struct acceptor_config { @@ -37,7 +37,7 @@ struct acceptor_config /** Parameters object for HTTP route handlers */ -struct BOOST_HTTP_PROTO_SYMBOL_VISIBLE +struct BOOST_HTTP_SYMBOL_VISIBLE route_params : route_params_base { /** The complete request target @@ -50,20 +50,20 @@ struct BOOST_HTTP_PROTO_SYMBOL_VISIBLE /** The HTTP request message */ - http_proto::request req; + http::request req; /** The HTTP response message */ - http_proto::response res; + http::response res; /** The HTTP request parser This can be used to take over reading the body. */ - http_proto::request_parser parser; + http::request_parser parser; /** The HTTP response serializer */ - http_proto::serializer serializer; + http::serializer serializer; /** A container for storing arbitrary data associated with the request. This starts out empty for each new request. @@ -88,7 +88,7 @@ struct BOOST_HTTP_PROTO_SYMBOL_VISIBLE /** Destructor */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL ~route_params(); /** Reset the object for a new request. @@ -96,22 +96,22 @@ struct BOOST_HTTP_PROTO_SYMBOL_VISIBLE the previous request, preparing the object for use with a new request. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL void reset(); /** Set the status code of the response. @par Example @code - res.status( http_proto::status::not_found ); + res.status( http::status::not_found ); @endcode @param code The status code to set. @return A reference to this response. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL route_params& - status(http_proto::status code); + status(http::status code); - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL route_params& set_body(std::string s); @@ -154,7 +154,7 @@ struct BOOST_HTTP_PROTO_SYMBOL_VISIBLE Callback&& callback) -> route_result; -#ifdef BOOST_HTTP_PROTO_HAS_CORO +#ifdef BOOST_HTTP_HAS_CORO /** Spawn a coroutine for this route. @@ -180,7 +180,7 @@ struct BOOST_HTTP_PROTO_SYMBOL_VISIBLE @return The route result, which must be returned immediately from the route handler. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL auto spawn( capy::task coro) -> route_result; @@ -240,7 +240,7 @@ read_body( //----------------------------------------------- -#ifdef BOOST_HTTP_PROTO_HAS_CORO +#ifdef BOOST_HTTP_HAS_CORO /** Create a route handler from a coroutine function @@ -270,7 +270,7 @@ co_route(std::function< #endif -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/server/router.hpp b/include/boost/http/server/router.hpp similarity index 64% rename from include/boost/http_proto/server/router.hpp rename to include/boost/http/server/router.hpp index 97d1072b..5fd9fe23 100644 --- a/include/boost/http_proto/server/router.hpp +++ b/include/boost/http/server/router.hpp @@ -4,17 +4,17 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_SERVER_ROUTER_HPP -#define BOOST_HTTP_PROTO_SERVER_ROUTER_HPP +#ifndef BOOST_HTTP_SERVER_ROUTER_HPP +#define BOOST_HTTP_SERVER_ROUTER_HPP -#include -#include +#include +#include namespace boost { -namespace http_proto { +namespace http { struct route_params; @@ -29,7 +29,7 @@ struct route_params; */ using router = basic_router; -} // http_proto +} // http } // boost #endif \ No newline at end of file diff --git a/include/boost/http_proto/server/router_types.hpp b/include/boost/http/server/router_types.hpp similarity index 90% rename from include/boost/http_proto/server/router_types.hpp rename to include/boost/http/server/router_types.hpp index b9948750..d60fc780 100644 --- a/include/boost/http_proto/server/router_types.hpp +++ b/include/boost/http/server/router_types.hpp @@ -4,15 +4,15 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_SERVER_ROUTER_TYPES_HPP -#define BOOST_HTTP_PROTO_SERVER_ROUTER_TYPES_HPP +#ifndef BOOST_HTTP_SERVER_ROUTER_TYPES_HPP +#define BOOST_HTTP_SERVER_ROUTER_TYPES_HPP -#include -#include -#include +#include +#include +#include #include #include #include @@ -20,7 +20,7 @@ #include namespace boost { -namespace http_proto { +namespace http { /** The result type returned by a route handler. @@ -101,31 +101,31 @@ enum class route //------------------------------------------------ -} // http_proto +} // http namespace system { template<> struct is_error_code_enum< - ::boost::http_proto::route> + ::boost::http::route> { static bool const value = true; }; } // system -namespace http_proto { +namespace http { namespace detail { -struct BOOST_HTTP_PROTO_SYMBOL_VISIBLE route_cat_type +struct BOOST_HTTP_SYMBOL_VISIBLE route_cat_type : system::error_category { - BOOST_HTTP_PROTO_DECL const char* name() const noexcept override; - BOOST_HTTP_PROTO_DECL std::string message(int) const override; - BOOST_HTTP_PROTO_DECL char const* message( + BOOST_HTTP_DECL const char* name() const noexcept override; + BOOST_HTTP_DECL std::string message(int) const override; + BOOST_HTTP_DECL char const* message( int, char*, std::size_t) const noexcept override; BOOST_SYSTEM_CONSTEXPR route_cat_type() : error_category(0x51c90d393754ecdf ) { } }; -BOOST_HTTP_PROTO_DECL extern route_cat_type route_cat; +BOOST_HTTP_DECL extern route_cat_type route_cat; } // detail inline @@ -164,10 +164,10 @@ class suspender public: /** Base class of the implementation */ - struct BOOST_HTTP_PROTO_SYMBOL_VISIBLE + struct BOOST_HTTP_SYMBOL_VISIBLE owner { - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL virtual resumer do_suspend(); virtual void do_resume(route_result const&) = 0; virtual void do_resume(std::exception_ptr) = 0; @@ -323,14 +323,14 @@ class route_params_base /** Return true if the request method matches `m` */ bool is_method( - http_proto::method m) const noexcept + http::method m) const noexcept { return verb_ == m; } /** Return true if the request method matches `s` */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL bool is_method( core::string_view s) const noexcept; @@ -361,14 +361,14 @@ class route_params_base std::exception_ptr ep_; std::size_t pos_ = 0; std::size_t resume_ = 0; - http_proto::method verb_ = - http_proto::method::unknown; + http::method verb_ = + http::method::unknown; bool addedSlash_ = false; bool case_sensitive = false; bool strict = false; }; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/sink.hpp b/include/boost/http/sink.hpp similarity index 93% rename from include/boost/http_proto/sink.hpp rename to include/boost/http/sink.hpp index 2e1ed88f..bf6bab58 100644 --- a/include/boost/http_proto/sink.hpp +++ b/include/boost/http/sink.hpp @@ -4,13 +4,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_SINK_HPP -#define BOOST_HTTP_PROTO_SINK_HPP +#ifndef BOOST_HTTP_SINK_HPP +#define BOOST_HTTP_SINK_HPP -#include +#include #include #include #include @@ -18,7 +18,7 @@ #include namespace boost { -namespace http_proto { +namespace http { /** An interface for consuming buffers of data. @@ -36,7 +36,7 @@ namespace http_proto { @ref source, @ref parser. */ -struct BOOST_HTTP_PROTO_SYMBOL_VISIBLE +struct BOOST_HTTP_SYMBOL_VISIBLE sink { /** The results of consuming data. @@ -57,7 +57,7 @@ struct BOOST_HTTP_PROTO_SYMBOL_VISIBLE operator+=( results const& rv) noexcept; - #ifdef BOOST_HTTP_PROTO_AGGREGATE_WORKAROUND + #ifdef BOOST_HTTP_AGGREGATE_WORKAROUND constexpr results() = default; @@ -188,7 +188,7 @@ struct BOOST_HTTP_PROTO_SYMBOL_VISIBLE @param more `true` if there will be one or more subsequent calls. */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL virtual results on_write( @@ -240,9 +240,9 @@ using is_sink = typename std::decay::type*, sink*>; -} // http_proto +} // http } // boost -#include +#include #endif diff --git a/include/boost/http_proto/source.hpp b/include/boost/http/source.hpp similarity index 93% rename from include/boost/http_proto/source.hpp rename to include/boost/http/source.hpp index 6e719f57..cc4b2d3e 100644 --- a/include/boost/http_proto/source.hpp +++ b/include/boost/http/source.hpp @@ -4,13 +4,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_SOURCE_HPP -#define BOOST_HTTP_PROTO_SOURCE_HPP +#ifndef BOOST_HTTP_SOURCE_HPP +#define BOOST_HTTP_SOURCE_HPP -#include +#include #include #include #include @@ -18,7 +18,7 @@ #include namespace boost { -namespace http_proto { +namespace http { /** An interface for producing buffers of data. @@ -36,7 +36,7 @@ namespace http_proto { @ref sink, @ref serializer. */ -struct BOOST_HTTP_PROTO_SYMBOL_VISIBLE +struct BOOST_HTTP_SYMBOL_VISIBLE source { /** The results of producing data. @@ -61,7 +61,7 @@ struct BOOST_HTTP_PROTO_SYMBOL_VISIBLE operator+=( results const& rv) noexcept; - #ifdef BOOST_HTTP_PROTO_AGGREGATE_WORKAROUND + #ifdef BOOST_HTTP_AGGREGATE_WORKAROUND constexpr results() = default; @@ -191,7 +191,7 @@ struct BOOST_HTTP_PROTO_SYMBOL_VISIBLE indicate failure or that no more data remains (or both). */ - BOOST_HTTP_PROTO_DECL + BOOST_HTTP_DECL virtual results on_read( @@ -232,9 +232,9 @@ using is_source = typename std::decay::type*, source*>; -} // http_proto +} // http } // boost -#include +#include #endif diff --git a/include/boost/http_proto/static_request.hpp b/include/boost/http/static_request.hpp similarity index 94% rename from include/boost/http_proto/static_request.hpp rename to include/boost/http/static_request.hpp index b13ff1a4..371b8de9 100644 --- a/include/boost/http_proto/static_request.hpp +++ b/include/boost/http/static_request.hpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_STATIC_REQUEST_HPP -#define BOOST_HTTP_PROTO_STATIC_REQUEST_HPP +#ifndef BOOST_HTTP_STATIC_REQUEST_HPP +#define BOOST_HTTP_STATIC_REQUEST_HPP -#include +#include namespace boost { -namespace http_proto { +namespace http { /** A modifiable static container for HTTP requests. @@ -188,7 +188,7 @@ class static_request } }; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/static_response.hpp b/include/boost/http/static_response.hpp similarity index 92% rename from include/boost/http_proto/static_response.hpp rename to include/boost/http/static_response.hpp index 3a9e2702..34f39b3b 100644 --- a/include/boost/http_proto/static_response.hpp +++ b/include/boost/http/static_response.hpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_STATIC_RESPONSE_HPP -#define BOOST_HTTP_PROTO_STATIC_RESPONSE_HPP +#ifndef BOOST_HTTP_STATIC_RESPONSE_HPP +#define BOOST_HTTP_STATIC_RESPONSE_HPP -#include +#include namespace boost { -namespace http_proto { +namespace http { /** A modifiable static container for HTTP responses. @@ -30,13 +30,13 @@ namespace http_proto { static_response res(buf, sizeof(buf)); res.set_start_line(status::not_found); - res.set(field::server, "Boost.HttpProto"); + res.set(field::server, "Boost.HTTP"); res.set(field::content_type, "text/plain"); res.set_content_length(80); assert(res.buffer() == "HTTP/1.1 404 Not Found\r\n" - "Server: Boost.HttpProto\r\n" + "Server: Boost.HTTP\r\n" "Content-Type: text/plain\r\n" "Content-Length: 80\r\n" "\r\n"); @@ -187,7 +187,7 @@ class static_response } }; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/status.hpp b/include/boost/http/status.hpp similarity index 94% rename from include/boost/http_proto/status.hpp rename to include/boost/http/status.hpp index e477bf86..55e9be3f 100644 --- a/include/boost/http_proto/status.hpp +++ b/include/boost/http/status.hpp @@ -4,18 +4,18 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_STATUS_HPP -#define BOOST_HTTP_PROTO_STATUS_HPP +#ifndef BOOST_HTTP_STATUS_HPP +#define BOOST_HTTP_STATUS_HPP -#include +#include #include #include namespace boost { -namespace http_proto { +namespace http { /** Represents standard HTTP status codes. */ @@ -144,7 +144,7 @@ enum class status_class : unsigned char @param v The integer representing a status code. */ -BOOST_HTTP_PROTO_DECL +BOOST_HTTP_DECL status int_to_status(unsigned v); @@ -156,7 +156,7 @@ int_to_status(unsigned v); @param v The integer representing a status code. */ -BOOST_HTTP_PROTO_DECL +BOOST_HTTP_DECL status_class to_status_class(unsigned v); @@ -166,7 +166,7 @@ to_status_class(unsigned v); @param v The status code to convert. */ -BOOST_HTTP_PROTO_DECL +BOOST_HTTP_DECL status_class to_status_class(status v); @@ -174,7 +174,7 @@ to_status_class(status v); @param v The status code to use. */ -BOOST_HTTP_PROTO_DECL +BOOST_HTTP_DECL core::string_view to_string(status v); @@ -186,11 +186,11 @@ to_string(status v); @param v The status code to use. */ -BOOST_HTTP_PROTO_DECL +BOOST_HTTP_DECL std::ostream& operator<<(std::ostream& os, status v); -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/string_body.hpp b/include/boost/http/string_body.hpp similarity index 89% rename from include/boost/http_proto/string_body.hpp rename to include/boost/http/string_body.hpp index 6242bd79..310ed808 100644 --- a/include/boost/http_proto/string_body.hpp +++ b/include/boost/http/string_body.hpp @@ -4,19 +4,19 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_STRING_BODY_HPP -#define BOOST_HTTP_PROTO_STRING_BODY_HPP +#ifndef BOOST_HTTP_STRING_BODY_HPP +#define BOOST_HTTP_STRING_BODY_HPP -#include +#include #include #include #include namespace boost { -namespace http_proto { +namespace http { /** A ConstBufferSequence adapter for an owned `std::string`. @@ -97,7 +97,7 @@ class string_body } }; -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto/version.hpp b/include/boost/http/version.hpp similarity index 76% rename from include/boost/http_proto/version.hpp rename to include/boost/http/version.hpp index 7cb5a2ca..326a4765 100644 --- a/include/boost/http_proto/version.hpp +++ b/include/boost/http/version.hpp @@ -4,18 +4,18 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_VERSION_HPP -#define BOOST_HTTP_PROTO_VERSION_HPP +#ifndef BOOST_HTTP_VERSION_HPP +#define BOOST_HTTP_VERSION_HPP -#include +#include #include #include namespace boost { -namespace http_proto { +namespace http { /** Constants representing HTTP versions. @@ -31,7 +31,7 @@ enum class version : char @param v The version to use. */ -BOOST_HTTP_PROTO_DECL +BOOST_HTTP_DECL core::string_view to_string(version v); @@ -43,11 +43,11 @@ to_string(version v); @param v The version to use. */ -BOOST_HTTP_PROTO_DECL +BOOST_HTTP_DECL std::ostream& operator<<(std::ostream& os, version v); -} // http_proto +} // http } // boost #endif diff --git a/include/boost/http_proto.hpp b/include/boost/http_proto.hpp deleted file mode 100644 index de591acd..00000000 --- a/include/boost/http_proto.hpp +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// -// Official repository: https://github.com/cppalliance/http_proto -// - -#ifndef BOOST_HTTP_PROTO_HPP -#define BOOST_HTTP_PROTO_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -//#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#endif diff --git a/index.html b/index.html index 43019f5a..be7e10a7 100644 --- a/index.html +++ b/index.html @@ -1,6 +1,6 @@ - Boost.HTTP.Proto + Boost.HTTP @@ -8,7 +8,7 @@ ./doc/html/index.html
- Boost.HTTP.Proto
+ Boost.HTTP

Copyright (C) 2019 Vinnie Falco

diff --git a/meta/explicit-failures-markup.xml b/meta/explicit-failures-markup.xml index 8a392643..d42e30c1 100644 --- a/meta/explicit-failures-markup.xml +++ b/meta/explicit-failures-markup.xml @@ -1,7 +1,7 @@ - - + + diff --git a/meta/libraries.json b/meta/libraries.json index 4fc8d6c2..9523afea 100644 --- a/meta/libraries.json +++ b/meta/libraries.json @@ -1,6 +1,6 @@ { - "key": "http_proto", - "name": "HTTP Proto", + "key": "http", + "name": "HTTP", "authors": [ "Vinnie Falco" ], diff --git a/src/detail/array_of_const_buffers.cpp b/src/detail/array_of_const_buffers.cpp index b8a939a0..4225eb7a 100644 --- a/src/detail/array_of_const_buffers.cpp +++ b/src/detail/array_of_const_buffers.cpp @@ -5,17 +5,17 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // #include "src/detail/array_of_const_buffers.hpp" -#include +#include #include namespace boost { -namespace http_proto { +namespace http { namespace detail { array_of_const_buffers:: @@ -78,5 +78,5 @@ append(value_type buf) noexcept } } // detail -} // http_proto +} // http } // boost diff --git a/src/detail/array_of_const_buffers.hpp b/src/detail/array_of_const_buffers.hpp index 0db72cb9..863f3950 100644 --- a/src/detail/array_of_const_buffers.hpp +++ b/src/detail/array_of_const_buffers.hpp @@ -5,11 +5,11 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_DETAIL_ARRAY_OF_BUFFERS_HPP -#define BOOST_HTTP_PROTO_DETAIL_ARRAY_OF_BUFFERS_HPP +#ifndef BOOST_HTTP_DETAIL_ARRAY_OF_BUFFERS_HPP +#define BOOST_HTTP_DETAIL_ARRAY_OF_BUFFERS_HPP #include #include @@ -17,7 +17,7 @@ #include namespace boost { -namespace http_proto { +namespace http { namespace detail { class array_of_const_buffers @@ -100,7 +100,7 @@ class array_of_const_buffers }; } // detail -} // http_proto +} // http } // boost #endif diff --git a/src/detail/brotli_filter_base.hpp b/src/detail/brotli_filter_base.hpp index f4a96aa4..4fa560a8 100644 --- a/src/detail/brotli_filter_base.hpp +++ b/src/detail/brotli_filter_base.hpp @@ -8,15 +8,15 @@ // Official repository: https://github.com/cppalliance/buffers // -#ifndef BOOST_HTTP_PROTO_DETAIL_BROTLI_FILTER_BASE_HPP -#define BOOST_HTTP_PROTO_DETAIL_BROTLI_FILTER_BASE_HPP +#ifndef BOOST_HTTP_DETAIL_BROTLI_FILTER_BASE_HPP +#define BOOST_HTTP_DETAIL_BROTLI_FILTER_BASE_HPP -#include +#include #include "src/detail/filter.hpp" namespace boost { -namespace http_proto { +namespace http { namespace detail { /** Base class for brotli filters @@ -43,7 +43,7 @@ class brotli_filter_base : public filter }; } // detail -} // http_proto +} // http } // boost #endif diff --git a/src/detail/buffer_utils.hpp b/src/detail/buffer_utils.hpp index 0041b87d..2dd62d2f 100644 --- a/src/detail/buffer_utils.hpp +++ b/src/detail/buffer_utils.hpp @@ -4,18 +4,18 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_DETAIL_BUFFER_UTILS_HPP -#define BOOST_HTTP_PROTO_DETAIL_BUFFER_UTILS_HPP +#ifndef BOOST_HTTP_DETAIL_BUFFER_UTILS_HPP +#define BOOST_HTTP_DETAIL_BUFFER_UTILS_HPP #include #include #include namespace boost { -namespace http_proto { +namespace http { namespace detail { template @@ -28,7 +28,7 @@ make_span(BufferSequence const& bs) -> } } // detail -} // http_proto +} // http } // boost #endif diff --git a/src/detail/except.cpp b/src/detail/except.cpp index 99fe4b5d..472ebbee 100644 --- a/src/detail/except.cpp +++ b/src/detail/except.cpp @@ -4,17 +4,17 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include +#include #include #include #include #include namespace boost { -namespace http_proto { +namespace http { namespace detail { void @@ -108,5 +108,5 @@ throw_system_error( } } // detail -} // http_proto +} // http } // boost diff --git a/src/detail/filter.cpp b/src/detail/filter.cpp index b051bb75..81b44cf0 100644 --- a/src/detail/filter.cpp +++ b/src/detail/filter.cpp @@ -5,7 +5,7 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // #include "src/detail/filter.hpp" @@ -13,7 +13,7 @@ #include namespace boost { -namespace http_proto { +namespace http { namespace detail { auto @@ -69,5 +69,5 @@ process( } } // detail -} // http_proto +} // http } // boost diff --git a/src/detail/filter.hpp b/src/detail/filter.hpp index 373e0010..6b3fe8fa 100644 --- a/src/detail/filter.hpp +++ b/src/detail/filter.hpp @@ -5,11 +5,11 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_DETAIL_FILTER_HPP -#define BOOST_HTTP_PROTO_DETAIL_FILTER_HPP +#ifndef BOOST_HTTP_DETAIL_FILTER_HPP +#define BOOST_HTTP_DETAIL_FILTER_HPP #include #include @@ -17,7 +17,7 @@ #include namespace boost { -namespace http_proto { +namespace http { namespace detail { /** Base class for all filters @@ -85,7 +85,7 @@ class filter }; } // detail -} // http_proto +} // http } // boost #endif diff --git a/src/detail/header.cpp b/src/detail/header.cpp index 64cfeb79..f333ac9b 100644 --- a/src/detail/header.cpp +++ b/src/detail/header.cpp @@ -5,18 +5,18 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // #include "src/rfc/detail/rules.hpp" #include "src/rfc/detail/transfer_coding_rule.hpp" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -29,7 +29,7 @@ #include namespace boost { -namespace http_proto { +namespace http { namespace detail { //------------------------------------------------ @@ -92,7 +92,7 @@ header(request_tag) noexcept , size(18) , prefix(16) , req{ 3, 1, - http_proto::method::get } + http::method::get } { } @@ -104,7 +104,7 @@ header(response_tag) noexcept , size(19) , prefix(17) , res{ 200, - http_proto::status::ok } + http::status::ok } { } @@ -177,7 +177,7 @@ keep_alive() const noexcept if(md.payload == payload::error) return false; if( version == - http_proto::version::http_1_1) + http::version::http_1_1) { if(md.connection.close) return false; @@ -490,7 +490,7 @@ on_insert_connection( if(! rv) { md.connection.ec = - BOOST_HTTP_PROTO_ERR( + BOOST_HTTP_ERR( error::bad_connection); return; } @@ -528,7 +528,7 @@ on_insert_content_length( { // parse failure md.content_length.ec = - BOOST_HTTP_PROTO_ERR( + BOOST_HTTP_ERR( error::bad_content_length); md.content_length.value = 0; update_payload(); @@ -549,7 +549,7 @@ on_insert_content_length( } // bad: different values md.content_length.ec = - BOOST_HTTP_PROTO_ERR( + BOOST_HTTP_ERR( error::multiple_content_length); md.content_length.value = 0; update_payload(); @@ -572,7 +572,7 @@ on_insert_expect( "100-continue")) { md.expect.ec = - BOOST_HTTP_PROTO_ERR( + BOOST_HTTP_ERR( error::bad_expect); md.expect.is_100_continue = false; return; @@ -617,7 +617,7 @@ on_insert_transfer_encoding( error: md.transfer_encoding.ec = - BOOST_HTTP_PROTO_ERR( + BOOST_HTTP_ERR( error::bad_transfer_encoding); md.transfer_encoding.is_chunked = false; update_payload(); @@ -637,7 +637,7 @@ on_insert_content_encoding( if(!rv) { md.content_encoding.ec = - BOOST_HTTP_PROTO_ERR( + BOOST_HTTP_ERR( error::bad_content_encoding); md.content_encoding.coding = content_coding::unknown; @@ -685,10 +685,10 @@ on_insert_upgrade( if(md.upgrade.ec.failed()) return; if( version != - http_proto::version::http_1_1) + http::version::http_1_1) { md.upgrade.ec = - BOOST_HTTP_PROTO_ERR( + BOOST_HTTP_ERR( error::bad_upgrade); md.upgrade.websocket = false; return; @@ -698,7 +698,7 @@ on_insert_upgrade( if(! rv) { md.upgrade.ec = - BOOST_HTTP_PROTO_ERR( + BOOST_HTTP_ERR( error::bad_upgrade); md.upgrade.websocket = false; return; @@ -1133,7 +1133,7 @@ parse_start_line( ec = rv.error(); if( ec == grammar::error::need_more && new_size == lim.max_start_line) - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::start_line_limit); return; } @@ -1151,15 +1151,15 @@ parse_start_line( { case 10: h.version = - http_proto::version::http_1_0; + http::version::http_1_0; break; case 11: h.version = - http_proto::version::http_1_1; + http::version::http_1_1; break; default: { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::bad_version); return; } @@ -1174,7 +1174,7 @@ parse_start_line( ec = rv.error(); if( ec == grammar::error::need_more && new_size == lim.max_start_line) - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::start_line_limit); return; } @@ -1183,15 +1183,15 @@ parse_start_line( { case 10: h.version = - http_proto::version::http_1_0; + http::version::http_1_0; break; case 11: h.version = - http_proto::version::http_1_1; + http::version::http_1_1; break; default: { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::bad_version); return; } @@ -1236,14 +1236,14 @@ parse_field( if( ec == grammar::error::need_more && new_size == lim.max_field) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::field_size_limit); } return; } if(h.count >= lim.max_fields) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::fields_limit); return; } @@ -1299,7 +1299,7 @@ parse( if( ec == grammar::error::need_more && new_size == lim.max_fields) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::headers_limit); } return; @@ -1314,7 +1314,7 @@ parse( if( ec == grammar::error::need_more && new_size == lim.max_size) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::headers_limit); return; } @@ -1326,5 +1326,5 @@ parse( } } // detail -} // http_proto +} // http } // boost diff --git a/src/detail/move_chars.hpp b/src/detail/move_chars.hpp index 4fe601b2..fa900b2f 100644 --- a/src/detail/move_chars.hpp +++ b/src/detail/move_chars.hpp @@ -4,18 +4,18 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/CPPAlliance/http_proto +// Official repository: https://github.com/CPPAlliance/http // -#ifndef BOOST_HTTP_PROTO_DETAIL_MOVE_CHARS_HPP -#define BOOST_HTTP_PROTO_DETAIL_MOVE_CHARS_HPP +#ifndef BOOST_HTTP_DETAIL_MOVE_CHARS_HPP +#define BOOST_HTTP_DETAIL_MOVE_CHARS_HPP #include #include #include namespace boost { -namespace http_proto { +namespace http { namespace detail { // Moves characters, and adjusts any passed @@ -88,7 +88,7 @@ move_chars( } } // detail -} // http_proto +} // http } // boost #endif diff --git a/src/detail/number_string.hpp b/src/detail/number_string.hpp index bed3d3af..2ad47e95 100644 --- a/src/detail/number_string.hpp +++ b/src/detail/number_string.hpp @@ -4,18 +4,18 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/CPPAlliance/http_proto +// Official repository: https://github.com/CPPAlliance/http // -#ifndef BOOST_HTTP_PROTO_DETAIL_NUMBER_STRING_HPP -#define BOOST_HTTP_PROTO_DETAIL_NUMBER_STRING_HPP +#ifndef BOOST_HTTP_DETAIL_NUMBER_STRING_HPP +#define BOOST_HTTP_DETAIL_NUMBER_STRING_HPP -#include +#include #include #include namespace boost { -namespace http_proto { +namespace http { namespace detail { // Convert integer to decimal @@ -91,7 +91,7 @@ class number_string }; } // detail -} // http_proto +} // http } // boost #endif diff --git a/src/detail/win32_unicode_path.hpp b/src/detail/win32_unicode_path.hpp index a9069c80..7e8860aa 100644 --- a/src/detail/win32_unicode_path.hpp +++ b/src/detail/win32_unicode_path.hpp @@ -7,12 +7,12 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_HTTP_PROTO_DETAIL_WIN32_UNICODE_PATH_HPP -#define BOOST_HTTP_PROTO_DETAIL_WIN32_UNICODE_PATH_HPP +#ifndef BOOST_HTTP_DETAIL_WIN32_UNICODE_PATH_HPP +#define BOOST_HTTP_DETAIL_WIN32_UNICODE_PATH_HPP #ifdef _WIN32 #include -#include +#include #include #include #include @@ -20,7 +20,7 @@ #include namespace boost { -namespace http_proto { +namespace http { namespace detail { class win32_unicode_path @@ -75,7 +75,7 @@ class win32_unicode_path }; } // detail -} // http_proto +} // http } // boost #endif diff --git a/src/detail/workspace.cpp b/src/detail/workspace.cpp index 4515b8f5..8b68f3c9 100644 --- a/src/detail/workspace.cpp +++ b/src/detail/workspace.cpp @@ -5,17 +5,17 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include -#include +#include +#include #include #include #include namespace boost { -namespace http_proto { +namespace http { namespace detail { workspace:: @@ -205,5 +205,5 @@ bump_down( } } // detail -} // http_proto +} // http } // boost diff --git a/src/detail/zlib_filter_base.hpp b/src/detail/zlib_filter_base.hpp index e57380a8..110fae2d 100644 --- a/src/detail/zlib_filter_base.hpp +++ b/src/detail/zlib_filter_base.hpp @@ -8,10 +8,10 @@ // Official repository: https://github.com/cppalliance/buffers // -#ifndef BOOST_HTTP_PROTO_DETAIL_ZLIB_FILTER_BASE_HPP -#define BOOST_HTTP_PROTO_DETAIL_ZLIB_FILTER_BASE_HPP +#ifndef BOOST_HTTP_DETAIL_ZLIB_FILTER_BASE_HPP +#define BOOST_HTTP_DETAIL_ZLIB_FILTER_BASE_HPP -#include +#include #include "src/detail/filter.hpp" @@ -19,7 +19,7 @@ #include namespace boost { -namespace http_proto { +namespace http { namespace detail { /** Base class for zlib filters @@ -69,7 +69,7 @@ class zlib_filter_base : public filter }; } // detail -} // http_proto +} // http } // boost #endif diff --git a/src/error.cpp b/src/error.cpp index 6324264a..589b0755 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include +#include #include #include #include namespace boost { -namespace http_proto { +namespace http { namespace detail { @@ -161,5 +161,5 @@ condition_cat_type condition_cat; } // detail -} // http_proto +} // http } // boost diff --git a/src/field.cpp b/src/field.cpp index c1c5b64e..d856eabd 100644 --- a/src/field.cpp +++ b/src/field.cpp @@ -5,10 +5,10 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include +#include #include #include #include @@ -17,7 +17,7 @@ #include namespace boost { -namespace http_proto { +namespace http { namespace detail { @@ -572,5 +572,5 @@ operator<<(std::ostream& os, field f) return os << to_string(f); } -} // http_proto +} // http } // boost diff --git a/src/fields_base.cpp b/src/fields_base.cpp index ba62e591..93db388b 100644 --- a/src/fields_base.cpp +++ b/src/fields_base.cpp @@ -5,17 +5,17 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include "src/detail/move_chars.hpp" #include "src/rfc/detail/rules.hpp" @@ -30,7 +30,7 @@ #include namespace boost { -namespace http_proto { +namespace http { namespace { @@ -58,7 +58,7 @@ verify_field_name( name, detail::field_name_rule); if(rv.has_error()) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::bad_field_name); } } @@ -1498,5 +1498,5 @@ length( offset(i); } -} // http_proto +} // http } // boost diff --git a/src/file_sink.cpp b/src/file_sink.cpp index 3f4bf723..e3f1a726 100644 --- a/src/file_sink.cpp +++ b/src/file_sink.cpp @@ -5,13 +5,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include +#include namespace boost { -namespace http_proto { +namespace http { file_sink:: file_sink( @@ -40,5 +40,5 @@ on_write( return rv; } -} // http_proto +} // http } // boost diff --git a/src/file_source.cpp b/src/file_source.cpp index df9a11e1..104b1437 100644 --- a/src/file_source.cpp +++ b/src/file_source.cpp @@ -5,13 +5,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include +#include namespace boost { -namespace http_proto { +namespace http { file_source:: ~file_source() = default; @@ -55,5 +55,5 @@ on_read( return rv; } -} // http_proto +} // http } // boost diff --git a/src/header_limits.cpp b/src/header_limits.cpp index f3b25a07..459eab11 100644 --- a/src/header_limits.cpp +++ b/src/header_limits.cpp @@ -4,15 +4,15 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include -#include -#include +#include +#include +#include namespace boost { -namespace http_proto { +namespace http { std::size_t header_limits:: @@ -35,7 +35,7 @@ valid_space_needed() const // max_size too large if( max_size > - BOOST_HTTP_PROTO_MAX_HEADER) + BOOST_HTTP_MAX_HEADER) detail::throw_invalid_argument(); // max_start_line too small @@ -70,5 +70,5 @@ valid_space_needed() const detail::header::entry)); } -} // http_proto +} // http } // boost diff --git a/src/message_base.cpp b/src/message_base.cpp index 7f5ace2d..8a984216 100644 --- a/src/message_base.cpp +++ b/src/message_base.cpp @@ -5,19 +5,19 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include -#include -#include -#include +#include +#include +#include +#include #include "detail/number_string.hpp" #include #include namespace boost { -namespace http_proto { +namespace http { void message_base:: @@ -85,12 +85,12 @@ set_keep_alive(bool value) switch(h_.version) { default: - case http_proto::version::http_1_1: + case http::version::http_1_1: if(! value) set(field::connection, "close"); break; - case http_proto::version::http_1_0: + case http::version::http_1_0: if(value) set(field::connection, "keep-alive"); break; @@ -166,7 +166,7 @@ set_keep_alive(bool value) switch(h_.version) { default: - case http_proto::version::http_1_1: + case http::version::http_1_1: if(! value) { // add one "close" token if needed @@ -175,7 +175,7 @@ set_keep_alive(bool value) } break; - case http_proto::version::http_1_0: + case http::version::http_1_0: if(value) { // add one "keep-alive" token if needed @@ -186,5 +186,5 @@ set_keep_alive(bool value) } } -} // http_proto +} // http } // boost diff --git a/src/method.cpp b/src/method.cpp index 5451caa2..df257413 100644 --- a/src/method.cpp +++ b/src/method.cpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include -#include +#include +#include #include #include namespace boost { -namespace http_proto { +namespace http { core::string_view to_string(method v) @@ -304,5 +304,5 @@ operator<<( return os; } -} // http_proto +} // http } // boost diff --git a/src/parser.cpp b/src/parser.cpp index bd7fccfa..c435e37a 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -5,14 +5,14 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -33,7 +33,7 @@ #include "src/detail/zlib_filter_base.hpp" namespace boost { -namespace http_proto { +namespace http { /* Principles for fixed-size buffer design @@ -191,7 +191,7 @@ parse_hex( { if(init_size == cs.size()) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::bad_payload); return 0; } @@ -201,7 +201,7 @@ parse_hex( // at least 4 significant bits are free if(v > (std::numeric_limits::max)() >> 4) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::bad_payload); return 0; } @@ -209,7 +209,7 @@ parse_hex( v = (v << 4) | static_cast(n); cs.next(); } - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::need_data); return 0; } @@ -227,7 +227,7 @@ find_eol( break; if(cs.value() != '\n') { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::bad_payload); return; } @@ -236,7 +236,7 @@ find_eol( } cs.next(); } - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::need_data); } @@ -253,11 +253,11 @@ parse_eol( cs.next(); return; } - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::bad_payload); return; } - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::need_data); } @@ -274,7 +274,7 @@ skip_trailer_headers( break; if(cs.value() != '\n') { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::bad_payload); return; } @@ -286,7 +286,7 @@ skip_trailer_headers( if(ec) return; } - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::need_data); } @@ -310,7 +310,7 @@ class zlib_filter public: zlib_filter( const capy::polystore& ctx, - http_proto::detail::workspace& ws, + http::detail::workspace& ws, int window_bits) : zlib_filter_base(ws) , svc_(ctx.get()) @@ -360,7 +360,7 @@ class brotli_filter public: brotli_filter( const capy::polystore& ctx, - http_proto::detail::workspace&) + http::detail::workspace&) : svc_(ctx.get()) { // TODO: use custom allocator @@ -402,10 +402,10 @@ class brotli_filter rv.finished = svc_.is_finished(state_); if(!more && rs == capy::brotli::decoder_result::needs_more_input) - rv.ec = BOOST_HTTP_PROTO_ERR(error::bad_payload); + rv.ec = BOOST_HTTP_ERR(error::bad_payload); if(rs == capy::brotli::decoder_result::error) - rv.ec = BOOST_HTTP_PROTO_ERR( + rv.ec = BOOST_HTTP_ERR( svc_.get_error_code(state_)); return rv; @@ -1081,7 +1081,7 @@ class parser::impl { // stream closed cleanly state_ = state::reset; - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::end_of_stream); return; } @@ -1089,7 +1089,7 @@ class parser::impl // stream closed with a // partial message received state_ = state::reset; - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::incomplete); return; } @@ -1132,7 +1132,7 @@ class parser::impl if(m_.payload() == payload::error) { // VFALCO This needs looking at - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::bad_payload); state_ = state::reset; // unrecoverable return; @@ -1205,7 +1205,7 @@ class parser::impl if(!filter_ && body_limit_ < m_.payload_size()) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::body_too_large); state_ = state::reset; return; @@ -1246,7 +1246,7 @@ class parser::impl { if(ec == condition::need_more_input && got_eof_) { - ec = BOOST_HTTP_PROTO_ERR(error::incomplete); + ec = BOOST_HTTP_ERR(error::incomplete); state_ = state::reset; } }; @@ -1304,13 +1304,13 @@ class parser::impl { if(got_eof_) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::incomplete); state_ = state::reset; return; } - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::need_data); return; } @@ -1334,7 +1334,7 @@ class parser::impl if(body_limit_remain() < chunk_avail) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::body_too_large); state_ = state::reset; return; @@ -1355,7 +1355,7 @@ class parser::impl if(cb1_.capacity() == 0 && !chunked_body_ended) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::in_place_overflow); return; } @@ -1383,7 +1383,7 @@ class parser::impl if(eb_->max_size() - eb_->size() < chunk_avail) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::buffer_overflow); state_ = state::reset; return; @@ -1445,7 +1445,7 @@ class parser::impl { if(body_limit_remain() < payload_avail) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::body_too_large); state_ = state::reset; return; @@ -1461,7 +1461,7 @@ class parser::impl body_total_ += payload_avail; if(cb0_.capacity() == 0 && !is_complete) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::in_place_overflow); return; } @@ -1496,7 +1496,7 @@ class parser::impl if(eb_->max_size() - eb_->size() < payload_avail) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::buffer_overflow); state_ = state::reset; return; @@ -1524,13 +1524,13 @@ class parser::impl if(m_.payload() == payload::size && got_eof_) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::incomplete); state_ = state::reset; return; } - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::need_data); return; } @@ -1567,7 +1567,7 @@ class parser::impl if(eb_->max_size() - eb_->size() < body_avail_) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::buffer_overflow); return; } @@ -1771,7 +1771,7 @@ class parser::impl if(cb1_.capacity() == 0 && !f_rs.finished && f_rs.in_bytes == 0) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::in_place_overflow); goto done; } @@ -1797,7 +1797,7 @@ class parser::impl if(eb_->max_size() - eb_->size() == 0 && !f_rs.finished && f_rs.in_bytes == 0) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::buffer_overflow); state_ = state::reset; goto done; @@ -1816,7 +1816,7 @@ class parser::impl if(body_limit_remain() == 0 && !f_rs.finished && f_rs.in_bytes == 0) { - ec = BOOST_HTTP_PROTO_ERR( + ec = BOOST_HTTP_ERR( error::body_too_large); state_ = state::reset; break; @@ -2065,5 +2065,5 @@ set_body_impl(sink& s) noexcept impl_->set_body(s); } -} // http_proto +} // http } // boost diff --git a/src/request_base.cpp b/src/request_base.cpp index 85dc6fd2..565e96d6 100644 --- a/src/request_base.cpp +++ b/src/request_base.cpp @@ -6,15 +6,15 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include +#include #include namespace boost { -namespace http_proto { +namespace http { void request_base:: @@ -78,10 +78,10 @@ set_expect_100_continue(bool b) void request_base:: set_start_line_impl( - http_proto::method m, + http::method m, core::string_view ms, core::string_view t, - http_proto::version v) + http::version v) { // TODO: check validity auto const vs = to_string(v); @@ -122,5 +122,5 @@ set_start_line_impl( h_.on_start_line(); } -} // http_proto +} // http } // boost diff --git a/src/request_parser.cpp b/src/request_parser.cpp index 64c65edb..337048a5 100644 --- a/src/request_parser.cpp +++ b/src/request_parser.cpp @@ -4,13 +4,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include +#include namespace boost { -namespace http_proto { +namespace http { request_parser:: request_parser( @@ -28,5 +28,5 @@ get() const return safe_get_request(); } -} // http_proto +} // http } // boost diff --git a/src/response_base.cpp b/src/response_base.cpp index d6fd9a19..0db01994 100644 --- a/src/response_base.cpp +++ b/src/response_base.cpp @@ -4,23 +4,23 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include +#include #include namespace boost { -namespace http_proto { +namespace http { void response_base:: set_start_line_impl( - http_proto::status sc, + http::status sc, unsigned short si, core::string_view rs, - http_proto::version v) + http::version v) { // TODO: check validity auto const vs = to_string(v); @@ -60,7 +60,7 @@ set_start_line_impl( void response_base:: set_version( - http_proto::version v) + http::version v) { if(v == h_.version) return; @@ -79,7 +79,7 @@ set_version( auto op = prefix_op_t( *this, h_.prefix, nullptr); char* dest = h_.buf; - if(v == http_proto::version::http_1_1) + if(v == http::version::http_1_1) dest[7] = '1'; else dest[7] = '0'; @@ -89,5 +89,5 @@ set_version( h_.on_start_line(); } -} // http_proto +} // http } // boost diff --git a/src/response_parser.cpp b/src/response_parser.cpp index 277ba43e..0ac2f94b 100644 --- a/src/response_parser.cpp +++ b/src/response_parser.cpp @@ -4,13 +4,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include +#include namespace boost { -namespace http_proto { +namespace http { response_parser:: response_parser( @@ -28,5 +28,5 @@ get() const return safe_get_response(); } -} // http_proto +} // http } // boost diff --git a/src/rfc/combine_field_values.cpp b/src/rfc/combine_field_values.cpp index 53c9d514..d91548bf 100644 --- a/src/rfc/combine_field_values.cpp +++ b/src/rfc/combine_field_values.cpp @@ -4,13 +4,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include +#include namespace boost { -namespace http_proto { +namespace http { core::string_view combine_field_values( @@ -56,5 +56,5 @@ combine_field_values( return result; } -} // http_proto +} // http } // boost diff --git a/src/rfc/detail/rules.cpp b/src/rfc/detail/rules.cpp index b7d8ce48..9d14e5c4 100644 --- a/src/rfc/detail/rules.cpp +++ b/src/rfc/detail/rules.cpp @@ -4,14 +4,14 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // #include "src/rfc/detail/rules.hpp" -#include -#include -#include +#include +#include +#include #include #include @@ -25,7 +25,7 @@ #include "src/rfc/detail/rules.hpp" namespace boost { -namespace http_proto { +namespace http { namespace detail { auto @@ -61,7 +61,7 @@ parse( if(it == end) { // expected "HTTP/" - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); } if(end - it >= 5) @@ -69,7 +69,7 @@ parse( if(std::memcmp( it, "HTTP/", 5) != 0) { - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::mismatch); } it += 5; @@ -77,39 +77,39 @@ parse( if(it == end) { // expected DIGIT - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); } if(! grammar::digit_chars(*it)) { // expected DIGIT - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); } v = 10 * (*it++ - '0'); if(it == end) { // expected "." - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); } if(*it != '.') { // expected "." - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); } ++it; if(it == end) { // expected DIGIT - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); } if(! grammar::digit_chars(*it)) { // expected DIGIT - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); } v += *it++ - '0'; @@ -137,7 +137,7 @@ parse( if(it == end) { // end - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); } auto it0 = it; @@ -145,7 +145,7 @@ parse( if(v == -1) { // expected DIGIT - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::mismatch); } value_type t; @@ -154,14 +154,14 @@ parse( if(it == end) { // end - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); } v = dig(*it); if(v == -1) { // expected DIGIT - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::mismatch); } t.v = t.v + (10 * v); @@ -169,14 +169,14 @@ parse( if(it == end) { // end - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); } v = dig(*it); if(v == -1) { // expected DIGIT - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); } t.v = t.v + v; @@ -211,7 +211,7 @@ parse( system::result { if( it == end ) - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); value_type v; @@ -281,14 +281,14 @@ parse( // too short to know if we have a potential obs-fold // occurrence if( end - it < 2 ) - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); if( it[1] != '\n' ) goto done; if( end - it < 3 ) - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); if(! ws(it[2]) ) @@ -339,7 +339,7 @@ parse( { if(it == end) { - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); } // check for leading CRLF @@ -348,17 +348,17 @@ parse( ++it; if(it == end) { - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); } if(*it != '\n') { - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::mismatch); } // end of fields ++it; - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::end_of_range); } @@ -413,5 +413,5 @@ remove_obs_fold( } } // detail -} // http_proto +} // http } // boost diff --git a/src/rfc/detail/rules.hpp b/src/rfc/detail/rules.hpp index 39125a9c..f5e1f1cd 100644 --- a/src/rfc/detail/rules.hpp +++ b/src/rfc/detail/rules.hpp @@ -5,16 +5,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_SRC_RFC_DETAIL_RULES_HPP -#define BOOST_HTTP_PROTO_SRC_RFC_DETAIL_RULES_HPP +#ifndef BOOST_HTTP_SRC_RFC_DETAIL_RULES_HPP +#define BOOST_HTTP_SRC_RFC_DETAIL_RULES_HPP -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -24,7 +24,7 @@ #include namespace boost { -namespace http_proto { +namespace http { namespace detail { //------------------------------------------------ @@ -289,7 +289,7 @@ struct field_value_rule_t constexpr field_value_rule_t field_value_rule{}; } // detail -} // http_proto +} // http } // boost #endif diff --git a/src/rfc/detail/transfer_coding_rule.cpp b/src/rfc/detail/transfer_coding_rule.cpp index 7b608319..4d1b21cb 100644 --- a/src/rfc/detail/transfer_coding_rule.cpp +++ b/src/rfc/detail/transfer_coding_rule.cpp @@ -5,19 +5,19 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // #include "src/rfc/detail/transfer_coding_rule.hpp" -#include -#include -#include +#include +#include +#include #include #include namespace boost { -namespace http_proto { +namespace http { namespace detail { auto @@ -35,13 +35,13 @@ transfer_parameter_rule_t::parse( if(it == end) { it = it0; - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); } if(*it != ';') { it = it0; - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::mismatch); } ++it; @@ -63,13 +63,13 @@ transfer_parameter_rule_t::parse( if(it == end) { it = it0; - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); } if(*it != '=') { it = it0; - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::syntax); } ++it; @@ -145,5 +145,5 @@ parse( } } // detail -} // http_proto +} // http } // boost diff --git a/src/rfc/detail/transfer_coding_rule.hpp b/src/rfc/detail/transfer_coding_rule.hpp index 6912e83e..5a5a3321 100644 --- a/src/rfc/detail/transfer_coding_rule.hpp +++ b/src/rfc/detail/transfer_coding_rule.hpp @@ -5,19 +5,19 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_RFC_TRANSFER_CODING_RULE_HPP -#define BOOST_HTTP_PROTO_RFC_TRANSFER_CODING_RULE_HPP +#ifndef BOOST_HTTP_RFC_TRANSFER_CODING_RULE_HPP +#define BOOST_HTTP_RFC_TRANSFER_CODING_RULE_HPP -#include -#include +#include +#include #include #include namespace boost { -namespace http_proto { +namespace http { namespace detail { /* @@ -85,7 +85,7 @@ struct transfer_coding_rule_t constexpr transfer_coding_rule_t transfer_coding_rule{}; } // detail -} // http_proto +} // http } // boost #endif diff --git a/src/rfc/parameter.cpp b/src/rfc/parameter.cpp index 58104d73..2154ff99 100644 --- a/src/rfc/parameter.cpp +++ b/src/rfc/parameter.cpp @@ -4,14 +4,14 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include +#include #include namespace boost { -namespace http_proto { +namespace http { namespace implementation_defined { auto parameter_rule_t:: @@ -25,5 +25,5 @@ parse( return system::error_code{}; } } // implementation_defined -} // http_proto +} // http } // boost diff --git a/src/rfc/quoted_token_rule.cpp b/src/rfc/quoted_token_rule.cpp index 0d766361..9375e0c2 100644 --- a/src/rfc/quoted_token_rule.cpp +++ b/src/rfc/quoted_token_rule.cpp @@ -4,11 +4,11 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include -#include +#include +#include #include #include #include @@ -16,7 +16,7 @@ #include namespace boost { -namespace http_proto { +namespace http { namespace { @@ -68,7 +68,7 @@ parse( { if(it == end) { - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); } if(*it != '\"') @@ -90,7 +90,7 @@ parse( it, end, qdtext_chars); if(it == end) { - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); } n += static_cast(it - it1); @@ -98,18 +98,18 @@ parse( break; if(*it != '\\') { - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::syntax); } ++it; if(it == end) { - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::need_more); } if(! qpchars(*it)) { - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::syntax); } ++it; @@ -120,5 +120,5 @@ parse( } } // implementation_defined -} // http_proto +} // http } // boost diff --git a/src/rfc/upgrade_rule.cpp b/src/rfc/upgrade_rule.cpp index 4e3b6d8c..a9211071 100644 --- a/src/rfc/upgrade_rule.cpp +++ b/src/rfc/upgrade_rule.cpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include -#include +#include +#include #include #include namespace boost { -namespace http_proto { +namespace http { namespace implementation_defined { auto @@ -46,5 +46,5 @@ parse( } } // implementation_defined -} // http_proto +} // http } // boost diff --git a/src/serializer.cpp b/src/serializer.cpp index 0e1450e9..c2f87a5d 100644 --- a/src/serializer.cpp +++ b/src/serializer.cpp @@ -6,13 +6,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include -#include -#include -#include +#include +#include +#include +#include #include "src/detail/array_of_const_buffers.hpp" #include "src/detail/brotli_filter_base.hpp" @@ -34,7 +34,7 @@ #include namespace boost { -namespace http_proto { +namespace http { namespace { @@ -95,7 +95,7 @@ class zlib_filter public: zlib_filter( const capy::polystore& ctx, - http_proto::detail::workspace& ws, + http::detail::workspace& ws, int comp_level, int window_bits, int mem_level) @@ -161,7 +161,7 @@ class brotli_filter public: brotli_filter( const capy::polystore& ctx, - http_proto::detail::workspace&, + http::detail::workspace&, std::uint32_t comp_quality, std::uint32_t comp_window) : svc_(ctx.get()) @@ -349,7 +349,7 @@ class serializer::impl needs_exp100_continue_ = false; - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( error::expect_100_continue); } @@ -422,7 +422,7 @@ class serializer::impl case style::stream: if(out_.size() == 0 && is_header_done() && more_input_) - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( error::need_data); break; } @@ -570,7 +570,7 @@ class serializer::impl } if(out_.size() == 0 && is_header_done() && more_input_) - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( error::need_data); break; } @@ -1118,5 +1118,5 @@ close() noexcept impl_ = nullptr; } -} // http_proto +} // http } // boost diff --git a/src/server/basic_router.cpp b/src/server/basic_router.cpp index ce127f4b..9b1b051d 100644 --- a/src/server/basic_router.cpp +++ b/src/server/basic_router.cpp @@ -4,14 +4,14 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // #include "src/server/route_rule.hpp" -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -20,7 +20,7 @@ #include namespace boost { -namespace http_proto { +namespace http { //namespace detail { @@ -350,8 +350,8 @@ struct any_router::layer handler_ptr handler; // only for end routes - http_proto::method verb = - http_proto::method::unknown; + http::method verb = + http::method::unknown; std::string verb_str; bool all; @@ -363,24 +363,24 @@ struct any_router::layer } entry( - http_proto::method verb_, + http::method verb_, handler_ptr h) noexcept : handler(std::move(h)) , verb(verb_) , all(false) { BOOST_ASSERT(verb != - http_proto::method::unknown); + http::method::unknown); } entry( core::string_view verb_str_, handler_ptr h) noexcept : handler(std::move(h)) - , verb(http_proto::string_to_method(verb_str_)) + , verb(http::string_to_method(verb_str_)) , all(false) { - if(verb != http_proto::method::unknown) + if(verb != http::method::unknown) return; verb_str = verb_str_; } @@ -390,9 +390,9 @@ struct any_router::layer { if(all) return true; - if(verb != http_proto::method::unknown) + if(verb != http::method::unknown) return p.verb_ == verb; - if(p.verb_ != http_proto::method::unknown) + if(p.verb_ != http::method::unknown) return false; return p.verb_str_ == verb_str; } @@ -546,11 +546,11 @@ void any_router:: add_impl( layer& e, - http_proto::method verb, + http::method verb, handler_list const& handlers) { // cannot be unknown - if(verb == http_proto::method::unknown) + if(verb == http::method::unknown) detail::throw_invalid_argument(); e.entries.reserve(e.entries.size() + handlers.n); @@ -621,7 +621,7 @@ resume_impl( route_result any_router:: dispatch_impl( - http_proto::method verb, + http::method verb, core::string_view verb_str, urls::url_view const& url, route_params_base& p) const @@ -636,11 +636,11 @@ dispatch_impl( p.case_sensitive = false; p.strict = false; - if(verb == http_proto::method::unknown) + if(verb == http::method::unknown) { BOOST_ASSERT(! verb_str.empty()); - verb = http_proto::string_to_method(verb_str); - if(verb == http_proto::method::unknown) + verb = http::string_to_method(verb_str); + if(verb == http::method::unknown) p.verb_str_ = verb_str; } else @@ -899,5 +899,5 @@ do_dispatch( //} // detail -} // http_proto +} // http } // boost diff --git a/src/server/cors.cpp b/src/server/cors.cpp index 528b51f5..eaa78150 100644 --- a/src/server/cors.cpp +++ b/src/server/cors.cpp @@ -4,14 +4,14 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include +#include #include namespace boost { -namespace http_proto { +namespace http { cors:: cors( @@ -185,5 +185,5 @@ operator()( return route::next; } -} // http_proto +} // http } // boost diff --git a/src/server/route_handler.cpp b/src/server/route_handler.cpp index fc04a360..1849997b 100644 --- a/src/server/route_handler.cpp +++ b/src/server/route_handler.cpp @@ -4,14 +4,14 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include -#include +#include +#include namespace boost { -namespace http_proto { +namespace http { route_params:: ~route_params() @@ -21,7 +21,7 @@ route_params:: route_params& route_params:: status( - http_proto::status code) + http::status code) { res.set_start_line(code, res.version()); return *this; @@ -31,10 +31,10 @@ route_params& route_params:: set_body(std::string s) { - if(! res.exists(http_proto::field::content_type)) + if(! res.exists(http::field::content_type)) { // VFALCO TODO detect Content-Type - res.set(http_proto::field::content_type, + res.set(http::field::content_type, "text/plain; charset=UTF-8"); } @@ -44,12 +44,12 @@ set_body(std::string s) } serializer.start(res, - http_proto::string_body(std::string(s))); + http::string_body(std::string(s))); return *this; } -#ifdef BOOST_HTTP_PROTO_HAS_CORO +#ifdef BOOST_HTTP_HAS_CORO auto route_params:: @@ -74,5 +74,5 @@ spawn( #endif -} // http_proto +} // http } // boost diff --git a/src/server/route_rule.cpp b/src/server/route_rule.cpp index 2526595b..36d73737 100644 --- a/src/server/route_rule.cpp +++ b/src/server/route_rule.cpp @@ -4,13 +4,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // #include "src/server/route_rule.hpp" namespace boost { -namespace http_proto { +namespace http { -} // http_proto +} // http } // boost diff --git a/src/server/route_rule.hpp b/src/server/route_rule.hpp index 46436200..d4845ecb 100644 --- a/src/server/route_rule.hpp +++ b/src/server/route_rule.hpp @@ -4,13 +4,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_SERVER_ROUTE_RULE_HPP -#define BOOST_HTTP_PROTO_SERVER_ROUTE_RULE_HPP +#ifndef BOOST_HTTP_SERVER_ROUTE_RULE_HPP +#define BOOST_HTTP_SERVER_ROUTE_RULE_HPP -#include +#include #include #include #include @@ -19,7 +19,7 @@ #include namespace boost { -namespace http_proto { +namespace http { namespace grammar = urls::grammar; @@ -199,7 +199,7 @@ constexpr struct if(it == end || *it != '(') return ""; if(it == end) - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::syntax); auto it0 = it; it = grammar::find_if_not( @@ -208,19 +208,19 @@ constexpr struct { // too small it = it0; - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::syntax); } if(it == end) { it = it0; - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::syntax); } if(*it != ')') { it0 = it; - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::syntax); } return core::string_view(++it0, it++); @@ -238,10 +238,10 @@ constexpr struct system::result { if(it == end) - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::syntax); if(! grammar::alpha_chars(*it)) - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::syntax); auto it0 = it++; it = grammar::find_if_not( @@ -275,10 +275,10 @@ struct param_segment_rule_t system::result { if(it == end) - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::syntax); if(*it != ':' && *it != '*') - BOOST_HTTP_PROTO_RETURN_EC( + BOOST_HTTP_RETURN_EC( grammar::error::mismatch); value_type v; v.ptype = *it++; @@ -371,7 +371,7 @@ struct route_match urls::segments_encoded_view path; }; -} // http_proto +} // http } // boost #endif diff --git a/src/server/router_types.cpp b/src/server/router_types.cpp index 21cfe625..47707360 100644 --- a/src/server/router_types.cpp +++ b/src/server/router_types.cpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include +#include #include #include #include namespace boost { -namespace http_proto { +namespace http { namespace detail { @@ -84,11 +84,11 @@ route_params_base:: is_method( core::string_view s) const noexcept { - auto m = http_proto::string_to_method(s); - if(m != http_proto::method::unknown) + auto m = http::string_to_method(s); + if(m != http::method::unknown) return verb_ == m; return s == verb_str_; } -} // http_proto +} // http } // boost diff --git a/src/sink.cpp b/src/sink.cpp index 963e2c68..607cb0ca 100644 --- a/src/sink.cpp +++ b/src/sink.cpp @@ -4,13 +4,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include +#include namespace boost { -namespace http_proto { +namespace http { auto sink:: @@ -39,5 +39,5 @@ on_write( return rv; } -} // http_proto +} // http } // boost diff --git a/src/source.cpp b/src/source.cpp index b2669f19..de05a7dc 100644 --- a/src/source.cpp +++ b/src/source.cpp @@ -5,13 +5,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include +#include namespace boost { -namespace http_proto { +namespace http { auto source:: @@ -42,5 +42,5 @@ on_read( return rv; } -} // http_proto +} // http } // boost diff --git a/src/status.cpp b/src/status.cpp index 063367dd..17ebbb1a 100644 --- a/src/status.cpp +++ b/src/status.cpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include -#include +#include +#include //#include #include namespace boost { -namespace http_proto { +namespace http { status int_to_status(unsigned v) @@ -213,5 +213,5 @@ operator<<(std::ostream& os, status v) return os << to_string(v); } -} // http_proto +} // http } // boost diff --git a/src/version.cpp b/src/version.cpp index 88e7170c..69ced3fb 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -4,14 +4,14 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include +#include #include namespace boost { -namespace http_proto { +namespace http { core::string_view to_string( @@ -36,5 +36,5 @@ operator<<( return os; } -} // http_proto +} // http } // boost diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8ffb38d2..986595ba 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,7 +4,7 @@ # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # -# Official repository: https://github.com/cppalliance/http_proto +# Official repository: https://github.com/cppalliance/http # if(NOT TARGET tests) diff --git a/test/Jamfile b/test/Jamfile index 8c532526..7a06e82f 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -4,7 +4,7 @@ # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # -# Official repository: https://github.com/CPPAlliance/http_proto +# Official repository: https://github.com/CPPAlliance/http # build-project limits ; diff --git a/test/cmake_test/CMakeLists.txt b/test/cmake_test/CMakeLists.txt index 9c90abf0..f9f82eb9 100644 --- a/test/cmake_test/CMakeLists.txt +++ b/test/cmake_test/CMakeLists.txt @@ -13,15 +13,15 @@ set(__ignore__ ${CMAKE_C_COMPILER}) set(__ignore__ ${CMAKE_C_FLAGS}) if(BOOST_CI_INSTALL_TEST) - find_package(Boost CONFIG REQUIRED COMPONENTS http_proto) + find_package(Boost CONFIG REQUIRED COMPONENTS http) else() set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) - set(BOOST_INCLUDE_LIBRARIES http_proto) + set(BOOST_INCLUDE_LIBRARIES http) add_subdirectory(../../../.. boostorg/boost) endif() add_executable(main main.cpp) -target_link_libraries(main Boost::http_proto) +target_link_libraries(main Boost::http) enable_testing() add_test(NAME main COMMAND main) diff --git a/test/cmake_test/main.cpp b/test/cmake_test/main.cpp index 71ee752c..80e4a744 100644 --- a/test/cmake_test/main.cpp +++ b/test/cmake_test/main.cpp @@ -1,7 +1,7 @@ -#include +#include int main() { - boost::http_proto::request request; + boost::http::request request; request.set_payload_size(1337); if (request.payload_size() != 1337) { throw; diff --git a/test/limits/CMakeLists.txt b/test/limits/CMakeLists.txt index db67f8a4..7c7d4427 100644 --- a/test/limits/CMakeLists.txt +++ b/test/limits/CMakeLists.txt @@ -5,7 +5,7 @@ # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # -# Official repository: https://github.com/cppalliance/http_proto +# Official repository: https://github.com/cppalliance/http # set(TEST_MAIN ../../../url/extra/test_suite/test_main.cpp ../../../url/extra/test_suite/test_suite.cpp) @@ -14,15 +14,15 @@ file(GLOB_RECURSE LIMITS_SOURCES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/. source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES limits.cpp Jamfile) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/../../../url/extra/test_suite PREFIX "_extra" FILES ${TEST_MAIN}) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/../../src PREFIX "_extra" FILES ${LIMITS_SOURCES}) -add_executable(boost_http_proto_limits limits.cpp Jamfile ${TEST_MAIN} ${LIMITS_SOURCES}) -target_include_directories(boost_http_proto_limits PRIVATE ../../) -target_include_directories(boost_http_proto_limits PRIVATE ../../include ../../../url/extra/test_suite ../../..) -target_compile_definitions(boost_http_proto_limits PRIVATE - BOOST_HTTP_PROTO_TEST_LIMITS - BOOST_HTTP_PROTO_NO_LIB - BOOST_HTTP_PROTO_STATIC_LINK +add_executable(boost_http_limits limits.cpp Jamfile ${TEST_MAIN} ${LIMITS_SOURCES}) +target_include_directories(boost_http_limits PRIVATE ../../) +target_include_directories(boost_http_limits PRIVATE ../../include ../../../url/extra/test_suite ../../..) +target_compile_definitions(boost_http_limits PRIVATE + BOOST_HTTP_TEST_LIMITS + BOOST_HTTP_NO_LIB + BOOST_HTTP_STATIC_LINK ) -target_link_libraries(boost_http_proto_limits PRIVATE +target_link_libraries(boost_http_limits PRIVATE Boost::align Boost::assert Boost::buffers @@ -34,7 +34,7 @@ target_link_libraries(boost_http_proto_limits PRIVATE Boost::url Boost::utility) -target_link_libraries(boost_http_proto_limits INTERFACE Boost::http_proto) +target_link_libraries(boost_http_limits INTERFACE Boost::http) -add_test(NAME boost_http_proto_limits COMMAND boost_http_proto_limits) -add_dependencies(tests boost_http_proto_limits) +add_test(NAME boost_http_limits COMMAND boost_http_limits) +add_dependencies(tests boost_http_limits) diff --git a/test/limits/Jamfile b/test/limits/Jamfile index d690406d..5916b905 100644 --- a/test/limits/Jamfile +++ b/test/limits/Jamfile @@ -5,7 +5,7 @@ # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # -# Official repository: https://github.com/CPPAlliance/http_proto +# Official repository: https://github.com/CPPAlliance/http # import testing ; @@ -23,10 +23,10 @@ project /boost//url ; -run limits.cpp /boost/http_proto//http_proto_sources +run limits.cpp /boost/http//http_sources : requirements - BOOST_HTTP_PROTO_TEST_LIMITS - BOOST_HTTP_PROTO_NO_LIB - BOOST_HTTP_PROTO_STATIC_LINK + BOOST_HTTP_TEST_LIMITS + BOOST_HTTP_NO_LIB + BOOST_HTTP_STATIC_LINK static ; diff --git a/test/limits/limits.cpp b/test/limits/limits.cpp index 96aeaef4..fff2d41e 100644 --- a/test/limits/limits.cpp +++ b/test/limits/limits.cpp @@ -5,13 +5,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include -#include -#include -#include +#include +#include +#include +#include #include "test_suite.hpp" @@ -20,17 +20,17 @@ // These ensure that limits is compiled correctly #if \ - defined(BOOST_HTTP_PROTO_DYN_LINK) || \ - ( defined(BOOST_ALL_DYN_LINK) && ! defined(BOOST_HTTP_PROTO_STATIC_LINK) ) + defined(BOOST_HTTP_DYN_LINK) || \ + ( defined(BOOST_ALL_DYN_LINK) && ! defined(BOOST_HTTP_STATIC_LINK) ) #error "Limits should not be built with shared linking." #endif -#ifndef BOOST_HTTP_PROTO_TEST_LIMITS -#error "Limits should be built with BOOST_HTTP_PROTO_TEST_LIMITS." +#ifndef BOOST_HTTP_TEST_LIMITS +#error "Limits should be built with BOOST_HTTP_TEST_LIMITS." #endif namespace boost { -namespace http_proto { +namespace http { constexpr auto max_offset = std::numeric_limits::max(); @@ -150,7 +150,7 @@ class limits_test TEST_SUITE( limits_test, - "boost.http_proto.limits"); + "boost.http.limits"); -} // http_proto +} // http } // boost diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index 892d59b9..f49361e0 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -4,7 +4,7 @@ # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # -# Official repository: https://github.com/cppalliance/http_proto +# Official repository: https://github.com/cppalliance/http # if (NOT TARGET boost_url_test_suite) @@ -18,24 +18,24 @@ list(APPEND PFILES source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX "" FILES ${PFILES}) -add_executable(boost_http_proto_tests ${PFILES}) -target_include_directories(boost_http_proto_tests PRIVATE . ../../) +add_executable(boost_http_tests ${PFILES}) +target_include_directories(boost_http_tests PRIVATE . ../../) target_link_libraries( - boost_http_proto_tests PRIVATE + boost_http_tests PRIVATE boost_url_test_suite_with_main - Boost::http_proto + Boost::http Boost::filesystem) if (TARGET Boost::capy_zlib) - target_link_libraries(boost_http_proto_tests PRIVATE Boost::capy_zlib) + target_link_libraries(boost_http_tests PRIVATE Boost::capy_zlib) endif () if (TARGET Boost::capy_brotli) - target_link_libraries(boost_http_proto_tests PRIVATE Boost::capy_brotli) + target_link_libraries(boost_http_tests PRIVATE Boost::capy_brotli) endif () # Register individual tests with CTest -boost_url_test_suite_discover_tests(boost_http_proto_tests) +boost_url_test_suite_discover_tests(boost_http_tests) # Add the main test target to Boost's test suite -add_dependencies(tests boost_http_proto_tests) +add_dependencies(tests boost_http_tests) diff --git a/test/unit/Jamfile b/test/unit/Jamfile index f4a4e730..9f31c989 100644 --- a/test/unit/Jamfile +++ b/test/unit/Jamfile @@ -4,7 +4,7 @@ # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # -# Official repository: https://github.com/CPPAlliance/http_proto +# Official repository: https://github.com/CPPAlliance/http # import testing ; @@ -15,7 +15,7 @@ using zlib ; project : requirements $(c11-requires) - /boost/http_proto//boost_http_proto + /boost/http//boost_http /boost/url//boost_url [ ac.check-library /boost/capy//boost_capy_zlib : /boost/capy//boost_capy_zlib : ] [ ac.check-library /boost/capy//boost_capy_brotli : /boost/capy//boost_capy_brotli : ] diff --git a/test/unit/compression.cpp b/test/unit/compression.cpp index da37690c..521f195d 100644 --- a/test/unit/compression.cpp +++ b/test/unit/compression.cpp @@ -5,12 +5,12 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include -#include -#include +#include +#include +#include #include #include @@ -26,7 +26,7 @@ #include namespace boost { -namespace http_proto { +namespace http { struct zlib_test { @@ -717,7 +717,7 @@ struct zlib_test TEST_SUITE( zlib_test, - "boost.http_proto.compression"); + "boost.http.compression"); -} // namespace http_proto +} // namespace http } // namespace boost diff --git a/test/unit/error.cpp b/test/unit/error.cpp index f7f6d10c..c6e2a6d7 100644 --- a/test/unit/error.cpp +++ b/test/unit/error.cpp @@ -4,11 +4,11 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include #include #include @@ -16,7 +16,7 @@ #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { class error_test { @@ -118,7 +118,7 @@ class error_test } }; -TEST_SUITE(error_test, "boost.http_proto.error"); +TEST_SUITE(error_test, "boost.http.error"); -} // http_proto +} // http } // boost diff --git a/test/unit/field.cpp b/test/unit/field.cpp index fb4e5cf7..ce2b7ccf 100644 --- a/test/unit/field.cpp +++ b/test/unit/field.cpp @@ -4,19 +4,19 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include -#include +#include #include #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { class field_test { @@ -409,7 +409,7 @@ class field_test } }; -TEST_SUITE(field_test, "boost.http_proto.field"); +TEST_SUITE(field_test, "boost.http.field"); -} // http_proto +} // http } // boost diff --git a/test/unit/fields.cpp b/test/unit/fields.cpp index f84df80c..d90f1727 100644 --- a/test/unit/fields.cpp +++ b/test/unit/fields.cpp @@ -5,13 +5,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include -#include +#include #include #include "test_helpers.hpp" @@ -21,7 +21,7 @@ #include namespace boost { -namespace http_proto { +namespace http { struct fields_test { @@ -342,7 +342,7 @@ struct fields_test TEST_SUITE( fields_test, - "boost.http_proto.fields"); + "boost.http.fields"); -} // http_proto +} // http } // boost diff --git a/test/unit/fields_base.cpp b/test/unit/fields_base.cpp index 88300987..e538d435 100644 --- a/test/unit/fields_base.cpp +++ b/test/unit/fields_base.cpp @@ -4,17 +4,17 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -26,7 +26,7 @@ #include namespace boost { -namespace http_proto { +namespace http { // check for overflow //BOOST_STATIC_ASSERT( @@ -1739,7 +1739,7 @@ struct fields_base_test TEST_SUITE( fields_base_test, - "boost.http_proto.fields_base"); + "boost.http.fields_base"); -} // http_proto +} // http } // boost diff --git a/test/unit/file_sink.cpp b/test/unit/file_sink.cpp index e73da841..4a8d4b30 100644 --- a/test/unit/file_sink.cpp +++ b/test/unit/file_sink.cpp @@ -4,11 +4,11 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include #include #include @@ -16,7 +16,7 @@ #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { struct file_sink_test { @@ -103,7 +103,7 @@ struct file_sink_test TEST_SUITE( file_sink_test, - "boost.http_proto.file_sink"); + "boost.http.file_sink"); -} // http_proto +} // http } // boost diff --git a/test/unit/file_source.cpp b/test/unit/file_source.cpp index 1f52e272..fd2e3abe 100644 --- a/test/unit/file_source.cpp +++ b/test/unit/file_source.cpp @@ -4,11 +4,11 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include #include #include @@ -17,7 +17,7 @@ #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { struct file_source_test { @@ -144,7 +144,7 @@ struct file_source_test TEST_SUITE( file_source_test, - "boost.http_proto.file_source"); + "boost.http.file_source"); -} // http_proto +} // http } // boost diff --git a/test/unit/header_limits.cpp b/test/unit/header_limits.cpp index 2f88bd2c..3d927f41 100644 --- a/test/unit/header_limits.cpp +++ b/test/unit/header_limits.cpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { struct header_limits_test { @@ -36,7 +36,7 @@ struct header_limits_test TEST_SUITE( header_limits_test, - "boost.http_proto.header_limits"); + "boost.http.header_limits"); -} // http_proto +} // http } // boost diff --git a/test/unit/http_proto.cpp b/test/unit/http_proto.cpp index 707fc3f9..5b94b1c0 100644 --- a/test/unit/http_proto.cpp +++ b/test/unit/http_proto.cpp @@ -4,8 +4,8 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include diff --git a/test/unit/json.cpp b/test/unit/json.cpp index 1c87c680..2e1f4c6a 100644 --- a/test/unit/json.cpp +++ b/test/unit/json.cpp @@ -4,8 +4,8 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include diff --git a/test/unit/message_base.cpp b/test/unit/message_base.cpp index 0bbc652b..4979ff1f 100644 --- a/test/unit/message_base.cpp +++ b/test/unit/message_base.cpp @@ -4,8 +4,8 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include diff --git a/test/unit/metadata.cpp b/test/unit/metadata.cpp index dc7e66de..8cbc31ea 100644 --- a/test/unit/metadata.cpp +++ b/test/unit/metadata.cpp @@ -5,19 +5,19 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include -#include -#include +#include +#include #include "test_helpers.hpp" namespace boost { -namespace http_proto { +namespace http { // These tests check that the message // containers correctly track changes @@ -1250,7 +1250,7 @@ struct metadata_test TEST_SUITE( metadata_test, - "boost.http_proto.metadata"); + "boost.http.metadata"); -} // http_proto +} // http } // boost diff --git a/test/unit/method.cpp b/test/unit/method.cpp index 9cf213a2..23bb93b5 100644 --- a/test/unit/method.cpp +++ b/test/unit/method.cpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { class method_test { @@ -123,7 +123,7 @@ class method_test } }; -TEST_SUITE(method_test, "boost.http_proto.method"); +TEST_SUITE(method_test, "boost.http.method"); -} // http_proto +} // http } // boost diff --git a/test/unit/natvis.cpp b/test/unit/natvis.cpp index 6cd93efd..794a1944 100644 --- a/test/unit/natvis.cpp +++ b/test/unit/natvis.cpp @@ -4,19 +4,19 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#include -#include -#include +#include +#include +#include #include "test_suite.hpp" #include namespace boost { -namespace http_proto { +namespace http { struct natvis_test { @@ -43,7 +43,7 @@ struct natvis_test } }; -TEST_SUITE(natvis_test, "boost.http_proto.natvis"); +TEST_SUITE(natvis_test, "boost.http.natvis"); -} // http_proto +} // http } // boost diff --git a/test/unit/parser.cpp b/test/unit/parser.cpp index 340a52bf..5c9c8978 100644 --- a/test/unit/parser.cpp +++ b/test/unit/parser.cpp @@ -5,13 +5,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include -#include -#include +#include +#include +#include #include #include @@ -92,7 +92,7 @@ This all speaks to DynamicBuffer as the correct API //------------------------------------------------ namespace boost { -namespace http_proto { +namespace http { struct parser_test { @@ -2194,7 +2194,7 @@ struct parser_test TEST_SUITE( parser_test, - "boost.http_proto.parser"); + "boost.http.parser"); -} // http_proto +} // http } // boost diff --git a/test/unit/request.cpp b/test/unit/request.cpp index 3c008818..529f010b 100644 --- a/test/unit/request.cpp +++ b/test/unit/request.cpp @@ -5,20 +5,20 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include -#include +#include #include #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { struct request_test { @@ -798,7 +798,7 @@ struct request_test TEST_SUITE( request_test, - "boost.http_proto.request"); + "boost.http.request"); -} // http_proto +} // http } // boost diff --git a/test/unit/request_parser.cpp b/test/unit/request_parser.cpp index c48f898f..2a3f09dd 100644 --- a/test/unit/request_parser.cpp +++ b/test/unit/request_parser.cpp @@ -4,12 +4,12 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include -#include +#include +#include #include @@ -19,7 +19,7 @@ #include namespace boost { -namespace http_proto { +namespace http { struct request_parser_test { @@ -393,7 +393,7 @@ struct request_parser_test TEST_SUITE( request_parser_test, - "boost.http_proto.request_parser"); + "boost.http.request_parser"); -} // http_proto +} // http } // boost diff --git a/test/unit/response.cpp b/test/unit/response.cpp index 175d89b8..e114a9a9 100644 --- a/test/unit/response.cpp +++ b/test/unit/response.cpp @@ -5,13 +5,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include -#include +#include #include #include @@ -19,7 +19,7 @@ #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { class response_test { @@ -441,7 +441,7 @@ class response_test TEST_SUITE( response_test, - "boost.http_proto.response"); + "boost.http.response"); -} // http_proto +} // http } // boost diff --git a/test/unit/response_parser.cpp b/test/unit/response_parser.cpp index 164413ea..d3580feb 100644 --- a/test/unit/response_parser.cpp +++ b/test/unit/response_parser.cpp @@ -4,18 +4,18 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include #include #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { class response_parser_test { @@ -73,7 +73,7 @@ class response_parser_test TEST_SUITE( response_parser_test, - "boost.http_proto.response_parser"); + "boost.http.response_parser"); -} // http_proto +} // http } // boost diff --git a/test/unit/rfc/chunk_ext_rule.cpp b/test/unit/rfc/chunk_ext_rule.cpp index e9a2bc64..517168ad 100644 --- a/test/unit/rfc/chunk_ext_rule.cpp +++ b/test/unit/rfc/chunk_ext_rule.cpp @@ -4,13 +4,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // #if 0 // Test that header file is self-contained. -#include +#include #include #include @@ -20,7 +20,7 @@ #include namespace boost { -namespace http_proto { +namespace http { static bool @@ -135,9 +135,9 @@ class chunk_ext_rule_test TEST_SUITE( chunk_ext_rule_test, - "boost.http_proto.chunk_ext_rule"); + "boost.http.chunk_ext_rule"); -} // http_proto +} // http } // boost #endif diff --git a/test/unit/rfc/combine_field_values.cpp b/test/unit/rfc/combine_field_values.cpp index 9efcd32b..ee9a7257 100644 --- a/test/unit/rfc/combine_field_values.cpp +++ b/test/unit/rfc/combine_field_values.cpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include #include "test_helpers.hpp" namespace boost { -namespace http_proto { +namespace http { struct combine_field_values_test { @@ -53,7 +53,7 @@ struct combine_field_values_test TEST_SUITE( combine_field_values_test, - "boost.http_proto.combine_field_values"); + "boost.http.combine_field_values"); -} // http_proto +} // http } // boost diff --git a/test/unit/rfc/detail/rules.cpp b/test/unit/rfc/detail/rules.cpp index 1851ea51..f4da2122 100644 --- a/test/unit/rfc/detail/rules.cpp +++ b/test/unit/rfc/detail/rules.cpp @@ -4,7 +4,7 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. @@ -12,10 +12,10 @@ #include "test_rule.hpp" -#if defined(BOOST_HTTP_PROTO_STATIC_LINK) +#if defined(BOOST_HTTP_STATIC_LINK) namespace boost { -namespace http_proto { +namespace http { namespace detail { struct rules_test @@ -58,10 +58,10 @@ struct rules_test TEST_SUITE( rules_test, - "boost.http_proto.rules_test"); + "boost.http.rules_test"); } // detail -} // http_proto +} // http } // boost -#endif // defined(BOOST_HTTP_PROTO_STATIC_LINK) +#endif // defined(BOOST_HTTP_STATIC_LINK) diff --git a/test/unit/rfc/detail/transfer_coding_rule.cpp b/test/unit/rfc/detail/transfer_coding_rule.cpp index 9ec58e76..f0eadd0d 100644 --- a/test/unit/rfc/detail/transfer_coding_rule.cpp +++ b/test/unit/rfc/detail/transfer_coding_rule.cpp @@ -5,7 +5,7 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. @@ -13,14 +13,14 @@ #include "test_helpers.hpp" -#include +#include #include #include -#if defined(BOOST_HTTP_PROTO_STATIC_LINK) +#if defined(BOOST_HTTP_STATIC_LINK) namespace boost { -namespace http_proto { +namespace http { namespace detail { BOOST_STATIC_ASSERT( @@ -80,10 +80,10 @@ struct transfer_coding_rule_test TEST_SUITE( transfer_coding_rule_test, - "boost.http_proto.detail.transfer_coding_rule"); + "boost.http.detail.transfer_coding_rule"); } // detail -} // http_proto +} // http } // boost -#endif // defined(BOOST_HTTP_PROTO_STATIC_LINK) +#endif // defined(BOOST_HTTP_STATIC_LINK) diff --git a/test/unit/rfc/list_rule.cpp b/test/unit/rfc/list_rule.cpp index 9c2361c4..c9b7d3ec 100644 --- a/test/unit/rfc/list_rule.cpp +++ b/test/unit/rfc/list_rule.cpp @@ -4,13 +4,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include -#include +#include #include #include "test_suite.hpp" @@ -18,7 +18,7 @@ #include namespace boost { -namespace http_proto { +namespace http { struct list_rule_test { @@ -90,7 +90,7 @@ struct list_rule_test TEST_SUITE( list_rule_test, - "boost.http_proto.list_rule"); + "boost.http.list_rule"); -} // http_proto +} // http } // boost diff --git a/test/unit/rfc/parameter.cpp b/test/unit/rfc/parameter.cpp index 8537ec85..16884398 100644 --- a/test/unit/rfc/parameter.cpp +++ b/test/unit/rfc/parameter.cpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include #include "test_helpers.hpp" namespace boost { -namespace http_proto { +namespace http { struct parameter_test { @@ -25,7 +25,7 @@ struct parameter_test TEST_SUITE( parameter_test, - "boost.http_proto.parameter"); + "boost.http.parameter"); -} // http_proto +} // http } // boost diff --git a/test/unit/rfc/quoted_token_rule.cpp b/test/unit/rfc/quoted_token_rule.cpp index e70e516c..54dc5b35 100644 --- a/test/unit/rfc/quoted_token_rule.cpp +++ b/test/unit/rfc/quoted_token_rule.cpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include #include "test_helpers.hpp" namespace boost { -namespace http_proto { +namespace http { struct quoted_token_rule_test { @@ -42,7 +42,7 @@ struct quoted_token_rule_test TEST_SUITE( quoted_token_rule_test, - "boost.http_proto.quoted_token_rule"); + "boost.http.quoted_token_rule"); -} // http_proto +} // http } // boost diff --git a/test/unit/rfc/quoted_token_view.cpp b/test/unit/rfc/quoted_token_view.cpp index aa6c9967..8e49d173 100644 --- a/test/unit/rfc/quoted_token_view.cpp +++ b/test/unit/rfc/quoted_token_view.cpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { struct quoted_token_view_test { @@ -25,7 +25,7 @@ struct quoted_token_view_test TEST_SUITE( quoted_token_view_test, - "boost.http_proto.quoted_token_view"); + "boost.http.quoted_token_view"); -} // http_proto +} // http } // boost diff --git a/test/unit/rfc/token_rule.cpp b/test/unit/rfc/token_rule.cpp index ee79455a..305e3059 100644 --- a/test/unit/rfc/token_rule.cpp +++ b/test/unit/rfc/token_rule.cpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include #include "test_rule.hpp" namespace boost { -namespace http_proto { +namespace http { struct token_rule_test { @@ -28,7 +28,7 @@ struct token_rule_test TEST_SUITE( token_rule_test, - "boost.http_proto.token_rule"); + "boost.http.token_rule"); -} // http_proto +} // http } // boost diff --git a/test/unit/rfc/upgrade_rule.cpp b/test/unit/rfc/upgrade_rule.cpp index 80a32af4..46a0df74 100644 --- a/test/unit/rfc/upgrade_rule.cpp +++ b/test/unit/rfc/upgrade_rule.cpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include #include "test_rule.hpp" namespace boost { -namespace http_proto { +namespace http { struct upgrade_rule_test { @@ -32,7 +32,7 @@ struct upgrade_rule_test TEST_SUITE( upgrade_rule_test, - "boost.http_proto.upgrade_rule"); + "boost.http.upgrade_rule"); -} // http_proto +} // http } // boost diff --git a/test/unit/sandbox.cpp b/test/unit/sandbox.cpp index c5700ca1..d3bb30cf 100644 --- a/test/unit/sandbox.cpp +++ b/test/unit/sandbox.cpp @@ -4,13 +4,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { /* Four body styles for `parser` @@ -60,7 +60,7 @@ struct sandbox_test TEST_SUITE( sandbox_test, - "boost.http_proto.sandbox"); + "boost.http.sandbox"); -} // http_proto +} // http } // boost diff --git a/test/unit/serializer.cpp b/test/unit/serializer.cpp index 1cde8462..ed363c3e 100644 --- a/test/unit/serializer.cpp +++ b/test/unit/serializer.cpp @@ -5,12 +5,12 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include -#include +#include +#include #include #include @@ -27,7 +27,7 @@ #include namespace boost { -namespace http_proto { +namespace http { struct serializer_test { @@ -982,7 +982,7 @@ struct serializer_test TEST_SUITE( serializer_test, - "boost.http_proto.serializer"); + "boost.http.serializer"); -} // http_proto +} // http } // boost diff --git a/test/unit/server/basic_router.cpp b/test/unit/server/basic_router.cpp index 73b246da..5b848e7f 100644 --- a/test/unit/server/basic_router.cpp +++ b/test/unit/server/basic_router.cpp @@ -4,20 +4,20 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include -#include +#include #include "src/server/route_rule.hpp" #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { struct basic_router_test { @@ -55,7 +55,7 @@ struct basic_router_test explicit handler( int want, system::error_code ec = - http_proto::error::success) + http::error::success) : want_(want) , ec_(ec) { @@ -311,7 +311,7 @@ struct basic_router_test static err_handler err_skip() { return err_handler(0, - http_proto::error::success); + http::error::success); } // must be called, expects ec, returns route::send @@ -368,7 +368,7 @@ struct basic_router_test { params req; auto rv = r.dispatch( - http_proto::method::get, + http::method::get, urls::url_view(url), req); if(BOOST_TEST_EQ(rv.message(), rv0.message())) BOOST_TEST(rv == rv0); @@ -376,7 +376,7 @@ struct basic_router_test void check( test_router& r, - http_proto::method verb, + http::method verb, core::string_view url, route_result rv0 = route::send) { @@ -457,9 +457,9 @@ struct basic_router_test void testUse() { system::error_code const er = - http_proto::error::bad_connection; + http::error::bad_connection; system::error_code const er2 = - http_proto::error::bad_expect; + http::error::bad_expect; // pathless { @@ -790,19 +790,19 @@ struct basic_router_test test_router r; r.use(skip()); BOOST_TEST_THROWS( - check(r, http_proto::method::unknown, "/", route::next), + check(r, http::method::unknown, "/", route::next), std::invalid_argument); } } void testRoute() { - static auto const GET = http_proto::method::get; - static auto const POST = http_proto::method::post; + static auto const GET = http::method::get; + static auto const POST = http::method::post; static system::error_code const er = - http_proto::error::bad_connection; + http::error::bad_connection; static system::error_code const er2 = - http_proto::error::bad_expect; + http::error::bad_expect; // empty { @@ -1054,7 +1054,7 @@ struct basic_router_test { test_router r; BOOST_TEST_THROWS( - r.route("/").add(http_proto::method::unknown, skip()), + r.route("/").add(http::method::unknown, skip()), std::invalid_argument); } @@ -1093,12 +1093,12 @@ struct basic_router_test void testSubRouter() { - static auto const GET = http_proto::method::get; - static auto const POST = http_proto::method::post; + static auto const GET = http::method::get; + static auto const POST = http::method::post; static system::error_code const er = - http_proto::error::bad_connection; + http::error::bad_connection; static system::error_code const er2 = - http_proto::error::bad_expect; + http::error::bad_expect; // sub-middleware { @@ -1232,11 +1232,11 @@ struct basic_router_test void testErr() { - static auto const GET = http_proto::method::get; + static auto const GET = http::method::get; static system::error_code const er = - http_proto::error::bad_connection; + http::error::bad_connection; static system::error_code const er2 = - http_proto::error::bad_content_length; + http::error::bad_content_length; { test_router r; r.use(err_skip()); @@ -1412,7 +1412,7 @@ struct basic_router_test return route::send; }); params req; - r.dispatch(http_proto::method::get, + r.dispatch(http::method::get, urls::url_view(target), req); }; @@ -1430,7 +1430,7 @@ struct basic_router_test void testPctDecode() { - static auto const GET = http_proto::method::get; + static auto const GET = http::method::get; // slash { @@ -1466,7 +1466,7 @@ struct basic_router_test void testDetach() { - static auto const GET = http_proto::method::get; + static auto const GET = http::method::get; { test_router r; r.use(next()); @@ -1618,7 +1618,7 @@ struct basic_router_test TEST_SUITE( basic_router_test, - "boost.http_proto.server.basic_router"); + "boost.http.server.basic_router"); -} // http_proto +} // http } // boost diff --git a/test/unit/server/cors.cpp b/test/unit/server/cors.cpp index a49cc9cc..69073c70 100644 --- a/test/unit/server/cors.cpp +++ b/test/unit/server/cors.cpp @@ -4,17 +4,17 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include #include "src/rfc/detail/rules.hpp" #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { #if 0 class field_item @@ -102,7 +102,7 @@ struct cors_test TEST_SUITE( cors_test, - "boost.http_proto.server.cors"); + "boost.http.server.cors"); -} // http_proto +} // http } // boost diff --git a/test/unit/server/route_handler.cpp b/test/unit/server/route_handler.cpp index 264a0b4f..c00ea024 100644 --- a/test/unit/server/route_handler.cpp +++ b/test/unit/server/route_handler.cpp @@ -4,19 +4,19 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include -#include -#include +#include +#include #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { struct route_handler_test { @@ -25,7 +25,7 @@ struct route_handler_test void check( test_router& r, - http_proto::method verb, + http::method verb, core::string_view url, route_result rv0 = route::send) { @@ -38,7 +38,7 @@ struct route_handler_test void testData() { - static auto const POST = http_proto::method::post; + static auto const POST = http::method::post; struct auth_token { @@ -98,7 +98,7 @@ struct route_handler_test TEST_SUITE( route_handler_test, - "boost.http_proto.server.route_handler"); + "boost.http.server.route_handler"); -} // http_proto +} // http } // boost diff --git a/test/unit/server/router_types.cpp b/test/unit/server/router_types.cpp index 78676bc9..a93d2fb0 100644 --- a/test/unit/server/router_types.cpp +++ b/test/unit/server/router_types.cpp @@ -4,17 +4,17 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include -#include +#include +#include #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { struct router_types_test { @@ -52,12 +52,12 @@ struct router_types_test } basic_router r; - r.add(http_proto::method::post, "/", + r.add(http::method::post, "/", [](route_params_base& rp) -> route_result { - BOOST_TEST( rp.is_method(http_proto::method::post)); - BOOST_TEST(! rp.is_method(http_proto::method::get)); + BOOST_TEST( rp.is_method(http::method::post)); + BOOST_TEST(! rp.is_method(http::method::get)); BOOST_TEST(! rp.is_method("GET")); BOOST_TEST(! rp.is_method("Post")); BOOST_TEST( rp.is_method("POST")); @@ -71,7 +71,7 @@ struct router_types_test TEST_SUITE( router_types_test, - "boost.http_proto.server.router_types"); + "boost.http.server.router_types"); -} // http_proto +} // http } // boost diff --git a/test/unit/sink.cpp b/test/unit/sink.cpp index 44b90863..7dda495a 100644 --- a/test/unit/sink.cpp +++ b/test/unit/sink.cpp @@ -8,12 +8,12 @@ // // Test that header file is self-contained. -#include +#include #include "test_helpers.hpp" namespace boost { -namespace http_proto { +namespace http { struct sink_test { @@ -130,7 +130,7 @@ struct sink_test TEST_SUITE( sink_test, - "boost.http_proto.sink"); + "boost.http.sink"); -} // http_proto +} // http } // boost diff --git a/test/unit/source.cpp b/test/unit/source.cpp index c7e6821c..c524547a 100644 --- a/test/unit/source.cpp +++ b/test/unit/source.cpp @@ -8,7 +8,7 @@ // // Test that header file is self-contained. -#include +#include #include #include @@ -16,7 +16,7 @@ #include "test_helpers.hpp" namespace boost { -namespace http_proto { +namespace http { struct source_test { @@ -125,7 +125,7 @@ struct source_test TEST_SUITE( source_test, - "boost.http_proto.source"); + "boost.http.source"); -} // http_proto +} // http } // boost diff --git a/test/unit/static_request.cpp b/test/unit/static_request.cpp index 78a1f9ec..8cf902da 100644 --- a/test/unit/static_request.cpp +++ b/test/unit/static_request.cpp @@ -4,20 +4,20 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include -#include +#include #include #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { struct static_request_test { @@ -118,7 +118,7 @@ struct static_request_test TEST_SUITE( static_request_test, - "boost.http_proto.static_request"); + "boost.http.static_request"); -} // http_proto +} // http } // boost diff --git a/test/unit/static_response.cpp b/test/unit/static_response.cpp index 70b27573..31f7a3c7 100644 --- a/test/unit/static_response.cpp +++ b/test/unit/static_response.cpp @@ -4,18 +4,18 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include -#include +#include #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { class static_response_test { @@ -103,7 +103,7 @@ class static_response_test TEST_SUITE( static_response_test, - "boost.http_proto.static_response"); + "boost.http.static_response"); -} // http_proto +} // http } // boost diff --git a/test/unit/status.cpp b/test/unit/status.cpp index a8eb412a..cd6e5692 100644 --- a/test/unit/status.cpp +++ b/test/unit/status.cpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { class status_test { @@ -171,8 +171,8 @@ class status_test } }; -TEST_SUITE(status_test, "boost.http_proto.status"); +TEST_SUITE(status_test, "boost.http.status"); -} // http_proto +} // http } // boost diff --git a/test/unit/test_helpers.cpp b/test/unit/test_helpers.cpp index 6b2e822c..062c9b80 100644 --- a/test/unit/test_helpers.cpp +++ b/test/unit/test_helpers.cpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // #include "test_helpers.hpp" -#include +#include #include namespace boost { -namespace http_proto { +namespace http { void test_fields( @@ -41,6 +41,6 @@ test_fields( } } -} // http_proto +} // http } // boost diff --git a/test/unit/test_helpers.hpp b/test/unit/test_helpers.hpp index a4a9c7c5..5beaf3e0 100644 --- a/test/unit/test_helpers.hpp +++ b/test/unit/test_helpers.hpp @@ -4,15 +4,15 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_TEST_HELPERS_HPP -#define BOOST_HTTP_PROTO_TEST_HELPERS_HPP +#ifndef BOOST_HTTP_TEST_HELPERS_HPP +#define BOOST_HTTP_TEST_HELPERS_HPP -#include -#include -#include +#include +#include +#include #include #include #include @@ -24,7 +24,7 @@ #include namespace boost { -namespace http_proto { +namespace http { inline std::string const& @@ -105,7 +105,7 @@ bad( BOOST_TEST_EQ(rv.error(), e); } -} // http_proto +} // http } // boost #endif diff --git a/test/unit/test_rule.hpp b/test/unit/test_rule.hpp index 0dd5823e..88d9684a 100644 --- a/test/unit/test_rule.hpp +++ b/test/unit/test_rule.hpp @@ -4,13 +4,13 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // -#ifndef BOOST_HTTP_PROTO_RULE_TESTS_HPP -#define BOOST_HTTP_PROTO_RULE_TESTS_HPP +#ifndef BOOST_HTTP_RULE_TESTS_HPP +#define BOOST_HTTP_RULE_TESTS_HPP -#include +#include #include #include #include @@ -18,7 +18,7 @@ #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { // rule must match the string template @@ -68,7 +68,7 @@ bad( BOOST_TEST_EQ(rv.error(), e); } -} // http_proto +} // http } // boost #endif diff --git a/test/unit/version.cpp b/test/unit/version.cpp index 4ef2201d..638dad84 100644 --- a/test/unit/version.cpp +++ b/test/unit/version.cpp @@ -4,16 +4,16 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -// Official repository: https://github.com/cppalliance/http_proto +// Official repository: https://github.com/cppalliance/http // // Test that header file is self-contained. -#include +#include #include #include "test_suite.hpp" namespace boost { -namespace http_proto { +namespace http { class version_test { @@ -36,7 +36,7 @@ class version_test TEST_SUITE( version_test, - "boost.http_proto.version"); + "boost.http.version"); -} // http_proto +} // http } // boost