Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions srcs/clients/client/src/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ void Client::receiveRequest(void) {
_recvBuff.insert(_recvBuff.end(), Client::_buf, Client::_buf + n);
std::memset(Client::_buf, 0, RECEIVE_LEN);
if (checkIfReceiveFinished(n) == true) {
#ifdef DEBUG_MSG
std::cout << "received data from " << _sd << ": " << _request
<< std::endl;
#endif
break;
}
}
Expand All @@ -105,7 +101,9 @@ void Client::createSuccessResponse() {
}

void Client::parseRequest(short port) {
if (_request.isParsed()) return;
if (_request.isParsed()) {
return;
}
_request.parseRequest(_recvBuff, port);
if (_request.isParsed()) {
_state = METHOD_SELECT;
Expand Down
5 changes: 2 additions & 3 deletions srcs/clients/request/request_parser/include/RequestParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class RequestParser : public IRequestParser {
private:
void splitLinesByCRLF(RequestDts& dts);
void parseRequestLine(RequestDts& dts);
void parseAnchor(RequestDts& dts, size_t pos);
void parseQueryString(RequestDts& dts, size_t pos);
void parseAnchor(RequestDts& dts);
void parseQueryString(RequestDts& dts);
void parseQueryKeyValue(RequestDts& dts, std::string str);
void parseHeaderFields(RequestDts& dts);
void parseCookie(RequestDts& dts);
Expand All @@ -26,7 +26,6 @@ class RequestParser : public IRequestParser {
void parseTransferEncoding(RequestDts& dts);
void parseChunkedEncoding(RequestDts& dts);
std::string getFirstTokenOfPath(RequestDts& dts) const;
bool checkPathForm(RequestDts& dts);
bool allHeaderRecieved(RequestDts& dts);
void setDefaultLocation(
std::list<ILocationConfig*>::const_iterator defaultLocation,
Expand Down
Loading