| 54 | } |
| 55 | |
| 56 | void http_rpc::handle_conn(acl::socket_stream* stream) |
| 57 | { |
| 58 | // HTTP ��Ӧ������ |
| 59 | acl::http_response res(stream); |
| 60 | // ��Ӧ������Ϊ xml ��ʽ |
| 61 | res.response_header().set_content_type("text/html"); |
| 62 | |
| 63 | // �� HTTP ����ͷ |
| 64 | if (res.read_header() == false) |
| 65 | { |
| 66 | keep_alive_ = false; |
| 67 | return; |
| 68 | } |
| 69 | |
| 70 | acl::string buf; |
| 71 | // �� HTTP ���������� |
| 72 | if (res.get_body(buf) == false) |
| 73 | { |
| 74 | keep_alive_ = false; |
| 75 | return; |
| 76 | } |
| 77 | |
| 78 | acl::http_client* client = res.get_client(); |
| 79 | |
| 80 | // �жϿͻ����Ƿ�ϣ�����ֳ����� |
| 81 | keep_alive_ = client->keep_alive(); |
| 82 | |
| 83 | // �������ݸ��ͻ��� |
| 84 | |
| 85 | res.response_header() |
| 86 | .set_status(200) |
| 87 | .set_keep_alive(keep_alive_) |
| 88 | .set_content_length(buf_size_);; |
| 89 | res.response(res_buf_, buf_size_); |
| 90 | } |
| 91 | |
| 92 | void http_rpc::rpc_onover() |
| 93 | { |
nothing calls this directly
no test coverage detected