gnome-mud r716 - in trunk: . src



Author: lharris
Date: Thu Feb  5 19:49:50 2009
New Revision: 716
URL: http://svn.gnome.org/viewvc/gnome-mud?rev=716&view=rev

Log:
Temporarily purged MCCP related code.


Removed:
   trunk/src/mud-telnet-mccp.c
   trunk/src/mud-telnet-mccp.h
Modified:
   trunk/ChangeLog
   trunk/configure.ac
   trunk/src/Makefile.am
   trunk/src/mud-connection-view.c
   trunk/src/mud-connections.c
   trunk/src/mud-telnet-handlers.c
   trunk/src/mud-telnet-handlers.h
   trunk/src/mud-telnet.c
   trunk/src/mud-telnet.h

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Thu Feb  5 19:49:50 2009
@@ -92,24 +92,26 @@
 #	AC_DEFINE(ENABLE_MAPPER, 1, [Define if mapper support should be enabled])
 #fi
 
+dnl Temporarily disabling MCCP check.
+
 dnl Check whether to include MCCP code or not
-AC_ARG_ENABLE(mccp,
-	AC_HELP_STRING([--enable-mccp],
-		       [Enable MCCP (MUD Client Compression Protocol)]),,
-		enable_mccp=auto)
-if test "x$enable_mccp" != "xno"; then
-	AC_CHECK_HEADER(zlib.h, have_zlib=yes, have_zlib=no)
-	if test "x$have_zlib" = "xno" -a "x$enable_mccp" = "xyes"; then
-	  AC_MSG_ERROR([MCCP support explicitly requested but zlib was not found])
-	fi
-	if test "x$have_zlib" = "xyes"; then
-	  AC_DEFINE(ENABLE_MCCP, 1, [Define if MCCP should be enabled])
-	  enable_mccp=yes
-	  Z_LIBS="-lz"
-	fi
-fi
-AM_CONDITIONAL(USE_MCCP, test "x$enable_mccp" = xyes)
-AC_SUBST(Z_LIBS)
+dnl AC_ARG_ENABLE(mccp,
+dnl 	AC_HELP_STRING([--enable-mccp],
+dnl 		       [Enable MCCP (MUD Client Compression Protocol)]),,
+dnl 		enable_mccp=auto)
+dnl if test "x$enable_mccp" != "xno"; then
+dnl 	AC_CHECK_HEADER(zlib.h, have_zlib=yes, have_zlib=no)
+dnl 	if test "x$have_zlib" = "xno" -a "x$enable_mccp" = "xyes"; then
+dnl 	  AC_MSG_ERROR([MCCP support explicitly requested but zlib was not found])
+dnl 	fi
+dnl 	if test "x$have_zlib" = "xyes"; then
+dnl 	  AC_DEFINE(ENABLE_MCCP, 1, [Define if MCCP should be enabled])
+dnl 	  enable_mccp=yes
+dnl 	  Z_LIBS="-lz"
+dnl 	fi
+dnl fi
+dnl AM_CONDITIONAL(USE_MCCP, test "x$enable_mccp" = xyes)
+dnl AC_SUBST(Z_LIBS)
 
 dnl Check whether to include GStreamer code or not
 AC_ARG_ENABLE(gstreamer,
@@ -158,18 +160,18 @@
 
 AC_MSG_NOTICE([GNOME-Mud has been configured with the following options:])
 
-if test "x$enable_mccp" = xyes; then
-	AC_MSG_NOTICE([    * MCCP support is enabled])
-else
-	AC_MSG_NOTICE([    * MCCP support is disabled])
-fi
+dnl if test "x$enable_mccp" = xyes; then
+dnl 	AC_MSG_NOTICE([    * MCCP support is enabled])
+dnl else
+dnl 	AC_MSG_NOTICE([    * MCCP support is disabled])
+dnl fi
 
 #if test "x$enable_mapper" = xyes; then
 #	AC_MSG_NOTICE([    * Mapper support is enabled])
 #else
 #	AC_MSG_NOTICE([    * Mapper support is disabled])
 #fi
-#
+
 if test "x$enable_gstreamer" = xyes; then
 	AC_MSG_NOTICE([    * GStreamer support is enabled])
 else

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Thu Feb  5 19:49:50 2009
@@ -49,8 +49,6 @@
 	mud-telnet.h                \
 	mud-telnet-handlers.c		\
 	mud-telnet-handlers.h		\
-	mud-telnet-mccp.c			\
-	mud-telnet-mccp.h			\
 	mud-telnet-msp.c			\
 	mud-telnet-msp.h			\
 	mud-telnet-zmp.c			\

Modified: trunk/src/mud-connection-view.c
==============================================================================
--- trunk/src/mud-connection-view.c	(original)
+++ trunk/src/mud-connection-view.c	Thu Feb  5 19:49:50 2009
@@ -41,10 +41,6 @@
 #include "mud-telnet-zmp.h"
 #include "mud-telnet-msp.h"
 
-#ifdef ENABLE_MCCP
-    #include "mud-telnet-mccp.h"
-#endif
-
 #ifdef ENABLE_GST
     #include "mud-telnet-msp.h"
 #endif

Modified: trunk/src/mud-connections.c
==============================================================================
--- trunk/src/mud-connections.c	(original)
+++ trunk/src/mud-connections.c	Thu Feb  5 19:49:50 2009
@@ -1025,9 +1025,6 @@
 	stripped_name = remove_whitespace(conn->priv->original_name);
 	strip_name_new = remove_whitespace(name);
 
-	g_message("stripped_name: %s", stripped_name);
-	g_message("strip_name_new: %s", strip_name_new);
-
 	key = g_strdup_printf("/apps/gnome-mud/muds/%s/characters",
 			      stripped_name);
 	chars = gconf_client_all_dirs(client, key, NULL);

Modified: trunk/src/mud-telnet-handlers.c
==============================================================================
--- trunk/src/mud-telnet-handlers.c	(original)
+++ trunk/src/mud-telnet-handlers.c	Thu Feb  5 19:49:50 2009
@@ -38,12 +38,6 @@
 	#include "mud-telnet-msp.h"
 #endif
 
-#ifdef ENABLE_MCCP
-    #include <zlib.h>
-    #include <stdlib.h>
-	#include "mud-telnet-mccp.h"
-#endif
-
 /* TTYPE */
 
 void
@@ -333,55 +327,3 @@
 }
 #endif
 
