aboutsummaryrefslogtreecommitdiffstats
path: root/ssl/d1_msg.c
diff options
context:
space:
mode:
authorTodd Short <tshort@akamai.com>2018-12-12 13:09:50 -0500
committerMatt Caswell <matt@openssl.org>2019-04-29 17:26:09 +0100
commit555cbb328ee2eaa9356cd23e2194c1600653c500 (patch)
tree347c1fcdde0e9a736eb6c8590d95318b4c1940f6 /ssl/d1_msg.c
parentd7fcf1feac3b3b1bf1a162f632b1e7db4f075aed (diff)
downloadopenssl-555cbb328ee2eaa9356cd23e2194c1600653c500.tar.gz
Collapse ssl3_state_st (s3) into ssl_st
With the removal of SSLv2, the s3 structure is always allocated, so there is little point in having it be an allocated pointer. Collapse the ssl3_state_st structure into ssl_st and fixup any references. This should be faster than going through an indirection and due to fewer allocations, but I'm not seeing any significant performance improvement; it seems to be within the margin of error in timing. Reviewed-by: Paul Yang <yang.yang@baishancloud.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7888)
Diffstat (limited to 'ssl/d1_msg.c')
-rw-r--r--ssl/d1_msg.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ssl/d1_msg.c b/ssl/d1_msg.c
index 257ee7e097..0891d948f5 100644
--- a/ssl/d1_msg.c
+++ b/ssl/d1_msg.c
@@ -41,22 +41,22 @@ int dtls1_dispatch_alert(SSL *s)
unsigned char *ptr = &buf[0];
size_t written;
- s->s3->alert_dispatch = 0;
+ s->s3.alert_dispatch = 0;
memset(buf, 0, sizeof(buf));
- *ptr++ = s->s3->send_alert[0];
- *ptr++ = s->s3->send_alert[1];
+ *ptr++ = s->s3.send_alert[0];
+ *ptr++ = s->s3.send_alert[1];
i = do_dtls1_write(s, SSL3_RT_ALERT, &buf[0], sizeof(buf), 0, &written);
if (i <= 0) {
- s->s3->alert_dispatch = 1;
+ s->s3.alert_dispatch = 1;
/* fprintf( stderr, "not done with alert\n" ); */
} else {
- if (s->s3->send_alert[0] == SSL3_AL_FATAL)
+ if (s->s3.send_alert[0] == SSL3_AL_FATAL)
(void)BIO_flush(s->wbio);
if (s->msg_callback)
- s->msg_callback(1, s->version, SSL3_RT_ALERT, s->s3->send_alert,
+ s->msg_callback(1, s->version, SSL3_RT_ALERT, s->s3.send_alert,
2, s, s->msg_callback_arg);
if (s->info_callback != NULL)
@@ -65,7 +65,7 @@ int dtls1_dispatch_alert(SSL *s)
cb = s->ctx->info_callback;
if (cb != NULL) {
- j = (s->s3->send_alert[0] << 8) | s->s3->send_alert[1];
+ j = (s->s3.send_alert[0] << 8) | s->s3.send_alert[1];
cb(s, SSL_CB_WRITE_ALERT, j);
}
}