nginx 0.1.11
[nginx-catap.git] / src / event / ngx_event_openssl.h
blob6e7b705b14e0127e0242e39c6be8c27e1939ff01
2 /*
3 * Copyright (C) Igor Sysoev
4 */
7 #ifndef _NGX_EVENT_OPENSSL_H_INCLUDED_
8 #define _NGX_EVENT_OPENSSL_H_INCLUDED_
11 #include <ngx_config.h>
12 #include <ngx_core.h>
14 #include <openssl/ssl.h>
15 #include <openssl/err.h>
18 typedef struct {
19 SSL *ssl;
20 ngx_buf_t *buf;
21 ngx_event_handler_pt saved_read_handler;
22 ngx_event_handler_pt saved_write_handler;
24 unsigned buffer:1;
25 unsigned no_rcv_shut:1;
26 unsigned no_send_shut:1;
27 unsigned shutdown_set:1;
28 } ngx_ssl_t;
31 typedef SSL_CTX ngx_ssl_ctx_t;
34 #define NGX_SSL_BUFFER 1
37 #define NGX_SSL_BUFSIZE 16384
40 ngx_int_t ngx_ssl_init(ngx_log_t *log);
41 ngx_int_t ngx_ssl_create_session(ngx_ssl_ctx_t *ctx, ngx_connection_t *c,
42 ngx_uint_t flags);
44 #define ngx_ssl_handshake(c) NGX_OK
46 ssize_t ngx_ssl_recv(ngx_connection_t *c, u_char *buf, size_t size);
47 ngx_chain_t *ngx_ssl_send_chain(ngx_connection_t *c, ngx_chain_t *in,
48 off_t limit);
49 ngx_int_t ngx_ssl_shutdown(ngx_connection_t *c);
50 void ngx_ssl_error(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
51 char *fmt, ...);
54 #endif /* _NGX_EVENT_OPENSSL_H_INCLUDED_ */