-#ifdef ENABLE_MCCP
-/* MCCP */
-void
-MudHandler_MCCP_Enable(MudTelnet *telnet, MudTelnetHandler *handler)
-{
-	handler->enabled = TRUE;
-	telnet->mccp = FALSE;
-}
-
-void
-MudHandler_MCCP_Disable(MudTelnet *telnet, MudTelnetHandler *handler)
-{
-	handler->enabled = FALSE;
-	telnet->mccp = FALSE;
-
-	if (telnet->compress_out != NULL)
-	{
-		inflateEnd(telnet->compress_out);
-
-		g_free(telnet->compress_out);
-		g_free(telnet->compress_out_buf);
-
-		telnet->compress_out = NULL;
-	}
-}
-
-void
-MudHandler_MCCP_HandleSubNeg(MudTelnet *telnet, guchar *buf,
-    guint len, MudTelnetHandler *handler)
-{
-    telnet->mccp = TRUE;
-    telnet->mccp_new = TRUE;
-
-	telnet->compress_out = (z_stream *) calloc(1, sizeof(z_stream));
-	telnet->compress_out_buf = (guchar *) calloc(4096, sizeof(guchar));
-
-	telnet->compress_out->next_out = telnet->compress_out_buf;
-	telnet->compress_out->avail_out = 4096;
-
-	if (inflateInit(telnet->compress_out) != Z_OK)
-	{
-	    g_critical("Failed to initialize compression.");
-
-		g_free(telnet->compress_out);
-		g_free(telnet->compress_out_buf);
-		telnet->compress_out = NULL;
-		telnet->compress_out_buf = NULL;
-
-		mud_connection_view_disconnect (telnet->parent);
-	}
-}
-#endif

Modified: trunk/src/mud-telnet-handlers.h
==============================================================================
--- trunk/src/mud-telnet-handlers.h	(original)
+++ trunk/src/mud-telnet-handlers.h	Thu Feb  5 19:49:50 2009
@@ -70,12 +70,4 @@
     guint len, MudTelnetHandler *handler);
 #endif
 
-#ifdef ENABLE_MCCP
-/* MCCP */
-void MudHandler_MCCP_Enable(MudTelnet *telnet, MudTelnetHandler *handler);
-void MudHandler_MCCP_Disable(MudTelnet *telnet, MudTelnetHandler *handler);
-void MudHandler_MCCP_HandleSubNeg(MudTelnet *telnet, guchar *buf,
-    guint len, MudTelnetHandler *handler);
-#endif
-
 #endif // MUD_TELNET_HANDLERS_H

Modified: trunk/src/mud-telnet.c
==============================================================================
--- trunk/src/mud-telnet.c	(original)
+++ trunk/src/mud-telnet.c	Thu Feb  5 19:49:50 2009
@@ -35,10 +35,6 @@
 #include "mud-telnet-handlers.h"
 #include "mud-telnet-zmp.h"
 
-#ifdef ENABLE_MCCP
-#include "mud-telnet-mccp.h"
-#endif
-
 struct _MudTelnetPrivate
 {
 };
@@ -134,16 +130,6 @@
         g_string_free(telnet->processed, TRUE);
     g_free(telnet->priv);
 
