28 |
static int connect_directly_to(char *, unsigned int); |
static int connect_directly_to(char *, unsigned int); |
29 |
static int mread(int, void *, char *); |
static int mread(int, void *, char *); |
30 |
|
|
31 |
|
static void |
32 |
|
_debug_printer(int method, int output, unsigned long nleft, char *ptr) |
33 |
|
{ |
34 |
|
int len; |
35 |
|
char *mode = "?"; |
36 |
|
|
37 |
|
if (strcmp(ptr, CRLF) == 0) |
38 |
|
return; |
39 |
|
|
40 |
|
switch (method) { |
41 |
|
case CLIENT: |
42 |
|
mode = _("SERVER"); |
43 |
|
break; |
44 |
|
case SERVER: |
45 |
|
mode = _("CLIENT"); |
46 |
|
} |
47 |
|
|
48 |
|
fprintf(stderr, "(%ld)%s %s %s", nleft, mode, |
49 |
|
output ? ">>>" : "<<<", ptr); |
50 |
|
len = strlen (ptr); |
51 |
|
if (len > 0 && ptr[len-1] != '\n') |
52 |
|
fprintf(stderr, "\n"); |
53 |
|
} |
54 |
|
|
55 |
|
#define DPRINTF(method, output, nleft, ptr) do {\ |
56 |
|
if (options.termlevel == DEBUG) \ |
57 |
|
_debug_printer(method, output, nleft, ptr);\ |
58 |
|
} while (0) |
59 |
|
|
60 |
int |
int |
61 |
make_remote_connection(char *host, unsigned int port) |
make_remote_connection(char *host, unsigned int port) |
62 |
{ |
{ |
239 |
return; |
return; |
240 |
} |
} |
241 |
} |
} |
|
if (options.termlevel == DEBUG) |
|
|
fprintf(stderr, _("(%ld)SERVER >>> %s"), nleft, ptr); |
|
242 |
} |
} |
243 |
else if (method == SERVER) { |
else if (method == SERVER) { |
244 |
|
|
272 |
return; |
return; |
273 |
} |
} |
274 |
} |
} |
|
if (options.termlevel == DEBUG) |
|
|
fprintf(stderr, _("(%ld)CLIENT >>> %s"), nleft, ptr); |
|
275 |
} |
} |
276 |
|
DPRINTF(method, 1, nleft, ptr); |
277 |
if (nwritten <= 0) |
if (nwritten <= 0) |
278 |
return; |
return; |
279 |
|
|
390 |
return -1; |
return -1; |
391 |
} |
} |
392 |
*ptr = 0; |
*ptr = 0; |
393 |
if (options.termlevel == DEBUG) { |
DPRINTF(method, 0, n, (char *)vptr); |
|
if (method == CLIENT) |
|
|
fprintf(stderr, _("(%d)SERVER <<< %s"), n, (char *)vptr); |
|
|
else if (method == SERVER) |
|
|
fprintf(stderr, _("(%d)CLIENT <<< %s"), n, (char *)vptr); |
|
|
} |
|
394 |
return n; |
return n; |
395 |
} |
} |
396 |
|
|
428 |
return; |
return; |
429 |
} |
} |
430 |
|
|
431 |
|
|
432 |
/* EOF */ |
/* EOF */ |
433 |
|
|