Fix write failure handling in DTLS1.2
[openssl.git] / ssl / record / rec_layer_s3.c
index 79d3c21fbe8a88f4d41512876b4260251e6bcd9a..d6e922c652ac6a2da7e250e17265f7f2b68a9e34 100644 (file)
@@ -929,7 +929,7 @@ int ssl3_write_pending(SSL *s, int type, const unsigned char *buf,
             s->rwstate = SSL_NOTHING;
             return (s->rlayer.wpend_ret);
         } else if (i <= 0) {
-            if (s->version == DTLS1_VERSION || s->version == DTLS1_BAD_VER) {
+            if (SSL_IS_DTLS(s)) {
                 /*
                  * For DTLS, just drop it. That's kind of the whole point in
                  * using a datagram service