libfreerdp-core/server: add local flag for unix connection.

This commit is contained in:
Vic Lee 2012-05-22 23:10:52 +08:00
parent 20f038581b
commit ada9936a66
3 changed files with 8 additions and 3 deletions

View File

@ -69,6 +69,7 @@ struct rdp_freerdp_peer
psPeerReceiveChannelData ReceiveChannelData;
uint32 ack_frame_id;
boolean local;
};
FREERDP_API void freerdp_peer_context_new(freerdp_peer* client);

View File

@ -237,6 +237,10 @@ static boolean freerdp_listener_check_fds(freerdp_listener* instance)
sin_addr = &(((struct sockaddr_in*) &peer_addr)->sin_addr);
else if (peer_addr.ss_family == AF_INET6)
sin_addr = &(((struct sockaddr_in6*) &peer_addr)->sin6_addr);
#ifndef _WIN32
else if (peer_addr.ss_family == AF_UNIX)
client->local = true;
#endif
if (sin_addr)
inet_ntop(peer_addr.ss_family, sin_addr, client->hostname, sizeof(client->hostname));

View File

@ -461,7 +461,7 @@ boolean tf_peer_post_connect(freerdp_peer* client)
* The server may start sending graphics output and receiving keyboard/mouse input after this
* callback returns.
*/
printf("Client %s is activated (osMajorType %d osMinorType %d)", client->hostname,
printf("Client %s is activated (osMajorType %d osMinorType %d)", client->local ? "(local)" : client->hostname,
client->settings->os_major_type, client->settings->os_minor_type);
if (client->settings->autologon)
{
@ -613,7 +613,7 @@ static void* test_peer_mainloop(void* arg)
client->Initialize(client);
context = (testPeerContext*) client->context;
printf("We've got a client %s\n", client->hostname);
printf("We've got a client %s\n", client->local ? "(local)" : client->hostname);
while (1)
{
@ -661,7 +661,7 @@ static void* test_peer_mainloop(void* arg)
break;
}
printf("Client %s disconnected.\n", client->hostname);
printf("Client %s disconnected.\n", client->local ? "(local)" : client->hostname);
client->Disconnect(client);
freerdp_peer_context_free(client);