Changes from 1.0.0-stable.

This commit is contained in:
Dr. Stephen Henson
2009-04-07 16:33:26 +00:00
parent 14b3f1007e
commit cc7399e79c
10 changed files with 88 additions and 15 deletions

View File

@@ -3138,6 +3138,7 @@ int ssl3_get_req_cert_type(SSL *s, unsigned char *p)
int ssl3_shutdown(SSL *s)
{
int ret;
/* Don't do anything much if we have not done the handshake or
* we don't want to send messages :-) */
@@ -3155,18 +3156,32 @@ int ssl3_shutdown(SSL *s)
#endif
/* our shutdown alert has been sent now, and if it still needs
* to be written, s->s3->alert_dispatch will be true */
if (s->s3->alert_dispatch)
return(-1); /* return WANT_WRITE */
}
else if (s->s3->alert_dispatch)
{
/* resend it if not sent */
#if 1
s->method->ssl_dispatch_alert(s);
ret=s->method->ssl_dispatch_alert(s);
if(ret == -1)
{
/* we only get to return -1 here the 2nd/Nth
* invocation, we must have already signalled
* return 0 upon a previous invoation,
* return WANT_WRITE */
return(ret);
}
#endif
}
else if (!(s->shutdown & SSL_RECEIVED_SHUTDOWN))
{
/* If we are waiting for a close from our peer, we are closed */
s->method->ssl_read_bytes(s,0,NULL,0,0);
if(!(s->shutdown & SSL_RECEIVED_SHUTDOWN))
{
return(-1); /* return WANT_READ */
}
}
if ((s->shutdown == (SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN)) &&