Permalink
Browse files

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

  • Loading branch information...
1 parent 20f0385 commit ada9936a6635cc64e850d554c1b5a8d765c4ddd4 @llyzs committed May 22, 2012
Showing with 8 additions and 3 deletions.
  1. +1 −0 include/freerdp/peer.h
  2. +4 −0 libfreerdp-core/listener.c
  3. +3 −3 server/test/tfreerdp.c
View
@@ -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);
@@ -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
@@ -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);

0 comments on commit ada9936

Please sign in to comment.