libiqxmlrpc  0.12.4
 All Classes Namespaces Files Functions Typedefs Enumerations
https_client.h
1 // Libiqxmlrpc - an object-oriented XML-RPC solution.
2 // Copyright (C) 2011 Anton Dedov
3 
4 #ifndef _libiqxmlrpc_https_client_h_
5 #define _libiqxmlrpc_https_client_h_
6 
7 #include "client.h"
8 #include "client_conn.h"
9 #include "connection.h"
10 #include "reactor.h"
11 #include "ssl_connection.h"
12 
13 #include <boost/scoped_ptr.hpp>
14 
15 namespace iqxmlrpc
16 {
17 
20 class LIBIQXMLRPC_API Https_proxy_client_connection:
22  public iqnet::Connection
23 {
24 public:
25  Https_proxy_client_connection( const iqnet::Socket&, bool non_block_flag );
26 
27  void handle_input( bool& );
28  void handle_output( bool& );
29 
30 protected:
31  http::Packet* do_process_session( const std::string& );
32 
33  void setup_tunnel();
34 
35  boost::scoped_ptr<iqnet::Reactor_base> reactor;
36  boost::scoped_ptr<http::Packet> resp_packet;
37  bool non_blocking;
38  std::string out_str;
39 };
40 
42 class LIBIQXMLRPC_API Https_client_connection:
45 {
46  std::auto_ptr<iqnet::Reactor_base> reactor;
47  http::Packet* resp_packet;
48  std::string out_str;
49  bool established;
50 
51 public:
53 
54  Https_client_connection( const iqnet::Socket&, bool non_block_flag );
55 
56  void post_connect()
57  {
58  set_reactor( reactor.get() );
60  }
61 
62  void connect_succeed();
63  void send_succeed( bool& );
64  void recv_succeed( bool&, size_t req_len, size_t real_len );
65 
66 protected:
67  friend class Https_proxy_client_connection;
68  http::Packet* do_process_session( const std::string& );
69 
70 private:
71  void reg_send_request();
72 };
73 
74 } // namespace iqxmlrpc
75 
76 #endif
77 // vim:ts=2:sw=2:et