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.
This commit is contained in:
Alex Musolino 2019-05-20 15:00:14 +09:30
parent c35f95de2a
commit d7aa56c073

View file

@ -89,14 +89,11 @@ pop3resp(Pop *pop)
char *s; char *s;
char *p; char *p;
alarm(60*1000);
if((s = Brdstr(&pop->bin, '\n', 0)) == nil){ if((s = Brdstr(&pop->bin, '\n', 0)) == nil){
close(pop->fd); close(pop->fd);
pop->fd = -1; pop->fd = -1;
alarm(0);
return "unexpected eof"; return "unexpected eof";
} }
alarm(0);
p = s + strlen(s) - 1; p = s + strlen(s) - 1;
while(p >= s && (*p == '\r' || *p == '\n')) while(p >= s && (*p == '\r' || *p == '\n'))