]> Eric's Git Repo - listv4.git/commitdiff
more updates to get linux build to work
authorEric Wertz <ericwertz@Erics-MacBook-Pro.local>
Fri, 30 May 2025 23:47:24 +0000 (19:47 -0400)
committerEric Wertz <ericwertz@Erics-MacBook-Pro.local>
Fri, 30 May 2025 23:47:24 +0000 (19:47 -0400)
backend/HTTPResponse.cpp

index cc1fe2031e4b18462261e9dc644040a84bf29522..b0e997134a2d336a50659236da387a574617a674 100644 (file)
@@ -9,6 +9,10 @@
 
 std::string CHTTPResponse::_wwwDir = "";
 
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 // Base CHTTPResponse Implementation
 CHTTPResponse::CHTTPResponse(const CHTTPRequest& request) : _request(request)
 {
@@ -89,5 +93,8 @@ void CHTTPResponse::send()
 
     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