Skip to content

Commit

Permalink
update after tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Matisse Chenavas committed Jun 26, 2024
1 parent 94bdd23 commit c045ebf
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 229 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: agaley <agaley@student.42lyon.fr> +#+ +:+ +#+ #
# By: mchenava <mchenava@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/12/15 15:51:13 by agaley #+# #+# #
# Updated: 2024/06/26 02:36:25 by agaley ### ########lyon.fr #
# Updated: 2024/06/26 10:53:29 by mchenava ### ########.fr #
# #
# **************************************************************************** #

Expand All @@ -17,8 +17,8 @@ CXXFLAGS = -Wall -Wextra -Werror -MMD -std=c++98
DEBUGFLAGS = -g3

SRC_DIR = src
OBJ_DIR = obj
DEBUG_OBJ_DIR = obj_debug
OBJ_DIR = .obj
DEBUG_OBJ_DIR = .obj_debug
LOG_DIR = ./logs

LOG_FILE_EXT = .log
Expand Down
34 changes: 0 additions & 34 deletions NXtest_conf.conf

This file was deleted.

74 changes: 0 additions & 74 deletions benchmark

This file was deleted.

16 changes: 0 additions & 16 deletions check_workers.py

This file was deleted.

1 change: 0 additions & 1 deletion index.html

This file was deleted.

1 change: 0 additions & 1 deletion light.cfg

This file was deleted.

8 changes: 4 additions & 4 deletions local.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ server {

client_max_body_size 1048576; # 1MB

root /mnt/e/webserv/site;
root /home/mchenava/webserv/site;
index index.html;

location / {
Expand Down Expand Up @@ -52,7 +52,7 @@ server {
server {
listen 8082;
server_name nextflix.fr;
root /mnt/e/webserv/nextflix;
root /home/mchenava/webserv/nextflix;
index index.html;

location / {
Expand Down Expand Up @@ -108,8 +108,8 @@ server {

server {
listen 8081 default_server;
server_name static.1.fr;
root /mnt/e/webserv/html-website-templates/Landing\ Page\ Website\ for\ App/;
server_name static1.fr;
root /home/mchenava/webserv/html-website-templates/static1;
index index.html;

location / {
Expand Down
57 changes: 0 additions & 57 deletions server_config.cfg

This file was deleted.

16 changes: 12 additions & 4 deletions src/HTTPResponse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
/* ::: :::::::: */
/* HTTPResponse.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mchenava < mchenava@student.42lyon.fr> +#+ +:+ +#+ */
/* By: mchenava <mchenava@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/30 16:12:07 by agaley #+# #+# */
/* Updated: 2024/06/25 18:59:41 by mchenava ### ########.fr */
/* Updated: 2024/06/26 10:42:42 by mchenava ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -314,13 +314,21 @@ ssize_t HTTPResponse::_sendAllFile(int clientSocket, FILE* file) {

off_t offset = 0;
ssize_t bytesSent;

int trys = 0;
while (offset < file_length) {
bytesSent =
sendfile(clientSocket, fileno(file), &offset, file_length - offset);
if (bytesSent == -1) {
throw Exception("(sendfile) Error sending response");
if (trys > 3) {
throw Exception("(sendfile) Error sending response" +
std::string(strerror(errno)));
}
trys++;
usleep(1000);
continue;
}
trys = 0;
offset += bytesSent;
}
return offset; // Retourne le nombre total de bytes envoyés
}
Expand Down
34 changes: 0 additions & 34 deletions test_conf.conf

This file was deleted.

Binary file removed ubuntu_cgi_tester
Binary file not shown.

0 comments on commit c045ebf

Please sign in to comment.