Mercurial > hg > nginx-quic
comparison src/event/ngx_event_openssl.c @ 6842:25d0d6dabe00
SSL: backed out changeset e7cb5deb951d, reimplemented properly.
Changeset e7cb5deb951d breaks build on CentOS 5 with "dereferencing
type-punned pointer will break strict-aliasing rules" warning. It is
backed out.
Instead, to keep builds with BoringSSL happy, type of the "value"
variable changed to "char *", and an explicit cast added before calling
ngx_parse_http_time().
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 15 Dec 2016 19:00:23 +0300 |
parents | e7cb5deb951d |
children | 75e7d55214bd |
comparison
equal
deleted
inserted
replaced
6841:e7cb5deb951d | 6842:25d0d6dabe00 |
---|---|
4047 const | 4047 const |
4048 #endif | 4048 #endif |
4049 ASN1_TIME *asn1time) | 4049 ASN1_TIME *asn1time) |
4050 { | 4050 { |
4051 BIO *bio; | 4051 BIO *bio; |
4052 u_char *value; | 4052 char *value; |
4053 size_t len; | 4053 size_t len; |
4054 time_t time; | 4054 time_t time; |
4055 | 4055 |
4056 /* | 4056 /* |
4057 * OpenSSL doesn't provide a way to convert ASN1_TIME | 4057 * OpenSSL doesn't provide a way to convert ASN1_TIME |
4067 | 4067 |
4068 /* fake weekday prepended to match C asctime() format */ | 4068 /* fake weekday prepended to match C asctime() format */ |
4069 | 4069 |
4070 BIO_write(bio, "Tue ", sizeof("Tue ") - 1); | 4070 BIO_write(bio, "Tue ", sizeof("Tue ") - 1); |
4071 ASN1_TIME_print(bio, asn1time); | 4071 ASN1_TIME_print(bio, asn1time); |
4072 len = BIO_get_mem_data(bio, (char **) &value); | 4072 len = BIO_get_mem_data(bio, &value); |
4073 | 4073 |
4074 time = ngx_parse_http_time(value, len); | 4074 time = ngx_parse_http_time((u_char *) value, len); |
4075 | 4075 |
4076 BIO_free(bio); | 4076 BIO_free(bio); |
4077 | 4077 |
4078 return time; | 4078 return time; |
4079 } | 4079 } |