git: 9front

Download patch

ref: cfee802f7896a0aec1921eeae24cc1f1add30131
parent: 4a6cba9ce95744b18c9371fb6495d60738cf0307
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Mar 9 14:54:33 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/sys/src/9/port/devtls.c
+++ b/sys/src/9/port/devtls.c
@@ -499,7 +499,7 @@
 	c->mode = openmode(omode);
 	c->flag |= COPEN;
 	c->offset = 0;
-	c->iounit = qiomaxatomic;
+	c->iounit = MaxRecLen;
 	return c;
 }
 
@@ -1584,8 +1584,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()){
--