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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user