-#ifdef ENABLE_MCCP
-    if (telnet->compress_out != NULL)
-    {
-	inflateEnd(telnet->compress_out);
-
-	g_free(telnet->compress_out);
-	g_free(telnet->compress_out_buf);
-    }
-#endif
-
     parent_class = g_type_class_peek_parent(G_OBJECT_GET_CLASS(object));
     parent_class->finalize(object);
 }
@@ -190,10 +176,6 @@
 
 #endif
 
-#ifdef ENABLE_MCCP
-    telnet->mccp_new = TRUE;
-#endif
-
     return telnet;
 }
 
@@ -270,16 +252,6 @@
     telnet->handlers[6].handle_sub_neg = MudHandler_MSP_HandleSubNeg;
 #endif
 
-#ifdef ENABLE_MCCP
-    /* MCCP */
-    telnet->handlers[7].type = HANDLER_MCCP2;
-    telnet->handlers[7].option_number = (guchar)TELOPT_MCCP2;
-    telnet->handlers[7].enabled = FALSE;
-    telnet->handlers[7].enable = MudHandler_MCCP_Enable;
-    telnet->handlers[7].disable = MudHandler_MCCP_Disable;
-    telnet->handlers[7].handle_sub_neg = MudHandler_MCCP_HandleSubNeg;
-#endif
-
 }
 
 gint
@@ -348,28 +320,7 @@
 
     telnet->buffer = g_string_new(NULL);
 
-#ifdef ENABLE_MCCP
-    if(telnet->mccp)
-    {
-        GString *ret = NULL;
-        gchar *str;
-
-        // decompress the buffer.
-        //ret = mud_mccp_decompress(telnet, buf, c);
-
-        if(ret == NULL)
-            return;
-        else
-        {
-            str = g_strdup(ret->str);
-            g_string_append(telnet->buffer, str);
-            g_string_free(ret, TRUE);
-            g_free(str);
-        }
-    }
-    else
-#endif
-	g_string_append_len(telnet->buffer, (gchar *)buf, c);
+    g_string_append_len(telnet->buffer, (gchar *)buf, c);
 
     count = telnet->buffer->len;
 
@@ -378,75 +329,6 @@
 	switch (telnet->tel_state)
 	{
 	case TEL_STATE_TEXT:
-#ifdef ENABLE_MCCP
-	    /* The following is only done when compressing is first
-	       enabled in order to decompress any part of the buffer
-	       that remains after the subnegotation takes place */
-	    if(telnet->mccp && telnet->mccp_new)
-	    {
-		GString *ret = NULL;
-		telnet->mccp_new = FALSE;
-
-		// decompress the rest of the buffer.
-		//ret = mud_mccp_decompress(telnet, &buf[i], c - i);
-
-		if(ret == NULL)
-		{
-		    if(*out_buf != NULL) g_string_free(*out_buf, TRUE);
-		    *out_buf = g_string_new_len(telnet->processed->str, telnet->pos);
-		    *len = telnet->pos;
-
-		    telnet->pos= 0;
-
-		    if(telnet->processed)
-		    {
-			g_string_free(telnet->processed, TRUE);
-			telnet->processed = g_string_new(NULL);
-		    }
-
-		    if(telnet->buffer)
-		    {
-			g_string_free(telnet->buffer, TRUE);
-			telnet->buffer = NULL;
-		    }
-
-		    return;
-		}
-
-		if(telnet->buffer)
-		{
-		    g_string_free(telnet->buffer, TRUE);
-		    telnet->buffer = NULL;
-		}
-
-		telnet->buffer = g_string_new(ret->str);
-
-		if(telnet->buffer->len == 0)
-		{
-		    if(*out_buf != NULL) g_string_free(*out_buf, TRUE);
-		    *out_buf = g_string_new_len(telnet->processed->str, telnet->pos);
-		    *len = telnet->pos;
-
-		    telnet->pos= 0;
-
-		    if(telnet->processed)
-		    {
-			g_string_free(telnet->processed, TRUE);
-			telnet->processed = g_string_new(NULL);
-		    }
-
-		    if(telnet->buffer)
-		    {
-			g_string_free(telnet->buffer, TRUE);
-			telnet->buffer = NULL;
-		    }
-		    return;
-		}
-
-		i = 0;
-		count = telnet->buffer->len;
-	    }
-#endif
 	    if ((guchar)telnet->buffer->str[i] == (guchar)TEL_IAC)
 		telnet->tel_state = TEL_STATE_IAC;
 	    else

Modified: trunk/src/mud-telnet.h
==============================================================================
--- trunk/src/mud-telnet.h	(original)
+++ trunk/src/mud-telnet.h	Thu Feb  5 19:49:50 2009
@@ -178,13 +178,6 @@
 	gchar *base_url;
 #endif
 
-#ifdef ENABLE_MCCP
-    z_stream * compress_out;
-	guchar * compress_out_buf;
-	gboolean mccp;
-	gboolean mccp_new;
-#endif
-
 	GString *prev_buffer;
 	GString *processed;
 	GString *buffer;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]