Giter VIP home page Giter VIP logo

webserv's Issues

Http proxy 만들기

Class 설명

  • EnvironmentValues
    서버에서 관리할 환경변수를 저장하고 관리하는 클래스
  • HttpMessage
    http프로토콜 메시지 규약에 맞춰서 start line(protocol version), header, body 변수와 getter 소유
  • RequestMessage
    HttpMessage 클래스를 상속받음
    requestMessage의 속성과 getter 소유
  • ResponseMessage
    HttpMessage 클래스를 상속받음
    responseMessage의 속성과 getter, setter 소유
  • HttpResponeMessage
    socket에서 읽어들인 requestString과, Environment 객체, locations 객체를 매개변수로 받는 생성자를 소유할 예정임.
    생성과 동시에 requestMessaage객체, reponseMessage객체 만듦, 서버입장에서 responseMessage객체를 만들 수 있도록 하는 여러가지 메소드 제공 예정.
  • (Server)MethodExecutor
    http method를 실행해줄 메소드를 소유.
    파일을 찾거나, 제거하거나 하는 등의 역할을 할 것임.
  • Utils
    스태틱 클래스로 바꿀거임. split() ltrim() 등 이름있는 유틸함수는 여기다가 넣을 예정.

HeaderAdder클래스생성 및 DefaultMethodExecutor 보완

  • HeaderAdder Class 생성 및 구현
    • 필수적으로 붙여줘야 하는 헤더의 값을 반환하는 메소드들 구현
    • 모든 메소드를 한번에 실행해주는 exexute 메소드 구현
  • ExtenedAdder Class 생성 및 구현
    • HeaderAdder Class를 상속받는 클래스로 Optional한 헤더들의 값을 반환하는 메소드를 소유할 것
    • 부모의 execute 메소드 overriding하기
  • DefaultMethodExecutor 수정
    • 요청 헤더 타입 확인하고 요구에 맞는 동작하는 것 추가하기
  • ReponseBuilder 내부 수정 및 추가

server/코드 리펙토링

  • errno=35 해결
  • 누수 해결
  • 리펙토링
  • Client::lm 삭제
  • CgiMethodExecutor 소멸자 -> stdin_fd, stdout_fd 닫기
  • 리눅스에서도 블락 걸리도록 수정
  • recv 인자 수정
  • 삭제된 client 이벤트 무시하도록 수정
  • [ ]

ConfigParser 만들기

  • config파일 지시어 단위로 파싱
  • 지시어 tree 만들기
  • 지시어 tree로 모듈 생성
  • config클래스에 모듈 담기

메서드 추가 구현 및 에러 고치기 및 통합테스트 진행

진행할 사항은 아래와 같습니다. 혹시 빠졌거나 더 필요하다싶은게 있다면 알려주세요 ^.^

  • methodExecutor::putMethod() 구현하기
  • HttpResponseBuilder 생성자에서 변수들 추가 초기화하기
  • url이 디렉토리일시에 index 이름 붙이기 전에 url뒤에 '/'없으면 '/'붙여주기
  • 오토인덱스 구현하기
  • cgi 생성물 파싱할 때 헤더가 여러개일 수 있음을 고려하기
  • ServerError 클래스 및 메소드들 이름 더 적합하게 바꾸기
  • response body가 없을 때 메서드를 체크하여 필요할 때 만 응답페이지 생성하기
  • body_max_size 지시어 고려하여 메서드 작성하기
  • 요청 메시지가 짤려서 여러번 나눠오는 것을 고려한 관련 메서드 만들기
  • http요청의 connetion 헤더 확인하고 값이 close일시 사용자(소영이)에게 알리기
  • error_page 지시어 고려하기(리다이렉트)

컴파일 에러 체크

  • 소스파일들을 각자의 폴더로 나누기
  • 메이크 해보기
  • 각자 컴파일 에러 고치기

소켓 관련 클래스 구조 변경

ServerHandler

  • ServerHandler::servers -> std::map으로 변경
  • Server -> fd(ip:port) 기준 생성

Server

  • Server::Server(ServerConfig)로 수정
  • Server::clients 삭제
  • Server에 std::vector 추가
  • operator== 삭제 <- ServerConfig에 옮겨야 하나?

Client

  • Client(Server *)로 변경
  • recev_msg 분리

connection close 추가

  • response에 connection:close 헤더 존재 시 클라이언트 삭제하는 기능 구현

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.