|
Lines 1385-1390
Link Here
|
| 1385 |
{ |
1385 |
{ |
| 1386 |
int direct; |
1386 |
int direct; |
| 1387 |
char buf[1024]; |
1387 |
char buf[1024]; |
|
|
1388 |
char *local_ipaddr = get_local_ipaddr(c->sock); |
| 1389 |
int local_port = get_sock_port(c->sock, 1); |
| 1388 |
char *remote_ipaddr = get_peer_ipaddr(c->sock); |
1390 |
char *remote_ipaddr = get_peer_ipaddr(c->sock); |
| 1389 |
int remote_port = get_peer_port(c->sock); |
1391 |
int remote_port = get_peer_port(c->sock); |
| 1390 |
|
1392 |
|
|
Lines 1399-1407
Link Here
|
| 1399 |
|
1401 |
|
| 1400 |
snprintf(buf, sizeof buf, |
1402 |
snprintf(buf, sizeof buf, |
| 1401 |
"%s: listening port %d for %.100s port %d, " |
1403 |
"%s: listening port %d for %.100s port %d, " |
| 1402 |
"connect from %.200s port %d", |
1404 |
"connect from %.200s port %d to %.100s port %d", |
| 1403 |
rtype, c->listening_port, c->path, c->host_port, |
1405 |
rtype, c->listening_port, c->path, c->host_port, |
| 1404 |
remote_ipaddr, remote_port); |
1406 |
remote_ipaddr, remote_port, local_ipaddr, local_port); |
| 1405 |
|
1407 |
|
| 1406 |
free(c->remote_name); |
1408 |
free(c->remote_name); |
| 1407 |
c->remote_name = xstrdup(buf); |
1409 |
c->remote_name = xstrdup(buf); |
|
Lines 1419-1425
Link Here
|
| 1419 |
} else { |
1421 |
} else { |
| 1420 |
/* listen address, port */ |
1422 |
/* listen address, port */ |
| 1421 |
packet_put_cstring(c->path); |
1423 |
packet_put_cstring(c->path); |
| 1422 |
packet_put_int(c->listening_port); |
1424 |
packet_put_int(local_port); |
| 1423 |
} |
1425 |
} |
| 1424 |
/* originator host and port */ |
1426 |
/* originator host and port */ |
| 1425 |
packet_put_cstring(remote_ipaddr); |
1427 |
packet_put_cstring(remote_ipaddr); |
|
Lines 1436-1441
Link Here
|
| 1436 |
packet_send(); |
1438 |
packet_send(); |
| 1437 |
} |
1439 |
} |
| 1438 |
free(remote_ipaddr); |
1440 |
free(remote_ipaddr); |
|
|
1441 |
free(local_ipaddr); |
| 1439 |
} |
1442 |
} |
| 1440 |
|
1443 |
|
| 1441 |
static void |
1444 |
static void |