1 |
/* GNU Mailutils -- a suite of utilities for electronic mail |
/* GNU Mailutils -- a suite of utilities for electronic mail |
2 |
Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. |
Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc. |
3 |
|
|
4 |
GNU Mailutils is free software; you can redistribute it and/or modify |
GNU Mailutils is free software; you can redistribute it and/or modify |
5 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
13 |
|
|
14 |
You should have received a copy of the GNU General Public License |
You should have received a copy of the GNU General Public License |
15 |
along with GNU Mailutils; if not, write to the Free Software |
along with GNU Mailutils; if not, write to the Free Software |
16 |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ |
17 |
|
|
18 |
#include "pop3d.h" |
#include "pop3d.h" |
19 |
|
|
151 |
|
|
152 |
/* Gets a line of input from the client, caller should free() */ |
/* Gets a line of input from the client, caller should free() */ |
153 |
char * |
char * |
154 |
pop3d_readline (FILE *fp) |
pop3d_readline (char *buffer, int size) |
155 |
{ |
{ |
|
static char buffer[512]; |
|
156 |
char *ptr; |
char *ptr; |
157 |
|
|
158 |
alarm (daemon_param.timeout); |
alarm (daemon_param.timeout); |
159 |
ptr = fgets (buffer, sizeof (buffer), fp); |
ptr = fgets (buffer, size, ifile); |
160 |
alarm (0); |
alarm (0); |
161 |
|
|
162 |
/* We should probably check ferror() too, but if ptr is null we |
/* We should probably check ferror() too, but if ptr is null we |
163 |
are done anyway; if (!ptr && ferror(fp)) */ |
are done anyway; if (!ptr && ferror(ifile)) */ |
164 |
if (!ptr) |
if (!ptr) |
165 |
pop3d_abquit (ERR_NO_OFILE); |
pop3d_abquit (ERR_NO_OFILE); |
166 |
|
|