annotate fetch.c @ 0:04124a4423d4 noffle

[svn] Initial revision
author enz
date Tue, 04 Jan 2000 11:35:42 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
1 /*
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
2 fetch.c
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
3
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
4 $Id: fetch.c 3 2000-01-04 11:35:42Z enz $
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
5 */
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
6
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
7 #include "fetch.h"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
8 #include <errno.h>
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
9 #include <time.h>
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
10 #include <signal.h>
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
11 #include "client.h"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
12 #include "config.h"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
13 #include "content.h"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
14 #include "dynamicstring.h"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
15 #include "fetchlist.h"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
16 #include "request.h"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
17 #include "group.h"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
18 #include "log.h"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
19 #include "outgoing.h"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
20 #include "protocol.h"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
21 #include "pseudo.h"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
22 #include "util.h"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
23
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
24 struct Fetch
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
25 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
26 Bool ready;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
27 Str serv;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
28 } fetch = { FALSE, "" };
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
29
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
30 static Bool
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
31 connectToServ( const char *name )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
32 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
33 Log_inf( "Fetch from '%s'", name );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
34 if ( ! Client_connect( name ) )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
35 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
36 Log_err( "Could not connect to %s", name );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
37 return FALSE;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
38 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
39 return TRUE;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
40 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
41
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
42 void
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
43 Fetch_getNewGrps( void )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
44 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
45 time_t t;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
46 Str file;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
47
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
48 ASSERT( fetch.ready );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
49 snprintf( file, MAXCHAR, "%s/groupinfo.lastupdate", Cfg_spoolDir() );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
50 if ( ! Utl_getStamp( &t, file ) )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
51 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
52 Log_err( "Cannot read %s. Please run noffle --query groups", file );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
53 return;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
54 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
55 Log_inf( "Updating groupinfo" );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
56 Client_getNewgrps( &t );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
57 Utl_stamp( file );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
58 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
59
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
60 void
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
61 Fetch_getNewArts( const char *name, FetchMode mode )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
62 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
63 int next, first, last, oldLast;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
64
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
65 if ( ! Client_changeToGrp( name ) )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
66 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
67 Log_err( "Could not change to group %s", name );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
68 return;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
69 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
70 Cont_read( name );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
71 Client_rmtFirstLast( &first, &last );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
72 next = Grp_rmtNext( name );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
73 oldLast = Cont_last();
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
74 if ( next == last + 1 )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
75 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
76 Log_inf( "No new articles in %s", name );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
77 Cont_write();
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
78 Grp_setFirstLast( name, Cont_first(), Cont_last() );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
79 return;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
80 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
81 if ( first == 0 && last == 0 )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
82 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
83 Log_inf( "No articles in %s", name );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
84 Cont_write();
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
85 Grp_setFirstLast( name, Cont_first(), Cont_last() );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
86 return;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
87 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
88 if ( next > last + 1 )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
89 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
90 Log_err( "Article number inconsistent (%s rmt=%lu-%lu, next=%lu)",
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
91 name, first, last, next );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
92 Pseudo_cntInconsistent( name, first, last, next );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
93 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
94 else if ( next < first )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
95 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
96 Log_inf( "Missing articles (%s first=%lu next=%lu)",
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
97 name, first, next );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
98 Pseudo_missArts( name, first, next );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
99 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
100 else
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
101 first = next;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
102 if ( last - first > Cfg_maxFetch() )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
103 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
104 Log_ntc( "Cutting number of overviews to %lu", Cfg_maxFetch() );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
105 first = last - Cfg_maxFetch() + 1;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
106 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
107 Log_inf( "Getting remote overviews %lu-%lu for group %s",
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
108 first, last, name );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
109 Client_getOver( first, last, mode );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
110 Cont_write();
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
111 Grp_setFirstLast( name, Cont_first(), Cont_last() );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
112 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
113
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
114 void
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
115 Fetch_updateGrps( void )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
116 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
117 FetchMode mode;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
118 int i, size;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
119 const char* name;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
120
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
121 ASSERT( fetch.ready );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
122 Fetchlist_read();
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
123 size = Fetchlist_size();
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
124 for ( i = 0; i < size; ++i )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
125 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
126 Fetchlist_element( &name, &mode, i );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
127 if ( strcmp( Grp_serv( name ), fetch.serv ) == 0 )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
128 Fetch_getNewArts( name, mode );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
129 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
130 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
131
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
132 void
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
133 Fetch_getReq_( void )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
134 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
135 Str msgId;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
136 DynStr *list;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
137 const char *p;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
138 int count = 0;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
139
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
140 ASSERT( fetch.ready );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
141 Log_dbg( "Retrieving articles marked for download" );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
142 list = new_DynStr( 10000 );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
143 if ( Req_first( fetch.serv, msgId ) )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
144 do
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
145 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
146 DynStr_appLn( list, msgId );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
147 if ( ++count % 20 == 0 ) /* Send max. 20 ARTICLE cmds at once */
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
148 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
149 p = DynStr_str( list );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
150 Client_retrieveArtList( p );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
151 while ( ( p = Utl_getLn( msgId, p ) ) )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
152 Req_remove( fetch.serv, msgId );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
153 DynStr_clear( list );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
154 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
155 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
156 while ( Req_next( msgId ) );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
157 p = DynStr_str( list );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
158 Client_retrieveArtList( p );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
159 while ( ( p = Utl_getLn( msgId, p ) ) )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
160 Req_remove( fetch.serv, msgId );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
161 del_DynStr( list );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
162 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
163
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
164 void
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
165 Fetch_postArts( void )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
166 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
167 DynStr *s;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
168 Str msgId, cmd, errStr, sender;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
169 int ret;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
170 const char *txt;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
171 FILE *f;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
172 sig_t lastHandler;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
173
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
174 s = new_DynStr( 10000 );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
175 if ( Out_first( fetch.serv, msgId, s ) )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
176 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
177 Log_inf( "Posting articles" );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
178 do
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
179 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
180 txt = DynStr_str( s );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
181 Out_remove( fetch.serv, msgId );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
182 if ( ! Client_postArt( msgId, txt, errStr ) )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
183 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
184 Utl_cpyStr( sender, Cfg_mailTo() );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
185 if ( strcmp( sender, "" ) == 0
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
186 && ! Prt_searchHeader( txt, "SENDER", sender )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
187 && ! Prt_searchHeader( txt, "X-NOFFLE-X-SENDER",
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
188 sender ) /* see server.c */
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
189 && ! Prt_searchHeader( txt, "FROM", sender ) )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
190 Log_err( "Article %s has no From/Sender/X-Sender field",
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
191 msgId );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
192 else
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
193 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
194 Log_ntc( "Return article to '%s' by mail", sender );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
195 snprintf( cmd, MAXCHAR,
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
196 "mail -s '[ NOFFLE: Posting failed ]' '%s'",
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
197 sender );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
198 lastHandler = signal( SIGPIPE, SIG_IGN );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
199 f = popen( cmd, "w" );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
200 if ( f == NULL )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
201 Log_err( "Invocation of '%s' failed (%s)", cmd,
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
202 strerror( errno ) );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
203 else
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
204 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
205 fprintf( f,
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
206 "\t[ NOFFLE: POSTING OF ARTICLE FAILED ]\n"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
207 "\n"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
208 "\t[ The posting of your article failed. ]\n"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
209 "\t[ Reason of failure at remote server: ]\n"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
210 "\n"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
211 "\t[ %s ]\n"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
212 "\n"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
213 "\t[ Full article text has been appended. ]\n"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
214 "\n"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
215 "%s"
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
216 ".\n",
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
217 errStr, txt );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
218 ret = pclose( f );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
219 if ( ret != EXIT_SUCCESS )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
220 Log_err( "'%s' exit value %d", cmd, ret );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
221 signal( SIGPIPE, lastHandler );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
222 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
223 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
224 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
225 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
226 while ( Out_next( msgId, s ) );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
227 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
228 del_DynStr( s );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
229 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
230
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
231 Bool
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
232 Fetch_init( const char *serv )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
233 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
234 if ( ! connectToServ( serv ) )
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
235 return FALSE;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
236 Utl_cpyStr( fetch.serv, serv );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
237 fetch.ready = TRUE;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
238 return TRUE;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
239 }
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
240
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
241 void
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
242 Fetch_close()
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
243 {
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
244 Client_disconnect();
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
245 fetch.ready = FALSE;
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
246 Log_inf( "Fetch from '%s' finished", fetch.serv );
04124a4423d4 [svn] Initial revision
enz
parents:
diff changeset
247 }