mirror of
https://github.com/oatpp/oatpp.git
synced 2025-01-18 16:43:57 +08:00
Update 1.3.0.md
This commit is contained in:
parent
a0818026d9
commit
1d12e47638
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user