Giter Club home page Giter Club logo

webserv's People

Contributors

gmarcha avatar nullswan avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

gmarcha

webserv's Issues

[Server] Garbage collector

Enhance Client timeout checker.
In case our server is under high load, we must still trigger garbage collection.
This will be also used to clear any CGI process that are running for too long.

[Config] Default config

Setup default settings when no argument (ie. no config file) is passed.

Default config eventually expose a /ping GET endpoint, otherwise anything will be 404.
(Default autoindex off)

[Request] Multiline parsing

  • Before using non-blocking file descriptors, recv() function was waiting for the end of the request message.
  • Now, fds are set to non-blocking operations: the goal is to be able to read a full request with multiple call to recv().
  • To solve the issue, when the server receive a new input on an active socket, it has to create a new Request object if client input is a request-line (i.e. GET / HTTP/1.1), but after that, it should parse headers and optional body (if post request) to the existing request object.
  • Tricky point: handling both application/x-www-form-urlencoded and multipart/form-data;boundary="boundary"

[Config] Listen

Setup following rules:

server {
	server_name (IServer._name<std::string>)
	listen		(IServer._host<std::string>):(IServer._port<int>);

	// or

	listen		:(IServer._port<int>);

	// or

	listen		(IServer._port<int>);

	// or

	listen		(IServer._host<std::string>);	// port 80 is used

	/* 
		If listen is not defined, *:80 is used 
		if webserv runs with the superuser privileges, 
		or *:8000 otherwise. 
	*/
}

[Server] CGI

Handle CGI system.

This must be asynchronous.
In case a CGI is too long, it must be killed by our garbage collector, triggered when epoll_wait contain no events, view #14 .

Define how we await CGI.

[Logger] URI must be longer

Make logger uri placeholder longer to prevent overlap.

[WEBSERV] 2021/12/01 - 13:54:49 | GET     / | 404 |    63 μs | 127.0.0.1 -> 0.0.0.0
[WEBSERV] 2021/12/01 - 13:54:49 | GET     /favicon.ico | 404 |    34 μs | 127.0.0.1 -> 0.0.0.0

It should be aligned, ie:

[WEBSERV] 2021/12/01 - 13:54:49 | GET     /                             | 404 |    63 μs | 127.0.0.1 -> 0.0.0.0
[WEBSERV] 2021/12/01 - 13:54:49 | GET     /favicon.ico            | 404 |    34 μs | 127.0.0.1 -> 0.0.0.0

[Config] Server block

Handle server block with their attributes.

  • server_name
  • host
  • port
  • index
  • error_pages

In case we have a duplicate host:port, only the first one will be used.

[Request] Handling case (sensitive or insensitive) in request

  • In the request-line (first line in request), apart from the method which is case sensitive and has to be in uppercase, the URI and http version are case insensitive: they are converted to lowercase.
  • Headers are case insensitive too, and we should convert them to lowercase when we parse them.
  • Case variations should be kept in the payload!

[Config] upload_pass

Setup a upload pass member that allowed file upload and root them to this specific directory.

[poll] vhosts

Handle virtuel hosts when merging servers.
If one vHost exist, we must try to match before using default server host configuration.

[Request] Handling invalid request

  • Handling different invalid requests: bad request, wrong http version, not implemented, invalid multipart request, payload too large, etc..

[Request] Object lifetime

Setup Webserv::Http::Request object lifetime.

This object should be instanced while reading request in Webserv::Http::Client.
He must contains several members referring to her buffer parsing result.
Along with several methods, is this a closed, chuncked request ?

[Config] IBlock

Handle IBLock and their attributes.

  • autoindex
  • root
  • redirect
  • body_limit
  • allowed_methods
  • cgi_pass

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.