Commit Graph

33 Commits

Author SHA1 Message Date
lperrey
2c6bc096cc WIP CGI monitered by epoll
+ OK, but some errors case need to be lookup
2022-08-16 18:38:58 +02:00
LuckyLaszlo
4602844f5a Multiples minors changes (cgi env, comment, ...) 2022-08-16 04:00:33 +02:00
LuckyLaszlo
ce0a004d28 Le merge / 20 2022-08-14 06:30:27 +02:00
LuckyLaszlo
84babec82b added multipart upload file,
it works, but need some adjustements,
refactoring and testing
2022-08-14 06:25:06 +02:00
LuckyLaszlo
b44acafefe CGI discussion and a little bit of work done 2022-08-12 18:08:39 +02:00
hugogogo
2a70c6b26d Merge branch 'hugo3'
+ script output verification works (field duplicate and status)
+ parsing_message_http :
  - the file is deleted
  - of the three functions it contained, only one still exist
  - 'parse_http_headers' is now in utils
+ changes in utils :
  - http headers parsing doesn't change key case itself
  - a new function change key case tolower case in map<str, str>
  - added split_trim() that perform a split and a trim at once
  - resolved pbm in trim
  - added print_special to print special char '\r' and '\n'
  - del_line became extract_line, because it returns the deleted line
  - added get line, that does the same without deleting
  - moved http_header in utils, and made it more consistent
+ in Client :
  - parse_request is now named parse_request_headers to work with parse body
  - private function _parse_request_headers is then now _parse_request_fields
    (because it doesn't take care of request first line, but only fields)
  - added a debug function 'print_client'
2022-08-12 14:05:11 +02:00
LuckyLaszlo
400efbe720 Wip chunked decoding
+ Need to test normal body parsing
+ path_is_valid() renamed eval_file_type()
+ replaced atoi with strtol/strtoul
2022-08-12 05:50:00 +02:00
hugogogo
a1fff0f8c2 added colors, for print_special
+ renamed client's public function parse_request() into parse_request_headers()
2022-08-11 17:46:27 +02:00
hugogogo
ff77dfd298 debug new request parsing 2022-08-11 14:50:56 +02:00
LuckyLaszlo
ab0bc2c4c0 added timeout response (status 408)
+ added EPOLLERR and EPOLLHUP handling
+ fix root substitution for default "/" location (temp or permanent ?)
+ tested siege a little, seems good
2022-08-11 07:12:13 +02:00
hugogogo
1d67e6988d http message parsin wip but really better 2022-08-11 00:28:01 +02:00
LuckyLaszlo
86f7740984 Moved most request errors check in Client
+ bugfix of "Bad file descriptor" due to empty operator=() in Client
+ added a condition in _determine_location_COOP_FIX()
+ udpate memo.txt
+ need fix for index/autoindex (location "/list" dont work)
2022-08-10 07:19:05 +02:00
hugogogo
482a38952e Merge branch 'hugo2'
+ changed the appropriate getters for client
+ moved the functions to parse the http message
  (first line, headers, and body)
  outside client, in parsing_http_message.cpp
+ resolved some of the throw problems
2022-08-09 15:54:40 +02:00
hugogogo
3dad938e3c add extern function for http message parsing
+ wip compare fields server and script
+ g tout cassey
2022-08-09 11:19:46 +02:00
hugogogo
e1a68bc3e4 changes var in client 2022-08-08 18:06:41 +02:00
hugogogo
972f52ebc8 client variables are const ref 2022-08-08 15:36:16 +02:00
hugogogo
da1f4b6e37 cgi exec compare with file method 2022-08-08 13:20:06 +02:00
LuckyLaszlo
1ccf61bc68 assign server and location to client in _read_request() 2022-08-07 17:37:24 +02:00
hugogogo
7ecfc22c7b script path is found and fill 2022-08-07 15:51:36 +02:00
hugogogo
e0fd743b5b key fields headers in map are in lowercase
+ getters for this map are case insensitive
+ change request fiel 'path' for 'uri', 'query', and 'abs_path'
2022-08-07 13:07:50 +02:00
LuckyLaszlo
4ab099ee4d redone _read_request(). Should work with any BUFSIZE.
+ WIP in some aspects. Need to adjust parse_request() among others things.
+ update memo.txt
2022-08-07 05:41:01 +02:00
LuckyLaszlo
8ec1353723 fixed response.append(body) problem.
+ File I/O working but maybe not perfect (it seems complicated to do it with std::filebuf)
+ fixed Content-Type for unknown file extension
2022-08-07 01:38:33 +02:00
hugogogo
63ff42b57d client variables are made const 2022-08-06 19:58:09 +02:00
hugogogo
6f171ec07b wip cgi env variables 2022-08-06 11:34:48 +02:00
LuckyLaszlo
05c7faf1f3 server search for client completed with host:port 2022-08-06 04:46:40 +02:00
LuckyLaszlo
e596d8f093 MIME types map for correct Content-type header
+ append body to string cause encoding problem, so added temp buf in Client.
2022-08-05 04:24:15 +02:00
LuckyLaszlo
0026106bf6 default and custom error pages response
+ refactoring in response.cpp (functions split)
+ added Client::clear()
+ added replace_all_substr() in utils.cpp
2022-08-04 02:52:31 +02:00
LuckyLaszlo
6f5b28dd93 wip, need somes changes in ConfigParser.
+ _determine_location()
+ http_method changes
+ http_method switch in _construct_response()
+ ConfigParser::_str_to_method_type() moved to global utils.cpp
2022-08-03 18:39:22 +02:00
LuckyLaszlo
8f167d85f3 wip integration of client.request and ServerConfig
+ Client get return reference
+ wip binary flags for http_method
+ moved config parser files
2022-08-02 21:11:54 +02:00
hugogogo
f252887d53 merge from hugo, add parsing requests and wip cgi 2022-08-01 20:41:07 +02:00
LuckyLaszlo
ea3f3a390a bugfix invalid ptr in "ev.data.ptr" after vector<Client> resize/erase
+ persistent connections reintroduced
+ bugfix crash if invalid path in request
2022-07-31 13:19:11 +02:00
LuckyLaszlo
ab8dfed779 basic HTTP GET response 2022-07-29 15:52:43 +02:00
LuckyLaszlo
dcf94c2c61 Client struct, signal wip, refactoring 2022-07-25 05:28:44 +02:00