Mercurial > noffle
comparison src/client.c @ 197:24d4cd032da5 noffle
[svn] * AUTHORS,INSTALL,NEWS,README,TODO,docs/NOTES,src/client.c,src/protocol.c,
src/protocol.h,src/server.c: Merge with latest 1.0 branch. I do not
intend to do any further merges from the 1.0 branch; future changes to
1.0 should be carried over by hand if necessary.
* src/configfile.c,src/content.c,src/control.c,src/database.c,
src/dynamicstring.c,src/fetch.c,src/filter.c,src/group.c,
src/itemlist.c,src/lock.c,src/outgoing.c,src/over.c,src/post.c,
src/pseudo.c,src/request.c,src/util.c: Minor includes rearrangement.
author | bears |
---|---|
date | Wed, 31 Oct 2001 11:44:53 +0000 |
parents | 28488e0e3630 |
children | 7a2b488e258d |
comparison
equal
deleted
inserted
replaced
196:60a70c16d79c | 197:24d4cd032da5 |
---|---|
1 /* | 1 /* |
2 client.c | 2 client.c |
3 | 3 |
4 $Id: client.c 310 2001-10-20 13:23:46Z bears $ | 4 $Id: client.c 316 2001-10-31 11:44:53Z 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 |
10 | |
11 #include "client.h" | |
12 | 10 |
13 #include <stdio.h> | 11 #include <stdio.h> |
14 #include <arpa/inet.h> | 12 #include <arpa/inet.h> |
15 #include <ctype.h> | 13 #include <ctype.h> |
16 #include <netdb.h> | 14 #include <netdb.h> |
17 #include <netinet/in.h> | 15 #include <netinet/in.h> |
18 #include <signal.h> | 16 #include <signal.h> |
19 #include <stdarg.h> | 17 #include <stdarg.h> |
20 #include <sys/socket.h> | 18 #include <sys/socket.h> |
21 #include <unistd.h> | 19 #include <unistd.h> |
20 #include "client.h" | |
22 #include "configfile.h" | 21 #include "configfile.h" |
23 #include "content.h" | 22 #include "content.h" |
24 #include "control.h" | 23 #include "control.h" |
25 #include "dynamicstring.h" | 24 #include "dynamicstring.h" |
26 #include "filter.h" | 25 #include "filter.h" |
62 { "ctl.*", TRUE } | 61 { "ctl.*", TRUE } |
63 }; | 62 }; |
64 | 63 |
65 struct | 64 struct |
66 { | 65 { |
67 FILE* in; /* Receiving socket from server */ | 66 FILE* in; /* Receiving socket from server */ |
68 FILE* out; /* Sending socket to server */ | 67 FILE* out; /* Sending socket to server */ |
69 Str lastCmd; /* Last command line */ | 68 Str lastCmd; /* Last command line */ |
70 Str lastStat; /* Response from server to last command */ | 69 Str lastStat; /* Response from server to last command */ |
71 Str grp; /* Selected group */ | 70 Str grp; /* Selected group */ |
72 int rmtFirst; /* First article of current group at server */ | 71 int rmtFirst; /* First article of current group at server */ |
73 int rmtLast; /* Last article of current group at server */ | 72 int rmtLast; /* Last article of current group at server */ |
74 Bool auth; /* Authetication already done? */ | 73 Bool auth; /* Authentication already done? */ |
75 Str serv; /* Remote server name */ | 74 Str serv; /* Remote server name */ |
76 } client = { NULL, NULL, "", "", "", 1, 0, FALSE, "" }; | 75 } client = { NULL, NULL, "", "", "", 1, 0, FALSE, "" }; |
77 | 76 |
78 static void | 77 static void |
79 logBreakDown( void ) | 78 logBreakDown( void ) |
80 { | 79 { |
349 client.in = client.out = NULL; | 348 client.in = client.out = NULL; |
350 break; | 349 break; |
351 } | 350 } |
352 Utl_cpyStr( client.serv, serv ); | 351 Utl_cpyStr( client.serv, serv ); |
353 stat = getStat(); | 352 stat = getStat(); |
354 switch( stat ) { | 353 switch( stat ) |
354 { | |
355 case STAT_READY_POST_ALLOW: | 355 case STAT_READY_POST_ALLOW: |
356 case STAT_READY_NO_POST_ALLOW: | 356 case STAT_READY_NO_POST_ALLOW: |
357 Log_inf( "Connected to %s:%d", | 357 Log_inf( "Connected to %s:%d", |
358 inet_ntoa( sIn.sin_addr ), port ); | 358 inet_ntoa( sIn.sin_addr ), port ); |
359 /* INN needs a MODE READER before it will permit POST. */ | 359 /* INN needs a MODE READER before it will permit POST. */ |