comparison src/protocol.h @ 144:8b9366fc1361 noffle

[svn] Added timeout to Prt_getLn to avoid Noffle hanging if the connection breaks down during a fetch.
author enz
date Sat, 23 Sep 2000 11:40:35 +0100
parents 6f681d41734c
children 1c7303c71f66
comparison
equal deleted inserted replaced
143:7400a8e9d5ba 144:8b9366fc1361
2 protocol.h 2 protocol.h
3 3
4 Functions related with the NNTP protocol which are useful for both 4 Functions related with the NNTP protocol which are useful for both
5 the server and the client. 5 the server and the client.
6 6
7 $Id: protocol.h 155 2000-06-24 20:28:01Z bears $ 7 $Id: protocol.h 217 2000-09-23 10:40:35Z enz $
8 */ 8 */
9 9
10 #ifndef PRT_H 10 #ifndef PRT_H
11 #define PRT_H 11 #define PRT_H
12 12
56 #define STAT_PROGRAM_FAULT 503 56 #define STAT_PROGRAM_FAULT 503
57 57
58 /* 58 /*
59 Read next line from f into Str, up to "\n" or "\r\n". Don't save "\n" 59 Read next line from f into Str, up to "\n" or "\r\n". Don't save "\n"
60 or "\r\n" in line. Terminate with '\0'. 60 or "\r\n" in line. Terminate with '\0'.
61 If timeoutSeconds < 0, no timeout alarm is used.
61 */ 62 */
62 Bool 63 Bool
63 Prt_getLn( Str line, FILE *f ); 64 Prt_getLn( Str line, FILE *f, int timeoutSeconds );
64 65
65 /* 66 /*
66 Read a text line from server. Returns TRUE if line != ".", removes 67 Read a text line from server. Returns TRUE if line != ".", removes
67 leading '.' otherwise. 68 leading '.' otherwise.
69 If timeoutSeconds < 0, no timeout alarm is used.
68 */ 70 */
69 Bool 71 Bool
70 Prt_getTxtLn( Str line, Bool *err, FILE *f ); 72 Prt_getTxtLn( Str line, Bool *err, FILE *f, int timeoutSeconds );
71 73
72 /* 74 /*
73 Write text line to f. Escape "." at the beginning with another ".". 75 Write text line to f. Escape "." at the beginning with another ".".
74 Terminate with "\r\n". 76 Terminate with "\r\n".
75 */ 77 */