From 1f7f3c4ed13c73d13d74c43bfd1f309caa9fa95c Mon Sep 17 00:00:00 2001 From: Artyom Beilis Date: Wed, 29 Nov 2017 14:26:01 +0200 Subject: [PATCH] Fixed unproperly initialized reserved fields related to #24 --- src/fastcgi_api.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/fastcgi_api.cpp b/src/fastcgi_api.cpp index 116302c..eba8db6 100644 --- a/src/fastcgi_api.cpp +++ b/src/fastcgi_api.cpp @@ -50,6 +50,9 @@ namespace cgi { fastcgi(cppcms::service &srv) : connection(srv), socket_(srv.impl().get_io_service()), + header_(), + full_header_(), + eof_(), eof_callback_(false) { reset_all(); @@ -179,9 +182,9 @@ namespace cgi { full_header_.padding_length = pad_len = 1; full_header_.to_net(); } - else { - pad_len = 1; - } + else { + pad_len = 1; + } packet += io::buffer(&full_header_,sizeof(full_header_)); } else { @@ -218,12 +221,12 @@ namespace cgi { prepare_eof(); packet += io::buffer(&eof_,sizeof(eof_)); } - #ifdef DEBUG_FASTCGI + #ifdef DEBUG_FASTCGI std::pair cnk = packet.get(); - for(size_t i=0;i