Update 1.3.0.md

This commit is contained in:
Leonid Stryzhevskyi 2021-10-21 00:42:22 +03:00 committed by GitHub
parent a0818026d9
commit 1d12e47638
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,10 +11,11 @@ Contents:
- [JSON Serializer Escape Flags](#json-serializer-escape-flags)
- [ConnectionMonitor](#connectionmonitor)
- [Request Data Bundle](#request-data-bundle)
- [ConnectionProviderSwitch](#connectionproviderswitch)
- [Response::getBody()](#responsegetbody)
- [data::stream::FIFOStream](#datastreamfifostream)
- [data::stream::BufferedInputStream](#datastreambufferedinputstream)
- [oatpp::parser::json::mapping::Serializer::Config::alwaysIncludeRequired](#oatppparserjsonmappingSerializerConfigalwaysIncludeRequired)
- [oatpp::parser::json::mapping::Serializer::Config::alwaysIncludeRequired](#oatppparserjsonmappingserializerconfigalwaysincluderequired)
## The New oatpp::String
@ -198,6 +199,40 @@ ENDPOINT("GET", "videos/{videoId}", getVideoById,
}
```
## ConnectionProviderSwitch
[#483](https://github.com/oatpp/oatpp/issues/483)
`oatpp::network::ConnectionProviderSwitch` can be used to change connection providers on the go, ex.: when you want to reload an SSL certificate without stopping the server.
```cpp
/* create server connection provider component */
/* use ConnectionProviderSwitch instead of a regular ServerConnectionProvider */
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::network::ConnectionProviderSwitch>, serverConnectionProvider)([this] {
/* create SSL provider */
auto sslProvider = oatpp::libressl::server::ConnectionProvider::createShared(...);
/* create oatpp::network::ConnectionProviderSwitch*/
return std::make_shared<oatpp::network::ConnectionProviderSwitch>(sslProvider /* current provider */);
}());
...
void reloadCert() {
/* get server connection provider component */
OATPP_COMPONENT(std::shared_ptr<oatpp::network::ConnectionProviderSwitch>, providerSwitch);
/* create new SSL provider with new cert */
auto sslProvider = oatpp::libressl::server::ConnectionProvider::createShared(...);
/* set new provider */
providerSwitch->resetProvider(sslProvider);
}
```
## Response::getBody()
`oatpp::web::protocol::http::outgoing::Response` has a new method `getBody()` to retreive the body of the response.