??????????????????????????????? C /Perl ????д?????? CGI???Щ????????ν???????????????????????????????????????? CGI ??????????????????????????? CGI ????????????????????“???”????????????????????????????????????????й??????????????CGI ??????????????????????? PHP?? JSP/Servlet?? ASP ??????? WEB ????????г??????????????????? C д CGI???????о?????????????
?????????????? WEB ??????????????????????и???????????????????????Ч??????? CGI ??????????????Щ????????????Ч????????????????????????????????????????????????????У??? facebook ?? WEB ???????????? PHP д???????????????Ч?????????λ?????????????????? PHP ??????? C++ ?????????hiphop)?????????Ч?????????????????????淴???????????????????????????????е????Щ??
????????????????? acl_cpp ?????й? WEB ????????????????????????????е?????????????????? JAVA HttpServlet ??????????? Oracle ???????????????????????????C/C++????????????? Java Servlet ???? WEB ??????飬?????????????????????????????????????? WEB ???????????????Щ????????÷???????????????????????濪????????? acl_cpp ???е? http/ ????μ?????? web ????
?????? acl_cpp/src/http ????£??м??????? WEB ???????HttpServlet??HttpServletRequest?? HttpServletResponse?? HttpSession?? http_header?? http_mime?? http_client?????????????????????÷???????? WEB ?????????????????????????????????
???????HttpServlet ??
??????????????????????
????/**
????* ??????
????*/
????HttpServlet(void);
????/**
????* ?????????????????????????????????????
????*/
????virtual ~HttpServlet(void) =0;
??????????????У??????? HttpSession ?????洢???????????? memcached ?????????????????????? memcached ???洢 session ????????????????????????? redis ??????????????????? session ?? cookie ID ?????????????????
?????????????????????????????????????? HTTP ????
/**
* ?? HTTP ????? GET ???????麯??
*/
virtual bool doGet(HttpServletRequest&?? HttpServletResponse&);
/**
* ?? HTTP ????? POST ???????麯??
*/
virtual bool doPost(HttpServletRequest&?? HttpServletResponse&);
/**
* ?? HTTP ????? PUT ???????麯??
*/
virtual bool doPut(HttpServletRequest&?? HttpServletResponse&);
/**
* ?? HTTP ????? CONNECT ???????麯??
*/
virtual bool doConnect(HttpServletRequest&?? HttpServletResponse&);
/**
* ?? HTTP ????? PURGE ???????麯?????÷???????? SQUID ?????
* ??????
*/
virtual bool doPurge(HttpServletRequest&?? HttpServletResponse&);
??????????? HttpServlet ?????п??????????????????????????????????????? HTTP ????
????????????? HttpServlet ??????е??????
/**
* HttpServlet ????????У????? HTTP ????????????? doXXX ?麯??
* @param session {session&} ?洢 session ????????
* @param stream {socket_stream*} ???? acl_master ??????????????
*  ????????ò?????????????? apache ???? CGI ???????????ò???
*  ??? NULL???????ú??????????????????????????д?????????
*  ?????????????????????? acl_master ??????
* @param body_parse {bool} ??? POST ???????ò????????????
*  ??? HTTP ?????????岢?? n/v ??????з???????? true ????
*  ?????? HTTP ????????????????з?????????????? getParameter
*  ????????????? URL ?е?????????????? POST ????????
*  ??????????ò???? false ????????????
* @param body_limit {int} ??? POST ??????????????????????
*  ???????????????????????????????????????????? MIME
*  ????? body_read ? false?????????Ч
* @return {bool} ?????????
*/
bool doRun(session& session?? socket_stream* stream = NULL??
bool body_parse = true?? int body_limit = 102400);
/**
* HttpServlet ????????У????? HTTP ????????????? doXXX ?麯????
* ???????????ζ????? memcached ???洢 session ????
* @param memcached_addr {const char*} memcached ????????????????IP:PORT
* @param stream {socket_stream*} ???????
* @param body_parse {bool} ???????
* @param body_limit {int} ???????
* @return {bool} ?????????
*/
bool doRun(const char* memcached_addr = "127.0.0.1:11211"??
socket_stream* stream = NULL??
bool body_parse = true?? int body_limit = 102400);
??????????????鷽???У???????????????????HttpServletRequest ?? HttpServletResponse?????????????? http ?????? http ????????????????? HttpServlet ???????????????????????????????????????????????????????????????????
????????HttpServletRequest  ??
?????????????????????????????????????????????????????????????????????????????????????????????? java HttpServlet ???????????????????????????????????????????
/**
* ??? HTTP ?????е??????????????? URL ??????
* ?????????????????????? GET ????????????
* URL ?? ? ?????????????? POST ?????????????
* URL ?? ? ??????????????????е?????
*/
const char* getParameter(const char* name) const;
/**
* ??? HTTP ????????????? cookie ?
* @param name {const char*} cookie ???????????
* @return {const char*} cookie ????????? NULL ????
*  cookie ???????
*/
const char* getCookieValue(const char* name) const;
/**
* ?????? HTTP ?????? HttpSession ????????
* @return {HttpSession&}
*/
HttpSession& getSession(void);
/**
* ????? HTTP ????????????????????????????
* @return {istream&}
*/
istream& getInputStream(void) const;
/**
* ??? HTTP ????????????????
* @return {acl_int64} ???? -1 ???????? GET ??????
*  ?? HTTP ?????????? Content-Length ???
*/
fdef WIN32
__int64 getContentLength(void) const;
lse
long long int getContentLength(void) const;
ndif
/**
* ?? HTTP ??????е? Content-Type ?
* multipart/form-data; boundary=xxx ????????????????
* ????????????????????????? http_mime ????
* @return {const http_mime*} ???? NULL ???????? MIME ????
*  ????????????????????????? HttpServletRequest ????
*  ???л???????
*/
http_mime* getHttpMime(void) const;
/**
* ??? HTTP ?????????????
* @return {http_request_t}?????? POST ?????е????
*  ?????????????????ú??????????????????????
*/
http_request_t getRequestType(void) const;
?????????????????????????? HttpServletRequest ??????ù???????y?????磺
????getParmeter?? ??????? http ???????
????getCookieValue???????????? cookie ?
????getSession?????? HttpServlet ?????? session ??
????getInputStream????? http ???????????
????getContentLength????? HTTP POST ???????????? HTTP ??????????????
????getRequestType????? HTTP POST ????????????? HTTP ?????????????????????? name=value ?????multipart ???????????????????????