style: renames

This commit is contained in:
3lswear
2022-01-25 23:50:14 +03:00
parent 477eb248f4
commit 150447c58c
2 changed files with 11 additions and 11 deletions

View File

@@ -47,9 +47,9 @@ HeaderHandl Header::getRequest(void)
return (_request); return (_request);
} }
HeaderHandl Header::getRespons(void) HeaderHandl Header::getResponse(void)
{ {
return (_respons); return (_response);
} }
int Header::getFd(void) int Header::getFd(void)
@@ -196,7 +196,7 @@ int Header::isDir(std::string path)
return (-1); return (-1);
} }
void Header::OpenResponsFile(const char *path) void Header::OpenResponseFile(const char *path)
{ {
std::stringstream ss; std::stringstream ss;
char buf[BUFFSIZE + 1] = {0}; char buf[BUFFSIZE + 1] = {0};
@@ -233,7 +233,7 @@ int Header::sendHeader(int fd)
return (0); return (0);
} }
int Header::sendRespons(int fd) int Header::sendResponse(int fd)
{ {
std::string path; std::string path;
@@ -242,7 +242,7 @@ int Header::sendRespons(int fd)
if (_ret == 200 && isDir(path) == 0) if (_ret == 200 && isDir(path) == 0)
_fileToSend = Autoindex::getPage(_request._URI, _request._host); _fileToSend = Autoindex::getPage(_request._URI, _request._host);
else if (_ret == 200) else if (_ret == 200)
OpenResponsFile(path.c_str()); OpenResponseFile(path.c_str());
else else
_fileToSend = getErrorPage(_ret); _fileToSend = getErrorPage(_ret);
send(fd, _fileToSend.c_str(), _fileToSend.length(), 0); send(fd, _fileToSend.c_str(), _fileToSend.length(), 0);
@@ -319,7 +319,7 @@ std::string Header::getReasonPhrase(int code)
//-------------------------------------------------Other--------------------------------------- //-------------------------------------------------Other---------------------------------------
void Header::printHeaderInfo(void) void Header::printInfo(void)
{ {
std::map<std::string, std::string>::iterator it; std::map<std::string, std::string>::iterator it;

View File

@@ -9,7 +9,7 @@ class Header
{ {
private: private:
HeaderHandl _request; HeaderHandl _request;
HeaderHandl _respons; HeaderHandl _response;
private: private:
int _row; int _row;
@@ -26,7 +26,7 @@ private:
public: public:
std::map<std::string , std::string> getHeaderField(void); std::map<std::string , std::string> getHeaderField(void);
HeaderHandl getRequest(void); HeaderHandl getRequest(void);
HeaderHandl getRespons(void); HeaderHandl getResponse(void);
std::string getReasonPhrase(std::string); std::string getReasonPhrase(std::string);
std::string getReasonPhrase(int); std::string getReasonPhrase(int);
std::string getErrorPage(int code); std::string getErrorPage(int code);
@@ -37,15 +37,15 @@ public:
void initErrorCode(void); void initErrorCode(void);
int isFile(std::string); int isFile(std::string);
int isDir(std::string); int isDir(std::string);
void OpenResponsFile(const char *path); void OpenResponseFile(const char *path);
int parseStartLine(std::string); int parseStartLine(std::string);
void parseURI(std::string); void parseURI(std::string);
int parseHeaderfield(std::string); int parseHeaderfield(std::string);
void printHeaderInfo(void); void printInfo(void);
int parseRequest(void); int parseRequest(void);
int sendRespons(int fd); int sendResponse(int fd);
int sendHeader(int fd); int sendHeader(int fd);
void clear(void); void clear(void);
Header(); Header();