29 #ifndef SESSIONHANDLER_H |
29 #ifndef SESSIONHANDLER_H |
30 #define SESSIONHANDLER_H |
30 #define SESSIONHANDLER_H |
31 |
31 |
32 #include "../util/thrpool.h" |
32 #include "../util/thrpool.h" |
33 #include "../public/nsapi.h" |
33 #include "../public/nsapi.h" |
|
34 #include "../util/io.h" |
34 #include "event.h" |
35 #include "event.h" |
35 |
36 |
36 #include <openssl/bio.h> |
37 #include <openssl/bio.h> |
37 #include <openssl/ssl.h> |
38 #include <openssl/ssl.h> |
38 #include <openssl/err.h> |
39 #include <openssl/err.h> |
70 * Adds a connection to the keep-alive handler. The session handler |
71 * Adds a connection to the keep-alive handler. The session handler |
71 * waits for new data and re-enqueues the connection, if new data is |
72 * waits for new data and re-enqueues the connection, if new data is |
72 * available |
73 * available |
73 */ |
74 */ |
74 void(*keep_alive)(SessionHandler*, Connection *conn); |
75 void(*keep_alive)(SessionHandler*, Connection *conn); |
|
76 |
|
77 /* |
|
78 * Creates an IOStream object for the connection |
|
79 */ |
|
80 IOStream*(*create_iostream)(SessionHandler *sh, Connection *conn, pool_handle_t *pool, WSBool *ssl); |
75 }; |
81 }; |
76 |
82 |
77 /* |
83 /* |
78 * BasicSessionHandler |
84 * BasicSessionHandler |
79 * |
85 * |
109 int connection_ssl_write(Connection *conn, const void *buf, int len); |
115 int connection_ssl_write(Connection *conn, const void *buf, int len); |
110 void connection_ssl_close(Connection *conn); |
116 void connection_ssl_close(Connection *conn); |
111 |
117 |
112 void connection_destroy(Connection *conn); |
118 void connection_destroy(Connection *conn); |
113 |
119 |
|
120 /* |
|
121 * generic create_iostream function for BasicSessionHandler |
|
122 * and EventSessionHandler |
|
123 */ |
|
124 IOStream* create_connection_iostream(SessionHandler *sh, Connection *conn, pool_handle_t *pool, WSBool *ssl); |
|
125 |
114 |
126 |
115 SessionHandler* create_basic_session_handler(); |
127 SessionHandler* create_basic_session_handler(); |
116 |
128 |
117 void basic_enq_conn(SessionHandler *handler, Connection *conn); |
129 void basic_enq_conn(SessionHandler *handler, Connection *conn); |
118 |
130 |