Mercurial > hg > nginx-vendor-1-0
comparison src/event/ngx_event_openssl.c @ 2:cc9f381affaa NGINX_0_1_1
nginx 0.1.1
*) Feature: the gzip_types directive.
*) Feature: the tcp_nodelay directive.
*) Feature: the send_lowat directive is working not only on OSes that
support kqueue NOTE_LOWAT, but also on OSes that support SO_SNDLOWAT.
*) Feature: the setproctitle() emulation for Linux and Solaris.
*) Bugfix: the "Location" header rewrite bug fixed while the proxying.
*) Bugfix: the ngx_http_chunked_module module may get caught in an
endless loop.
*) Bugfix: the /dev/poll module bugs fixed.
*) Bugfix: the responses were corrupted when the temporary files were
used while the proxying.
*) Bugfix: the unescaped requests were passed to the backend.
*) Bugfix: while the build configuration on Linux 2.4 the
--with-poll_module parameter was required.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 11 Oct 2004 00:00:00 +0400 |
parents | f0b350454894 |
children | 4b2dafa26fe2 |
comparison
equal
deleted
inserted
replaced
1:80bdda0151b0 | 2:cc9f381affaa |
---|---|
70 | 70 |
71 if (n > 0) { | 71 if (n > 0) { |
72 return n; | 72 return n; |
73 } | 73 } |
74 | 74 |
75 if (!SSL_is_init_finished(c->ssl->ssl)) { | |
76 handshake = "in SSL handshake"; | |
77 | |
78 } else { | |
79 handshake = ""; | |
80 } | |
81 | |
75 sslerr = SSL_get_error(c->ssl->ssl, n); | 82 sslerr = SSL_get_error(c->ssl->ssl, n); |
76 | 83 |
77 err = (sslerr == SSL_ERROR_SYSCALL) ? ngx_errno : 0; | 84 err = (sslerr == SSL_ERROR_SYSCALL) ? ngx_errno : 0; |
78 | 85 |
79 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL_get_error: %d", sslerr); | 86 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL_get_error: %d", sslerr); |
87 "SSL wants to write%s", handshake); | 94 "SSL wants to write%s", handshake); |
88 return NGX_ERROR; | 95 return NGX_ERROR; |
89 #if 0 | 96 #if 0 |
90 return NGX_AGAIN; | 97 return NGX_AGAIN; |
91 #endif | 98 #endif |
92 } | |
93 | |
94 if (!SSL_is_init_finished(c->ssl->ssl)) { | |
95 handshake = "in SSL handshake"; | |
96 | |
97 } else { | |
98 handshake = ""; | |
99 } | 99 } |
100 | 100 |
101 c->ssl->no_rcv_shut = 1; | 101 c->ssl->no_rcv_shut = 1; |
102 | 102 |
103 if (sslerr == SSL_ERROR_ZERO_RETURN || ERR_peek_error() == 0) { | 103 if (sslerr == SSL_ERROR_ZERO_RETURN || ERR_peek_error() == 0) { |
238 } | 238 } |
239 | 239 |
240 | 240 |
241 static ngx_int_t ngx_ssl_write(ngx_connection_t *c, u_char *data, size_t size) | 241 static ngx_int_t ngx_ssl_write(ngx_connection_t *c, u_char *data, size_t size) |
242 { | 242 { |
243 int n, sslerr; | 243 int n, sslerr; |
244 ngx_err_t err; | 244 ngx_err_t err; |
245 char *handshake; | |
245 | 246 |
246 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL to write: %d", size); | 247 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL to write: %d", size); |
247 | 248 |
248 n = SSL_write(c->ssl->ssl, data, size); | 249 n = SSL_write(c->ssl->ssl, data, size); |
249 | 250 |
263 c->write->ready = 0; | 264 c->write->ready = 0; |
264 return NGX_AGAIN; | 265 return NGX_AGAIN; |
265 } | 266 } |
266 | 267 |
267 if (sslerr == SSL_ERROR_WANT_READ) { | 268 if (sslerr == SSL_ERROR_WANT_READ) { |
269 | |
270 if (!SSL_is_init_finished(c->ssl->ssl)) { | |
271 handshake = "in SSL handshake"; | |
272 | |
273 } else { | |
274 handshake = ""; | |
275 } | |
276 | |
268 ngx_log_error(NGX_LOG_ALERT, c->log, err, | 277 ngx_log_error(NGX_LOG_ALERT, c->log, err, |
269 "SSL wants to read%s", handshake); | 278 "SSL wants to read%s", handshake); |
270 return NGX_ERROR; | 279 return NGX_ERROR; |
271 #if 0 | 280 #if 0 |
272 return NGX_AGAIN; | 281 return NGX_AGAIN; |
273 } | |
274 #endif | 282 #endif |
283 } | |
275 | 284 |
276 c->ssl->no_rcv_shut = 1; | 285 c->ssl->no_rcv_shut = 1; |
277 | 286 |
278 ngx_ssl_error(NGX_LOG_ALERT, c->log, err, "SSL_write() failed"); | 287 ngx_ssl_error(NGX_LOG_ALERT, c->log, err, "SSL_write() failed"); |
279 | 288 |