GCC11 compitatibility fix.

HTTPStreamChunked fix.
Respect https scheme on http_request example.
This commit is contained in:
Martín Lucas Golini
2021-07-03 13:13:35 -03:00
parent 817fadb8fe
commit 6fb24fe918
3 changed files with 3 additions and 2 deletions

View File

@@ -6,6 +6,7 @@
#include <eepp/core/utf.hpp>
#include <functional>
#include <iterator>
#include <limits>
namespace EE {

View File

@@ -31,7 +31,7 @@ ios_size HttpStreamChunked::write( const char* data, ios_size size ) {
retry = false;
// Check for the first \r\n to find the end of the length definition
std::string::size_type lenEnd = mChunkBuffer.find_first_of( "\r\n" );
std::string::size_type lenEnd = mChunkBuffer.find( "\r\n" );
if ( lenEnd != std::string::npos ) {
std::string::size_type firstCharPos = lenEnd + 2;

View File

@@ -84,7 +84,7 @@ EE_MAIN_FUNC int main( int argc, char* argv[] ) {
}
// Set the host and port from the URI
http.setHost( uri.getHost(), uri.getPort() );
http.setHost( uri.getHost(), uri.getPort(), uri.getScheme() == "https" );
// Set the path and query parts for the request
request.setUri( uri.getPathEtc() );