NaoyaFukuma / webserv

This is when you finally understand why a URL starts with HTTP
3 stars 0 forks source link

request headerのkeep-aliveを元にEPOLL EVENTを処理する #39

Closed tomofuji-dev closed 1 year ago

tomofuji-dev commented 1 year ago

Overview

socketの変数としてisShutdownを持たせ、requestを処理した後に更新する EPOLLOUTの後にisShutdownを元にsocketを閉じる or 閉じないを実行する

rdhup_をshould_shutdown_に命名を変える

Purpose

Task

tomofuji-dev commented 1 year ago

onreadableの中での処理の結果、socketの状態は以下の3パターン ・即座にcloseしなければならない ・送信バッファを吐き出してからclose(connection closeなど) ・接続を続ける

ProcessRequestの返り値を上記の3パターンとして、 2つ目だった場合はrdhup_を立てて、shutdown, EPOLLOUTでbufferをクリアできた時点でclose