shithub: drawterm

Download patch

ref: b5e697fda5842e1bf9016b983dfbff17f53683f6
parent: 082f1a3a980c79b96009f413b72f65b791cc2352
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Mar 9 13:54:50 EST 2016

devtls: fix wrong iounit

devtls writes are only atomic up to MaxRecLen as this is the
maximum payload size we put in a record application message.

--- a/kern/devtls.c	Tue Mar  8 10:21:13 2016
+++ b/kern/devtls.c	Wed Mar  9 13:54:50 2016
@@ -496,7 +496,7 @@
 	c->mode = openmode(omode);
 	c->flag |= COPEN;
 	c->offset = 0;
-	c->iounit = qiomaxatomic;
+	c->iounit = MaxRecLen;
 	return c;
 }
 
@@ -1581,8 +1581,8 @@
 		e = p + n;
 		do{
 			m = e - p;
-			if(m > MaxRecLen)
-				m = MaxRecLen;
+			if(m > c->iounit)
+				m = c->iounit;
 
 			b = allocb(m);
 			if(waserror()){