redone _read_request(). Should work with any BUFSIZE.

+ WIP in some aspects. Need to adjust parse_request() among others things.
+ update memo.txt
This commit is contained in:
LuckyLaszlo
2022-08-07 05:41:01 +02:00
parent 8ec1353723
commit 4ab099ee4d
4 changed files with 75 additions and 13 deletions

View File

@@ -5,7 +5,12 @@
* COPLIENS
*********************************************/
Client::Client() : fd(0), status(0) {
Client::Client()
: fd(0),
status(0),
header_complete(false),
read_body_size(0)
{
return;
}
@@ -52,6 +57,8 @@ void Client::parse_request()
void Client::clear()
{
clear_request();
header_complete = false;
read_body_size = 0;
raw_request.clear();
response.clear();
status = 0;
@@ -125,6 +132,8 @@ void Client::_parse_request_headers( std::vector<std::string> list )
void Client::_parse_request_body( size_t pos )
{
// TODO : a revoir avec une std::string,
// pour ne pas avoir le probleme d'un '0' qui marque la fin des données
std::string body = &raw_request[pos];
_request.body = body;