-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/61/subject tester #63
Conversation
Fix bug when client sends headers separately Additional tasks - Add CHUNKED_END to macro.hpp - Add isNewRequest to Worker class - Add test files to YoupiBanane Co-authored-by: Soyeon Kim <eden.sy.kim@gmail.com>
Fix isCgi() to compare with supported extensions in location block Fix problem having wrong child location blocks by adding setChildLocationBlock() Additional tasks - Restore stderr fd after excuting CGI program - Move isCgi() from utils to Worker class Co-authored-by: srngch <srngch.dev@gmail.com> Co-authored-by: Soyeon Kim <eden.sy.kim@gmail.com>
- Fix Cgi execute() to read and write over 64KB - Add custom HTTP_ headers to be passed as Cgi env - Implement Uri redirection - Fix HttpException makeHtml() not to send response body when 204 No Content - Fix response 204 to non-cgi POST request - Implement PUT for tester - Fix Worker bodyLength to be initialized for every new request Additional tasks - Fix default config file parsing error - Remove useless macros Co-authored-by: srngch <srngch.dev@gmail.com> Co-authored-by: Soyeon Kim <eden.sy.kim@gmail.com>
Modify chunked request parsing logic - Parse chunked size and chunked data every recv() Additional tasks - Add util hasWordInCharV() - Refactor Worker recv() Co-authored-by: srngch <srngch.dev@gmail.com> Co-authored-by: Soyeon Kim <eden.sy.kim@gmail.com>
Fix error when client is over 100 - Master listen() backlog (2 => 100000) - Worker poll() timeout (-1 => 5000) - Nginxs POLLFDSLEN (100 => 1000) Co-authored-by: srngch <srngch.dev@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
변경 사항 확인했습니다 수고 많으셨어요!
@@ -39,7 +39,7 @@ void Nginxs::run() { | |||
pollfds_[fds].fd = -1; | |||
|
|||
while (1) { | |||
ret = poll(pollfds_, POLLFDSLEN, -1); | |||
ret = poll(pollfds_, POLLFDSLEN, 5000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
poll()에 설정한 타임아웃 시간동안 아무 이벤트가 발생하지 않으면 0을 반환하는데 이에 대한 처리도 필요해 보입니다~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0을 반환한다는 것은 이벤트가 발생한 fd가 없다는 뜻이므로, 아래 masters를 순회하는 반복문 내부의 if 문 조건에 걸리지 않기 때문에 따로 예외처리를 할 필요가 없어 보입니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
위에서 잘못 설명한 부분을 정정합니다 poll() 이 하는 역할이 어떤 fd 에 이벤트가 발생할 때까지 block 하는 것이 아니라 fd가 준비될 때까지 block 하는 것인데 이때 타임아웃을 설정한다는 것의 의미는 클라이언트가 무한히 대기하지 않고 일정 시간이 지나면 에러 페이지를 반환 받을 수 있는 데에 의미가 있습니다. 만약에 반환값 0에 대한 처리를 따로 하지 않는다면 기존에 타임아웃이 무한이었던 것과 다른 점이 없지 않나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
첫 번째 의견에서 말한게 맞았네요 이벤트가 발생한 것이 없을 때 0을 반환하는게 맞는데, 이때에는 for 문을 돌면서 일일이 모든 마스터에 이벤트가 발생했는지 확인할 필요 없이 바로 continue 를 해주는 것이 효율 상 좋아보입니다.
작업 내용
리뷰어에게