fix warning in c_glib from add max_message_size code
diff --git a/lib/c_glib/src/thrift/c_glib/transport/thrift_server_transport.c b/lib/c_glib/src/thrift/c_glib/transport/thrift_server_transport.c
index 6873011..8354f80 100644
--- a/lib/c_glib/src/thrift/c_glib/transport/thrift_server_transport.c
+++ b/lib/c_glib/src/thrift/c_glib/transport/thrift_server_transport.c
@@ -36,7 +36,7 @@
 thrift_server_transport_updateKnownMessageSize(ThriftServerTransport *transport, glong size, GError **error)
 {
   gboolean boolean = TRUE;
-  ThriftServerTransport *tst = THRIFT_TRANSPORT (transport);
+  ThriftServerTransport *tst = THRIFT_SERVER_TRANSPORT (transport);
   ThriftServerTransportClass *tstc = THRIFT_SERVER_TRANSPORT_GET_CLASS (transport);
   glong consumed = tst->knowMessageSize_ - tst->remainingMessageSize_;
   if(!tstc->resetConsumedMessageSize (transport, size, error))
@@ -176,6 +176,7 @@
 thrift_server_transport_class_init (ThriftServerTransportClass *c)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (c);
+  ThriftServerTransportClass *tstc = THRIFT_SERVER_TRANSPORT_CLASS (c);
   GParamSpec *param_spec = NULL;
   
   /* setup accessors and mutators */
@@ -216,10 +217,10 @@
   c->listen = thrift_server_transport_listen;
   c->accept = thrift_server_transport_accept;
   c->close = thrift_server_transport_close;
-  c->updateKnownMessageSize = thrift_server_transport_updateKnownMessageSize;
-  c->checkReadBytesAvailable = thrift_server_transport_checkReadBytesAvailable;
-  c->resetConsumedMessageSize = thrift_server_transport_resetConsumedMessageSize;
-  c->countConsumedMessageBytes = thrift_server_transport_countConsumedMessageBytes;
+  tstc->updateKnownMessageSize = thrift_server_transport_updateKnownMessageSize;
+  tstc->checkReadBytesAvailable = thrift_server_transport_checkReadBytesAvailable;
+  tstc->resetConsumedMessageSize = thrift_server_transport_resetConsumedMessageSize;
+  tstc->countConsumedMessageBytes = thrift_server_transport_countConsumedMessageBytes;
 }
 
 static void
diff --git a/lib/c_glib/src/thrift/c_glib/transport/thrift_server_transport.h b/lib/c_glib/src/thrift/c_glib/transport/thrift_server_transport.h
index 0fb55c0..9bf7901 100644
--- a/lib/c_glib/src/thrift/c_glib/transport/thrift_server_transport.h
+++ b/lib/c_glib/src/thrift/c_glib/transport/thrift_server_transport.h
@@ -63,10 +63,10 @@
   gboolean (*listen) (ThriftServerTransport *transport, GError **error);
   ThriftTransport *(*accept) (ThriftServerTransport *transport, GError **error);
   gboolean (*close) (ThriftServerTransport *transport, GError **error);
-  gboolean (*updateKnownMessageSize) (ThriftTransport *transport, glong size, GError **error);
-  gboolean (*checkReadBytesAvailable) (ThriftTransport *transport, glong numBytes, GError **error);
-  gboolean (*resetConsumedMessageSize) (ThriftTransport *transport, glong newSize, GError **error);
-  gboolean (*countConsumedMessageBytes) (ThriftTransport *transport, glong numBytes, GError **error);
+  gboolean (*updateKnownMessageSize) (ThriftServerTransport *transport, glong size, GError **error);
+  gboolean (*checkReadBytesAvailable) (ThriftServerTransport *transport, glong numBytes, GError **error);
+  gboolean (*resetConsumedMessageSize) (ThriftServerTransport *transport, glong newSize, GError **error);
+  gboolean (*countConsumedMessageBytes) (ThriftServerTransport *transport, glong numBytes, GError **error);
 };
 
 /* used by THRIFT_TYPE_SERVER_TRANSPORT */
diff --git a/lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.c b/lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.c
index 3778302..0afcb1b 100644
--- a/lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.c
+++ b/lib/c_glib/src/thrift/c_glib/transport/thrift_ssl_socket.c
@@ -69,6 +69,8 @@
 /* This array will store all of the mutexes available to OpenSSL. */
 static MUTEX_TYPE *thrift_ssl_socket_global_mutex_buf=NULL;
 
