changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: upas/fs: remove read timeout via alarm(2) in pop3resp

changeset 7251: c67d805b0614
parent 7250: 5ddd42593f0b
child 7252: 523d2d3e473f
author: Alex Musolino <alex@musolino.id.au>
date: Mon, 20 May 2019 15:00:14 +0930
files: sys/src/cmd/upas/fs/pop3.c
description: upas/fs: remove read timeout via alarm(2) in pop3resp

The alarm note is not handled by upas/fs, so if and when it did fire,
the pop3 client process would terminate rendering the entire fs
unresponsive.
     1.1--- a/sys/src/cmd/upas/fs/pop3.c
     1.2+++ b/sys/src/cmd/upas/fs/pop3.c
     1.3@@ -89,14 +89,11 @@ pop3resp(Pop *pop)
     1.4 	char *s;
     1.5 	char *p;
     1.6 
     1.7-	alarm(60*1000);
     1.8 	if((s = Brdstr(&pop->bin, '\n', 0)) == nil){
     1.9 		close(pop->fd);
    1.10 		pop->fd = -1;
    1.11-		alarm(0);
    1.12 		return "unexpected eof";
    1.13 	}
    1.14-	alarm(0);
    1.15 
    1.16 	p = s + strlen(s) - 1;
    1.17 	while(p >= s && (*p == '\r' || *p == '\n'))