summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4ceadb2)
raw | patch | inline | side by side (parent: 4ceadb2)
author | Eric Wertz <ericwertz@Erics-MacBook-Pro.local> | |
Fri, 30 May 2025 23:47:24 +0000 (19:47 -0400) | ||
committer | Eric Wertz <ericwertz@Erics-MacBook-Pro.local> | |
Fri, 30 May 2025 23:47:24 +0000 (19:47 -0400) |
backend/HTTPResponse.cpp | patch | blob | history |
index cc1fe2031e4b18462261e9dc644040a84bf29522..b0e997134a2d336a50659236da387a574617a674 100644 (file)
--- a/backend/HTTPResponse.cpp
+++ b/backend/HTTPResponse.cpp
std::string CHTTPResponse::_wwwDir = "";
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
// Base CHTTPResponse Implementation
CHTTPResponse::CHTTPResponse(const CHTTPRequest& request) : _request(request)
{
out << responseBody.str();
- write(_request.getSocket(), out.str().c_str(), out.tellp());
+ if( write(_request.getSocket(), out.str().c_str(), out.tellp()) == -1 )
+ {
+ die("Failed to write response to socket");
+ }
}
\ No newline at end of file