RanniSch / webserv

0 stars 2 forks source link

Configuration: Setup default error page (try to change the error 404). #38

Closed MaxIhme closed 10 months ago

MaxIhme commented 10 months ago

functionality works but when I change the config and restart, gives segfault.

tried with http://localhost:8000/cgi-bi.gh comes 404 - works as expected

change config to: server { error404 error/error500.html; }

and with the same url error 500 comes - works as expected

BUT SEGFAULT: "READING AND PARSING! [NOTHING] TMP_METHOD: [GET] CHOSEN METHOD: [GET] PREPARING RESPONSE 1 PREPARING RESPONSE 2 CRAFTED GET RESPONSE STR ACCEPT CONNECTION => 3DONE

WE HAVE FINISHED WRITING TO THE BROWSER Client Socket: 6 was closed successfuly File deleted successfully: tmp/tmp_file_6 make: *** [e] Segmentation fault: 11 mbp:simplified-serv maxrehberg$ "

tried again, no segfault. And then server was still running, klick on reload. Now hangs forever but gets every second a new PID -> new process???

restarted webserve. error 500 comes as expected. I can reload the page 4 times and all works.

change config to: server {

error404 error/error404.html;

}

default error page will be shown as expected. but again a segfault: "mbp:simplified-serv maxrehberg$ make e ./webserv conf/webserve_.conf Information: cannot open your config file. Will take default Config. TestServer constructor called! Start Listening... Start Listening... Start Listening... Finished creating the ports: Listening Socket onject for Port: 8000fd: 3 succesfully created! Listening Socket onject for Port: 8080fd: 4 succesfully created! Listening Socket onject for Port: 8090fd: 5 succesfully created! ERROR: poll() has timed out: : No such file or directory ACCEPT CONNECTION => 3DONE

READING AND PARSING! [NOTHING] TMP_METHOD: [GET] CHOSEN METHOD: [GET] PREPARING RESPONSE 1 PREPARING RESPONSE 2 CRAFTED GET RESPONSE STR ACCEPT CONNECTION => 3DONE

WE HAVE FINISHED WRITING TO THE BROWSER Client Socket: 6 was closed successfuly File deleted successfully: tmp/tmp_file_6 make: *** [e] Segmentation fault: 11 mbp:simplified-serv maxrehberg$ "

restart webserve. everything works. can load the page several times, all good.

change the config again to:

server { error404 error/error500.html; } -> error page correct in the browser, and again segfault:

"mbp:simplified-serv maxrehberg$ make e ./webserv conf/webserve_.conf Information: cannot open your config file. Will take default Config. TestServer constructor called! Start Listening... Start Listening... Start Listening... Finished creating the ports: Listening Socket onject for Port: 8000fd: 3 succesfully created! Listening Socket onject for Port: 8080fd: 4 succesfully created! Listening Socket onject for Port: 8090fd: 5 succesfully created! ERROR: poll() has timed out: : No such file or directory ACCEPT CONNECTION => 3DONE

READING AND PARSING! [NOTHING] TMP_METHOD: [GET] CHOSEN METHOD: [GET] PREPARING RESPONSE 1 PREPARING RESPONSE 2 CRAFTED GET RESPONSE STR ACCEPT CONNECTION => 3DONE

WE HAVE FINISHED WRITING TO THE BROWSER Client Socket: 6 was closed successfuly File deleted successfully: tmp/tmp_file_6 make: *** [e] Segmentation fault: 11 mbp:simplified-serv maxrehberg$ "

RanniSch commented 10 months ago

@MaxIhme and @LukasKava no seg fault for me.

LukasKava commented 10 months ago

Seems to be fixed and working did not hang or segfault

RanniSch commented 10 months ago

works fine