mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-02 03:47:53 +08:00
test httpd_proxy demo
This commit is contained in:
parent
7783529c47
commit
af816bd946
@ -151,9 +151,14 @@ bool http_servlet::doConnect(request_t& req, response_t&)
|
|||||||
}
|
}
|
||||||
printf("connect %s ok, fd=%d\r\n", host.c_str(), peer->sock_handle());
|
printf("connect %s ok, fd=%d\r\n", host.c_str(), peer->sock_handle());
|
||||||
|
|
||||||
//acl::socket_stream* local = &req.getSocketStream();
|
//#define USE_REFER
|
||||||
|
|
||||||
|
#ifdef USE_REFER
|
||||||
|
acl::socket_stream* local = &req.getSocketStream();
|
||||||
|
#else
|
||||||
acl::socket_stream* local = new acl::socket_stream;
|
acl::socket_stream* local = new acl::socket_stream;
|
||||||
local->open(req.getSocketStream().sock_handle());
|
local->open(req.getSocketStream().sock_handle());
|
||||||
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
const char* ok = "";
|
const char* ok = "";
|
||||||
@ -178,8 +183,7 @@ bool http_servlet::doConnect(request_t& req, response_t&)
|
|||||||
|
|
||||||
transfer_tcp(local, peer);
|
transfer_tcp(local, peer);
|
||||||
|
|
||||||
delete peer;
|
#ifndef USE_REFER
|
||||||
|
|
||||||
int fd = local->unbind_sock();
|
int fd = local->unbind_sock();
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
acl::socket_stream& ss = req.getSocketStream();
|
acl::socket_stream& ss = req.getSocketStream();
|
||||||
@ -188,6 +192,8 @@ bool http_servlet::doConnect(request_t& req, response_t&)
|
|||||||
ss.unbind_sock();
|
ss.unbind_sock();
|
||||||
}
|
}
|
||||||
delete local;
|
delete local;
|
||||||
|
#endif
|
||||||
|
delete peer;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user