Mercurial > noffle
comparison src/protocol.c @ 185:fed1334d766b noffle
[svn] * src/client.c: Change variable only used on constant to 'const'.
* src/filter.c: Add a couple of 'return's after ASSERT() to remove
compiler warnings about functions needing returns.
* NEWS,TODO,configure,configure.in,noffle.conf.example,docs/NOTES,
docs/noffle.conf.5,src/client.c,src/configfile.c,src/content.c,
src/control.c,src/database.c,src/fetch.c,src/fetchlist.c,src/filter.c,
src/group.c,src/lock.c,src/log.c,src/log.h,src/noffle.c,src/outgoing.c,
src/post.c,src/protocol.c,src/request.c,src/server.c,src/util.c:
Debug logging is always compiled and selected via noffle.conf. All debug
logs are classified as all, none, config, control, expire, fetch,
filter, newsbase, noffle, post, protocol, requests and server.
author | bears |
---|---|
date | Sun, 05 Aug 2001 09:24:22 +0100 |
parents | 94f2e5607772 |
children | 76460d98b2fb |
comparison
equal
deleted
inserted
replaced
184:9854ea5f295f | 185:fed1334d766b |
---|---|
1 /* | 1 /* |
2 protocol.c | 2 protocol.c |
3 | 3 |
4 $Id: protocol.c 248 2001-01-25 11:00:03Z bears $ | 4 $Id: protocol.c 300 2001-08-05 08:24:22Z bears $ |
5 */ | 5 */ |
6 | 6 |
7 #if HAVE_CONFIG_H | 7 #if HAVE_CONFIG_H |
8 #include <config.h> | 8 #include <config.h> |
9 #endif | 9 #endif |
68 { | 68 { |
69 line[ len - 1 ] = '\0'; | 69 line[ len - 1 ] = '\0'; |
70 if ( len > 1 && line[ len - 2 ] == '\r' ) | 70 if ( len > 1 && line[ len - 2 ] == '\r' ) |
71 line[ len - 2 ] = '\0'; | 71 line[ len - 2 ] = '\0'; |
72 } | 72 } |
73 Log_dbg( "[R] %s", line ); | 73 Log_dbg( LOG_DBG_PROTOCOL, "[R] %s", line ); |
74 return TRUE; | 74 return TRUE; |
75 } | 75 } |
76 | 76 |
77 Bool | 77 Bool |
78 Prt_getTxtLn( Str line, Bool *err, FILE *f, int timeoutSeconds ) | 78 Prt_getTxtLn( Str line, Bool *err, FILE *f, int timeoutSeconds ) |
101 Bool | 101 Bool |
102 Prt_putTxtLn( const char* line, FILE *f ) | 102 Prt_putTxtLn( const char* line, FILE *f ) |
103 { | 103 { |
104 if ( line[ 0 ] == '.' ) | 104 if ( line[ 0 ] == '.' ) |
105 { | 105 { |
106 Log_dbg( "[S] .%s", line ); | 106 Log_dbg( LOG_DBG_PROTOCOL, "[S] .%s", line ); |
107 return ( fprintf( f, ".%s\r\n", line ) == (int)strlen( line ) + 3 ); | 107 return ( fprintf( f, ".%s\r\n", line ) == (int)strlen( line ) + 3 ); |
108 } | 108 } |
109 else | 109 else |
110 { | 110 { |
111 Log_dbg( "[S] %s", line ); | 111 Log_dbg( LOG_DBG_PROTOCOL, "[S] %s", line ); |
112 return ( fprintf( f, "%s\r\n", line ) == (int)strlen( line ) + 2 ); | 112 return ( fprintf( f, "%s\r\n", line ) == (int)strlen( line ) + 2 ); |
113 } | 113 } |
114 } | 114 } |
115 | 115 |
116 Bool | 116 Bool |
117 Prt_putEndOfTxt( FILE *f ) | 117 Prt_putEndOfTxt( FILE *f ) |
118 { | 118 { |
119 Log_dbg( "[S] ." ); | 119 Log_dbg( LOG_DBG_PROTOCOL, "[S] ." ); |
120 return ( fprintf( f, ".\r\n" ) == 3 ); | 120 return ( fprintf( f, ".\r\n" ) == 3 ); |
121 } | 121 } |
122 | 122 |
123 /* | 123 /* |
124 Write text buffer of lines each ending with '\n'. | 124 Write text buffer of lines each ending with '\n'. |