43 struct _connection { |
47 struct _connection { |
44 int fd; |
48 int fd; |
45 struct sockaddr_in address; |
49 struct sockaddr_in address; |
46 HttpListener *listener; |
50 HttpListener *listener; |
47 SessionHandler *session_handler; |
51 SessionHandler *session_handler; |
|
52 SSL *ssl; |
|
53 int (*read)(Connection *conn, void *buf, int len); |
|
54 int (*write)(Connection *conn, const void *buf, int len); |
|
55 void (*close)(Connection *conn); |
48 }; |
56 }; |
49 |
57 |
50 typedef void(*enqueue_connection_f)(SessionHandler*, Connection*); |
58 typedef void(*enqueue_connection_f)(SessionHandler*, Connection*); |
51 typedef void(*keep_alive_f)(SessionHandler*, Connection*); |
59 typedef void(*keep_alive_f)(SessionHandler*, Connection*); |
52 struct _session_handler { |
60 struct _session_handler { |
91 * EventHttpIO |
99 * EventHttpIO |
92 * |
100 * |
93 * defined in sesionhandler.c |
101 * defined in sesionhandler.c |
94 */ |
102 */ |
95 |
103 |
|
104 int connection_read(Connection *conn, void *buf, int len); |
|
105 int connection_write(Connection *conn, const void *buf, int len); |
|
106 void connection_close(Connection *conn); |
|
107 int connection_ssl_read(Connection *conn, void *buf, int len); |
|
108 int connection_ssl_write(Connection *conn, const void *buf, int len); |
|
109 void connection_ssl_close(Connection *conn); |
|
110 |
96 |
111 |
97 SessionHandler* create_basic_session_handler(); |
112 SessionHandler* create_basic_session_handler(); |
98 |
113 |
99 void basic_enq_conn(SessionHandler *handler, Connection *conn); |
114 void basic_enq_conn(SessionHandler *handler, Connection *conn); |
100 |
115 |