diff options
Diffstat (limited to 'src/xdmcp-protocol.c')
-rw-r--r-- | src/xdmcp-protocol.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/xdmcp-protocol.c b/src/xdmcp-protocol.c index f45e7aeb..2901837b 100644 --- a/src/xdmcp-protocol.c +++ b/src/xdmcp-protocol.c @@ -213,8 +213,8 @@ xdmcp_packet_decode (const guint8 *data, gsize data_length) packet->Query.authentication_names = read_string_array (&reader); break; case XDMCP_ForwardQuery: - packet->ForwardQuery.client_address = read_string (&reader); - packet->ForwardQuery.client_port = read_string (&reader); + read_data (&reader, &packet->ForwardQuery.client_address); + read_data (&reader, &packet->ForwardQuery.client_port); packet->ForwardQuery.authentication_names = read_string_array (&reader); break; case XDMCP_Willing: @@ -326,8 +326,8 @@ xdmcp_packet_encode (XDMCPPacket *packet, guint8 *data, gsize max_length) write_string_array (&writer, packet->Query.authentication_names); break; case XDMCP_ForwardQuery: - write_string (&writer, packet->ForwardQuery.client_address); - write_string (&writer, packet->ForwardQuery.client_port); + write_data (&writer, &packet->ForwardQuery.client_address); + write_data (&writer, &packet->ForwardQuery.client_port); write_string_array (&writer, packet->ForwardQuery.authentication_names); break; case XDMCP_Willing: @@ -444,7 +444,7 @@ string_list_tostring (gchar **strings) gchar * xdmcp_packet_tostring (XDMCPPacket *packet) { - gchar *string, *t, *t2; + gchar *string, *t, *t2, *t5; gint i; GString *t3; @@ -466,10 +466,14 @@ xdmcp_packet_tostring (XDMCPPacket *packet) g_free (t); return string; case XDMCP_ForwardQuery: - t = string_list_tostring (packet->ForwardQuery.authentication_names); - string = g_strdup_printf ("ForwardQuery(client_address='%s' client_port='%s' authentication_names=[%s])", - packet->ForwardQuery.client_address, packet->ForwardQuery.client_port, t); + t = data_tostring (&packet->ForwardQuery.client_address); + t2 = data_tostring (&packet->ForwardQuery.client_port); + t5 = string_list_tostring (packet->ForwardQuery.authentication_names); + string = g_strdup_printf ("ForwardQuery(client_address=%s client_port=%s authentication_names=[%s])", + t, t2, t5); g_free (t); + g_free (t2); + g_free (t5); return string; case XDMCP_Willing: return g_strdup_printf ("Willing(authentication_name='%s' hostname='%s' status='%s')", @@ -565,8 +569,8 @@ xdmcp_packet_free (XDMCPPacket *packet) g_strfreev (packet->Query.authentication_names); break; case XDMCP_ForwardQuery: - g_free (packet->ForwardQuery.client_address); - g_free (packet->ForwardQuery.client_port); + g_free (packet->ForwardQuery.client_address.data); + g_free (packet->ForwardQuery.client_port.data); g_strfreev (packet->ForwardQuery.authentication_names); break; case XDMCP_Willing: |