Mercurial > hg > nginx-quic
comparison src/event/ngx_event_openssl.c @ 2536:a6d6d762c554
small optimization: " == NGX_ERROR" > " != NGX_OK"
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 24 Feb 2009 10:42:23 +0000 |
parents | 9e9a985d956a |
children | 2bce3f6416c6 |
comparison
equal
deleted
inserted
replaced
2535:ec5825afc7eb | 2536:a6d6d762c554 |
---|---|
187 | 187 |
188 ngx_int_t | 188 ngx_int_t |
189 ngx_ssl_certificate(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *cert, | 189 ngx_ssl_certificate(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *cert, |
190 ngx_str_t *key) | 190 ngx_str_t *key) |
191 { | 191 { |
192 if (ngx_conf_full_name(cf->cycle, cert, 1) == NGX_ERROR) { | 192 if (ngx_conf_full_name(cf->cycle, cert, 1) != NGX_OK) { |
193 return NGX_ERROR; | 193 return NGX_ERROR; |
194 } | 194 } |
195 | 195 |
196 if (SSL_CTX_use_certificate_chain_file(ssl->ctx, (char *) cert->data) | 196 if (SSL_CTX_use_certificate_chain_file(ssl->ctx, (char *) cert->data) |
197 == 0) | 197 == 0) |
200 "SSL_CTX_use_certificate_chain_file(\"%s\") failed", | 200 "SSL_CTX_use_certificate_chain_file(\"%s\") failed", |
201 cert->data); | 201 cert->data); |
202 return NGX_ERROR; | 202 return NGX_ERROR; |
203 } | 203 } |
204 | 204 |
205 if (ngx_conf_full_name(cf->cycle, key, 1) == NGX_ERROR) { | 205 if (ngx_conf_full_name(cf->cycle, key, 1) != NGX_OK) { |
206 return NGX_ERROR; | 206 return NGX_ERROR; |
207 } | 207 } |
208 | 208 |
209 if (SSL_CTX_use_PrivateKey_file(ssl->ctx, (char *) key->data, | 209 if (SSL_CTX_use_PrivateKey_file(ssl->ctx, (char *) key->data, |
210 SSL_FILETYPE_PEM) | 210 SSL_FILETYPE_PEM) |
231 | 231 |
232 if (cert->len == 0) { | 232 if (cert->len == 0) { |
233 return NGX_OK; | 233 return NGX_OK; |
234 } | 234 } |
235 | 235 |
236 if (ngx_conf_full_name(cf->cycle, cert, 1) == NGX_ERROR) { | 236 if (ngx_conf_full_name(cf->cycle, cert, 1) != NGX_OK) { |
237 return NGX_ERROR; | 237 return NGX_ERROR; |
238 } | 238 } |
239 | 239 |
240 if (SSL_CTX_load_verify_locations(ssl->ctx, (char *) cert->data, NULL) | 240 if (SSL_CTX_load_verify_locations(ssl->ctx, (char *) cert->data, NULL) |
241 == 0) | 241 == 0) |
389 DH_free(dh); | 389 DH_free(dh); |
390 | 390 |
391 return NGX_OK; | 391 return NGX_OK; |
392 } | 392 } |
393 | 393 |
394 if (ngx_conf_full_name(cf->cycle, file, 1) == NGX_ERROR) { | 394 if (ngx_conf_full_name(cf->cycle, file, 1) != NGX_OK) { |
395 return NGX_ERROR; | 395 return NGX_ERROR; |
396 } | 396 } |
397 | 397 |
398 bio = BIO_new_file((char *) file->data, "r"); | 398 bio = BIO_new_file((char *) file->data, "r"); |
399 if (bio == NULL) { | 399 if (bio == NULL) { |