+gboolean
+thrift_ssl_socket_authorize(ThriftTransport * transport, GError **error);
 
 /**
  * OpenSSL uniq id function.
@@ -245,7 +247,7 @@
       gchar byte;
       rc = SSL_peek(ssl_socket->ssl, &byte, 1);
       if (rc < 0) {
-	  thrift_ssl_socket_get_ssl_error(ssl_socket, "Check socket data",
+	  thrift_ssl_socket_get_ssl_error(ssl_socket, (const guchar*)"Check socket data",
 					  THRIFT_SSL_SOCKET_ERROR_SSL, rc, error);
       }
       if (rc == 0) {
@@ -315,7 +317,7 @@
 	      continue;
 	  }
       }else{
-	  thrift_ssl_socket_get_ssl_error(ssl_socket, "Receive error",
+	  thrift_ssl_socket_get_ssl_error(ssl_socket, (const guchar*)"Receive error",
 					  THRIFT_SSL_SOCKET_ERROR_SSL, bytes, error);
 
       }
@@ -351,7 +353,7 @@
       ret = SSL_write (ssl_socket->ssl, (guint8 *)buf + sent, len - sent);
       if (ret < 0)
 	{
-	  thrift_ssl_socket_get_ssl_error(ssl_socket, "Send error",
+	  thrift_ssl_socket_get_ssl_error(ssl_socket, (const guchar*)"Send error",
 					  THRIFT_SSL_SOCKET_ERROR_SSL, ret, error);
 	  return FALSE;
 	}
@@ -423,7 +425,7 @@
 	  rc = SSL_connect(ssl_socket->ssl);
       }
       if (rc <= 0) {
-	  thrift_ssl_socket_get_ssl_error(ssl_socket, "Error while connect/bind", THRIFT_SSL_SOCKET_ERROR_CONNECT_BIND, rc, error);
+	  thrift_ssl_socket_get_ssl_error(ssl_socket, (const guchar*)"Error while connect/bind", THRIFT_SSL_SOCKET_ERROR_CONNECT_BIND, rc, error);
 	  return FALSE;
       }
   }else
@@ -851,7 +853,7 @@
   }
 
   if (context == NULL) {
-      thrift_ssl_socket_get_error("No cipher overlay", THRIFT_SSL_SOCKET_ERROR_CIPHER_NOT_AVAILABLE, error);
+      thrift_ssl_socket_get_error((const guchar*)"No cipher overlay", THRIFT_SSL_SOCKET_ERROR_CIPHER_NOT_AVAILABLE, error);
       return NULL;
   }
   SSL_CTX_set_mode(context, SSL_MODE_AUTO_RETRY);
diff --git a/lib/c_glib/src/thrift/c_glib/transport/thrift_transport.c b/lib/c_glib/src/thrift/c_glib/transport/thrift_transport.c
index b876b07..9d3f25e 100644
--- a/lib/c_glib/src/thrift/c_glib/transport/thrift_transport.c
+++ b/lib/c_glib/src/thrift/c_glib/transport/thrift_transport.c
@@ -309,6 +309,7 @@
   /* setup accessors and mutators */
   gobject_class->get_property = thrift_transport_get_property;
   gobject_class->set_property = thrift_transport_set_property;
