Skip to content

Commit 9aee143

Browse files
committed
all done
1 parent 640c74a commit 9aee143

31 files changed

+18
-400
lines changed

.gitignore

Lines changed: 0 additions & 10 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 0 additions & 72 deletions
This file was deleted.

in.html

Lines changed: 0 additions & 10 deletions
This file was deleted.

index.html

Lines changed: 0 additions & 48 deletions
This file was deleted.

index.php

Lines changed: 0 additions & 4 deletions
This file was deleted.

index.pl

Lines changed: 0 additions & 13 deletions
This file was deleted.

parcing/config.conf

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
server
2-
{
3-
host 127.0.0.1;
4-
listen 9000 7000;
2+
{
3+
host 127.0.0.1;
4+
listen 9000;
55
server_name name1;
66
error_page 400 htmlErrorPages/error400.html;
77
error_page 404 htmlErrorPages/error404.html;
8-
error_page 404 htmlErrorPages/error404.html;
98
max_client_body_size 20000000;
9+
1010
location / {
1111
allow_methods GET POST;
12-
index index.html index.php;
1312
autoindex 1;
14-
root /Users/hait-moh/Desktop/webserv/webserve;
13+
root /Users/yagnaou/Desktop/webserve;
1514
cgi_pass pl /usr/bin/perl;
16-
cgi_pass php /Users/hait-moh/Desktop/webserv/webserve/php-cgi;
15+
cgi_pass php /Users/yagnaou/Desktop/webserve/php-cgi;
1716
}
1817

1918
location /dir {
2019
allow_methods GET POST DELETE;
21-
index in.html index.php;
20+
index index.html index.php;
2221
autoindex 1;
23-
root /Users/hait-moh/Desktop/webserv/webserve;
22+
root /Users/yagnaou/Desktop/webserve;
2423
}
25-
}
24+
}

parcing/parcer.cpp

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
1-
/* ************************************************************************** */
2-
/* */
3-
/* ::: :::::::: */
4-
/* parcer.cpp :+: :+: :+: */
5-
/* +:+ +:+ +:+ */
6-
/* By: azabir <[email protected]> +#+ +:+ +#+ */
7-
/* +#+#+#+#+#+ +#+ */
8-
/* Created: 2023/03/01 16:25:41 by azabir #+# #+# */
9-
/* Updated: 2023/03/01 16:25:42 by azabir ### ########.fr */
10-
/* */
11-
/* ************************************************************************** */
12-
131
#include "parcer.hpp"
142

15-
16-
173
bool config::operator==(const config& conf) {
184
bool hasSharedPort = false;
195
bool hasSharedName = false;
@@ -32,7 +18,7 @@ bool config::operator==(const config& conf) {
3218
}
3319

3420
bool is_special(char c) {
35-
if (c == '{' || c == ';' || c == '}' || c == ' ' || c == '\n')
21+
if (c == '{' || c == ';' || c == '}' || c == ' ' || c == '\n' || c == '\t')
3622
return true;
3723
return false;
3824
}
@@ -79,7 +65,6 @@ void add_default_params(config& conf, config& deflt) {
7965
conf.ports = conf.ports.empty() ? deflt.ports : conf.ports;
8066
conf.host = conf.host.empty() ? deflt.host : conf.host;
8167
conf.server_names = conf.server_names.empty() ? deflt.server_names : conf.server_names;
82-
//conf.client_max_body_size = conf.client_max_body_size.empty() ? deflt.client_max_body_size : conf.client_max_body_size;
8368
conf.err_pages_struct = conf.err_pages_struct.empty() ? deflt.err_pages_struct : conf.err_pages_struct;
8469
if (conf.routes.empty())
8570
conf.routes = deflt.routes;
@@ -119,7 +104,7 @@ std::vector<std::string> readFile(std::string file_path) {
119104
}
120105
if (tmp != "")
121106
cmd.push_back(tmp);
122-
if (file_content[i] != ' ' && is_special(file_content[i])) {
107+
if (file_content[i] != ' ' && file_content[i] != '\t' && is_special(file_content[i])) {
123108
tmp = file_content[i];
124109
cmd.push_back(tmp);
125110
}
@@ -327,13 +312,3 @@ std::vector<config> getServersInfos(std::string configFilePath) {
327312
}
328313
return servers;
329314
}
330-
331-
// int main(int arc, char** av) {
332-
// std::vector<config> servers;
333-
// try {
334-
// servers = getServersInfos(av[1]);
335-
// std::cout << "Number of servers: " << servers.size() <<"\n";
336-
// } catch (std::exception& obj) {
337-
// std::cout << obj.what();
338-
// }
339-
// }

runtest.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

sample-mp4-file.mp4

-10.1 MB
Binary file not shown.

0 commit comments

Comments
 (0)