Remove dead code in do_dtls1_write and document another bug.
Change-Id: I250d3cf5b8124f205d67268958a01cb02a6d05ac
Reviewed-on: https://boringssl-review.googlesource.com/4240
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/ssl/d1_pkt.c b/ssl/d1_pkt.c
index 7b2cab1..0885b8c 100644
--- a/ssl/d1_pkt.c
+++ b/ssl/d1_pkt.c
@@ -724,12 +724,9 @@
SSL3_RECORD *wr;
SSL3_BUFFER *wb;
- /* first check if there is a SSL3_BUFFER still being written
- * out. This will happen with non blocking IO */
- if (s->s3->wbuf.left != 0) {
- assert(0); /* XDTLS: want to see if we ever get here */
- return ssl3_write_pending(s, type, buf, len);
- }
+ /* ssl3_write_pending drops the write if |BIO_write| fails in DTLS, so there
+ * is never pending data. */
+ assert(s->s3->wbuf.left == 0);
/* If we have an alert to send, lets send it */
if (s->s3->alert_dispatch) {
diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c
index dcd26c2..436e830 100644
--- a/ssl/s3_pkt.c
+++ b/ssl/s3_pkt.c
@@ -686,6 +686,8 @@
}
return i;
}
+ /* TODO(davidben): This codepath is used in DTLS, but the write
+ * payload may not split across packets. */
wb->offset += i;
wb->left -= i;
}