version 1.77, 2015/11/13 16:53:46 |
version 1.78, 2015/11/13 17:01:12 |
|
|
} |
} |
|
|
static int |
static int |
togdebug(int unused) |
|
{ |
|
if (net > 0 && |
|
(setsockopt(net, SOL_SOCKET, SO_DEBUG, &debug, sizeof(debug))) == -1) { |
|
perror("setsockopt (SO_DEBUG)"); |
|
} |
|
return 1; |
|
} |
|
|
|
static int |
|
togcrlf(int unused) |
togcrlf(int unused) |
{ |
{ |
if (crlf) { |
if (crlf) { |
|
|
&localchars, |
&localchars, |
"recognize certain control characters" }, |
"recognize certain control characters" }, |
{ " ", "", 0, 0 }, /* empty line */ |
{ " ", "", 0, 0 }, /* empty line */ |
{ "debug", |
|
"debugging", |
|
togdebug, |
|
&debug, |
|
"turn on socket level debugging" }, |
|
{ "netdata", |
{ "netdata", |
"printing of hexadecimal network data (debugging)", |
"printing of hexadecimal network data (debugging)", |
0, |
0, |
|
|
sizeof(tos)) < 0 && errno != ENOPROTOOPT) |
sizeof(tos)) < 0 && errno != ENOPROTOOPT) |
perror("telnet: setsockopt (IPV6_TCLASS) (ignored)"); |
perror("telnet: setsockopt (IPV6_TCLASS) (ignored)"); |
break; |
break; |
} |
|
|
|
if (debug) { |
|
int one = 1; |
|
|
|
if (setsockopt(net, SOL_SOCKET, SO_DEBUG, &one, |
|
sizeof(one)) < 0) |
|
perror("setsockopt (SO_DEBUG)"); |
|
} |
} |
|
|
if (connect(net, res->ai_addr, res->ai_addrlen) < 0) { |
if (connect(net, res->ai_addr, res->ai_addrlen) < 0) { |