gnome-mud r792 - in trunk: . src
- From: lharris svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-mud r792 - in trunk: . src
- Date: Sat, 14 Mar 2009 18:41:31 +0000 (UTC)
Author: lharris
Date: Sat Mar 14 18:41:31 2009
New Revision: 792
URL: http://svn.gnome.org/viewvc/gnome-mud?rev=792&view=rev
Log:
Update MSSP support to spec.
Modified:
trunk/ChangeLog
trunk/src/mud-telnet-mssp.c
Modified: trunk/src/mud-telnet-mssp.c
==============================================================================
--- trunk/src/mud-telnet-mssp.c (original)
+++ trunk/src/mud-telnet-mssp.c Sat Mar 14 18:41:31 2009
@@ -326,16 +326,31 @@
break;
case PARSE_STATE_VAL_STRING:
- if( buf[i] != TEL_MSSP_VAR )
+ if( buf[i] != TEL_MSSP_VAR && buf[i] != TEL_MSSP_VAL )
value = g_string_append_c(value, buf[i]);
else
{
- g_hash_table_replace(self->priv->mssp_data,
- g_string_free(key, FALSE),
- g_string_free(value, FALSE));
-
- state = PARSE_STATE_VAR;
- i--;
+ switch( buf[i] )
+ {
+ /* VAR's can have multiple VALs assigned to them. */
+ case TEL_MSSP_VAL:
+ g_hash_table_replace(self->priv->mssp_data,
+ g_strdup(key->str),
+ g_string_free(value, FALSE));
+
+ state = PARSE_STATE_VAL;
+ i--;
+ break;
+
+ case TEL_MSSP_VAR:
+ g_hash_table_replace(self->priv->mssp_data,
+ g_string_free(key, FALSE),
+ g_string_free(value, FALSE));
+
+ state = PARSE_STATE_VAR;
+ i--;
+ break;
+ }
}
if( i + 1 == len) // Last value in subnegotiation.
@@ -346,6 +361,32 @@
break;
}
}
+
+ /* Log the results */
+ {
+ GList *key_list, *entry;
+
+ g_log("Telnet", G_LOG_LEVEL_MESSAGE, "%s", "MSSP Data:");
+
+ key_list = g_hash_table_get_keys(self->priv->mssp_data);
+
+ entry = key_list;
+
+ while(entry)
+ {
+ const gchar *keyv = entry->data;
+ const gchar *valv = g_hash_table_lookup(self->priv->mssp_data, keyv);
+
+ g_log("Telnet",
+ G_LOG_LEVEL_MESSAGE,
+ "\t%s = %s",
+ keyv, (valv) ? valv : "<null>");
+
+ entry = g_list_next(entry);
+ }
+
+ g_list_free(key_list);
+ }
}
/* Private Methods */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]