History

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.

cinap_lenrek committed 10 years ago

Commit b5e697f1 parent 082f1a31 file · +3 −3Browse files

Unified · Split

kern/devtls.c+3−3
@@ -496,7 +496,7 @@ tlsopen(Chan *c, int omode) · 495 unmodified lines
496 c->mode = openmode(omode);496 c->mode = openmode(omode);
497 c->flag |= COPEN;497 c->flag |= COPEN;
498 c->offset = 0;498 c->offset = 0;
499 c->iounit = qiomaxatomic;499 c->iounit = MaxRecLen;
500 return c;500 return c;
501}501}
502 502
@@ -1581,8 +1581,8 @@ tlswrite(Chan *c, void *a, long n, vlong off) · 1078 unmodified lines
1581 e = p + n;1581 e = p + n;
1582 do{1582 do{
1583 m = e - p;1583 m = e - p;
1584 if(m > MaxRecLen)1584 if(m > c->iounit)
1585 m = MaxRecLen;1585 m = c->iounit;
1586 1586
1587 b = allocb(m);1587 b = allocb(m);
1588 if(waserror()){1588 if(waserror()){

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t