+  gobject_class->dispose = thrift_transport_dispose;
   
   param_spec = g_param_spec_object ("configuration",
                                     "configuration (construct)",
diff --git a/lib/c_glib/test/testmemorybuffer.c b/lib/c_glib/test/testmemorybuffer.c
index 9fb68b9..cc9c56c 100755
--- a/lib/c_glib/test/testmemorybuffer.c
+++ b/lib/c_glib/test/testmemorybuffer.c
@@ -186,7 +186,6 @@
 test_read_and_write_external (void)
 {
   ThriftMemoryBuffer *tbuffer = NULL;
-  gchar *b;
   GError *error = NULL;
   GByteArray *buf = g_byte_array_new ();
   g_assert (buf != NULL);
diff --git a/lib/c_glib/test/testthriftbinaryreadcheck.c b/lib/c_glib/test/testthriftbinaryreadcheck.c
index 36454ca..f1caba8 100644
--- a/lib/c_glib/test/testthriftbinaryreadcheck.c
+++ b/lib/c_glib/test/testthriftbinaryreadcheck.c
@@ -173,7 +173,7 @@
                             "port", port, "path", NULL, 
                             "configuration", tconfiguration, NULL);
     transport = THRIFT_TRANSPORT (tsocket);
-    THRIFT_TRANSPORT_GET_CLASS (tsocket)->resetConsumedMessageSize(tsocket, -1, NULL);
+    THRIFT_TRANSPORT_GET_CLASS (tsocket)->resetConsumedMessageSize(THRIFT_TRANSPORT (tsocket), -1, NULL);
     thrift_transport_open (transport, NULL);
     g_assert (thrift_transport_is_open (transport));
 
@@ -221,9 +221,7 @@
     ThriftType element_type = T_VOID, 
                key_type = T_VOID, 
                value_type = T_VOID; 
-    gint32 ret = 0;
     guint32 size = 0;
-    glong tempsize = 0;
 
     ThriftConfiguration *tconfiguration = g_object_new (THRIFT_TYPE_CONFIGURATION,
                                                         "max_message_size", MAX_MESSAGE_SIZE,
diff --git a/lib/c_glib/test/testthriftbufferedreadcheck.c b/lib/c_glib/test/testthriftbufferedreadcheck.c
index 1472072..4870ae8 100755
--- a/lib/c_glib/test/testthriftbufferedreadcheck.c
+++ b/lib/c_glib/test/testthriftbufferedreadcheck.c
@@ -38,7 +38,6 @@
 static void
 test_open_and_close(void)
 {
-  ThriftConfiguration *tconfiguration = NULL;
   ThriftSocket *tsocket = NULL;
   ThriftTransport *transport = NULL;
   GError *err = NULL;
diff --git a/lib/c_glib/test/testthriftcompactreadcheck.c b/lib/c_glib/test/testthriftcompactreadcheck.c
index 03466ae..e2547d4 100644
--- a/lib/c_glib/test/testthriftcompactreadcheck.c
+++ b/lib/c_glib/test/testthriftcompactreadcheck.c
@@ -217,7 +217,7 @@
   ThriftTransport *client = NULL;
   ThriftCompactProtocol *tc = NULL;
   ThriftProtocol *protocol = NULL;
-  ThriftType element_type, key_type, value_type, field_type;
+  ThriftType element_type, key_type, value_type;
   guint32 size = 0;
 
   ThriftConfiguration *tconfiguration = g_object_new (THRIFT_TYPE_CONFIGURATION, "max_message_size", MAX_MESSAGE_SIZE,
diff --git a/lib/c_glib/test/testtransportsslsocket.c b/lib/c_glib/test/testtransportsslsocket.c
index 3c2644d..ba9ffdc 100644
--- a/lib/c_glib/test/testtransportsslsocket.c
+++ b/lib/c_glib/test/testtransportsslsocket.c
@@ -103,7 +103,7 @@
   GError *error=NULL;
 
   GObject *object = NULL;
-  object = thrift_ssl_socket_new(SSLTLS, &error);
+  object = (GObject *)thrift_ssl_socket_new(SSLTLS, &error);
   g_object_get (G_OBJECT(object), "hostname", &hostname, "port", &port, "ssl_context", &ssl_ctx, NULL);
   g_assert (ssl_ctx!=NULL);
 
@@ -180,7 +180,6 @@
   ThriftSSLSocket *tSSLSocket = NULL;
   ThriftTransport *transport = NULL;
   GError *error=NULL;
-  char buffer[] = "this must not break";
 
   /* open a connection and close it */
   tSSLSocket = thrift_ssl_socket_new_with_host(SSLTLS, "localhost", 51188+1, &error);
@@ -267,13 +266,13 @@
   /* loop through all the results and connect to the first we can */
   char dnshost[INET6_ADDRSTRLEN]; /* bigger addr supported IPV6 */
   char socket_ip[INET6_ADDRSTRLEN];
-  if(inet_ntop(addr->ss_family, get_in_addr(addr), socket_ip, INET6_ADDRSTRLEN)==socket_ip){
+  if(inet_ntop(addr->ss_family, get_in_addr((struct sockaddr*)addr), socket_ip, INET6_ADDRSTRLEN)==socket_ip){
       g_debug("We are connected to host %s checking against certificate...", socket_ip);
       int sizeip = socket_ip!=NULL ? strlen(socket_ip) : 0;
       for(p = addr_info; p != NULL; p = p->ai_next) {
 	  if(inet_ntop(p->ai_family, get_in_addr((struct sockaddr *)p->ai_addr), dnshost, INET6_ADDRSTRLEN)==dnshost){
 	      if(dnshost!=NULL){
-		  g_info("DNS address [%i -> %s]", p->ai_addr, dnshost);
+		  g_info("DNS address [%i -> %s]", ((guint32)(p->ai_addrlen)), dnshost);
 		  if(!strncmp(dnshost, socket_ip, sizeip)){
 		      retval=1;
 		      break; /* if we get here, we must have connected successfully */
@@ -289,7 +288,7 @@
   return retval;
 }
 
-static void
+static void 
 read_from_file(char *buffer, long size, const char *file_name)
 {
   char ch;
@@ -330,7 +329,7 @@
   }
   char *tmp = BN_bn2dec(bn);
   if (!tmp) {
-      g_warning(stderr, "unable to convert BN to decimal string.\n");
+      g_warning((const char*)stderr, "unable to convert BN to decimal string.\n");
       BN_free(bn);
       return EXIT_FAILURE;
   }
@@ -342,7 +341,7 @@
       return EXIT_FAILURE;
     }
   */
-  if(!strncmp(serial_number, tmp, strlen(serial_number))){
+  if(!strncmp((const char*)serial_number, tmp, strlen((const char*)serial_number))){
       retval=TRUE;
   }else{
       g_warning("Serial number is not valid");
@@ -356,6 +355,8 @@
 gboolean my_access_manager(ThriftTransport * transport, X509 *cert, struct sockaddr_storage *addr, GError **error)
 {
   ThriftSSLSocket *sslSocket = THRIFT_SSL_SOCKET (transport);
+  THRIFT_UNUSED_VAR (error);
+  THRIFT_UNUSED_VAR (sslSocket);
 
   g_info("Processing access to the server");
   X509_NAME* iname = cert ? X509_get_issuer_name(cert) : NULL;
@@ -368,11 +369,11 @@
       g_info("Issuer (cn) %s", issuer);
 
       /* Issuer pinning */
-      if(strncmp(ISSUER_CN_PINNING, issuer, strlen(ISSUER_CN_PINNING))){
+      if(strncmp(ISSUER_CN_PINNING, (const char*)issuer, strlen(ISSUER_CN_PINNING))){
 	  g_warning("The Issuer of the certificate is not valid");
 	  valid=FALSE;
       }
-      OPENSSL_free(issuer);
+      OPENSSL_free((void*)issuer);
       if(!valid)
 	return valid;
   }
@@ -385,7 +386,7 @@
       gboolean valid = TRUE;
 
       /* Subject pinning */
-      if(strncmp(SUBJECT_CN_PINNING, subject, strlen(SUBJECT_CN_PINNING))){
+      if(strncmp(SUBJECT_CN_PINNING, (const char*)subject, strlen(SUBJECT_CN_PINNING))){
 	  g_warning("The subject of the certificate is not valid");
 	  valid=FALSE;
       }
@@ -394,19 +395,19 @@
 	return valid;
 
       /* Host pinning       */
-      if(verify_ip(subject, addr)){
+      if(verify_ip((char*)subject, addr)){
 	  g_info("Verified subject");
       }else{
 	  g_info("Cannot verify subject");
 	  valid=FALSE;
       }
-      OPENSSL_free(subject);
+      OPENSSL_free((void*)subject);
 
       if(!valid)
 	return valid;
   }
 
-  if(!verify_certificate_sn(cert, CERT_SERIAL_NUMBER)){
+  if(!verify_certificate_sn(cert, (const unsigned char*)CERT_SERIAL_NUMBER)){
       return FALSE;
   }else{
       g_info("Verified serial number");
@@ -487,7 +488,7 @@
   ThriftServerTransport *transport = NULL;
   ThriftTransport *client = NULL;
   guchar buf[10]; /* a buffer */
-  guchar match[10] = TEST_DATA;
+  guchar match[] = TEST_DATA;
 
   ThriftServerSocket *tsocket = g_object_new (THRIFT_TYPE_SERVER_SOCKET,
 					      "port", port, NULL);