implement libtelnet_begin_compress2()
diff --git a/libtelnet.c b/libtelnet.c
index 755ebed..4a521e6 100644
--- a/libtelnet.c
+++ b/libtelnet.c
@@ -510,3 +510,28 @@
 	}
 #endif /* HAVE_ZLIB */
 }
+
+void libtelnet_begin_compress2(struct libtelnet_t *telnet, void *user_data) {
+#ifdef HAVE_ZLIB
+	z_stream *zlib;
+
+	/* don't do this if we've already got a compression stream */
+	if (telnet->z_deflate != 0)
+		return;
+	
+	/* only supported by servers */
+	if (telnet->mode != LIBTELNET_MODE_SERVER)
+		return;
+
+	/* attempt to create output stream first, bail if we can't */
+	if ((zlib = _init_zlib(telnet, 1, user_data)) == 0)
+		return;
+
+	/* send compression marker */
+	libtelnet_send_subnegotiation(telnet, LIBTELNET_TELOPT_COMPRESS2, 0, 0,
+			user_data);
+
+	/* set our deflate stream */
+	telnet->z_deflate = zlib;
+#endif /* HAVE_ZLIB */
+}
diff --git a/libtelnet.h b/libtelnet.h
index 843b76b..87f0659 100644
--- a/libtelnet.h
+++ b/libtelnet.h
@@ -190,4 +190,8 @@
 		unsigned char opt, unsigned char *buffer, unsigned int size,
 		void *user_data);
 
+/* begin sending compressed data (server only) */
+extern void libtelnet_begin_compress2(struct libtelnet_t *telnet,
+		void *user_data);
+
 #endif /* !defined(LIBTELNET_INCLUDE) */