Remove trailing whitespace and mixed indenting
authorTill Maas <opensource@till.name>
Sat, 31 Oct 2015 08:37:51 +0100
changeset 664 f57b1b61e1fe
parent 663 3697251ef911
child 665 458dfcf7ed01
child 668 55cd0aab9061
Remove trailing whitespace and mixed indenting
COPYING
NEWS
README
README.WIN32
acinclude.m4
configure.ac
docs/reference/Makefile.am
docs/reference/loudmouth-docs.sgml
examples/lm-change-password.c
examples/lm-register.c
examples/lm-send-async.c
examples/test-http-proxy.c
examples/test-lm.c
examples/test-tunnel.c
loudmouth/lm-error.h
loudmouth/lm-old-socket.c
loudmouth/lm-parser.c
loudmouth/lm-sasl.c
loudmouth/lm-sock.c
loudmouth/lm-ssl-base.c
loudmouth/lm-ssl-base.h
loudmouth/lm-ssl-internals.h
loudmouth/lm-ssl-openssl.c
loudmouth/lm-ssl.h
tests/Makefile.am
tests/test-data-objects.c
tests/test-parser.c
--- a/COPYING	Sun Feb 15 15:30:12 2015 +0100
+++ b/COPYING	Sat Oct 31 08:37:51 2015 +0100
@@ -146,7 +146,7 @@
 on the Library (independent of the use of the Library in a tool for
 writing it).  Whether that is true depends on what the Library does
 and what the program that uses the Library does.
-  
+
   1. You may copy and distribute verbatim copies of the Library's
 complete source code as you receive it, in any medium, provided that
 you conspicuously and appropriately publish on each copy an
--- a/NEWS	Sun Feb 15 15:30:12 2015 +0100
+++ b/NEWS	Sat Oct 31 08:37:51 2015 +0100
@@ -32,7 +32,7 @@
 Changes in 1.1.2:
 -----------------
 * Support for internationalised domain names, LM-42
-* Fixed issue where no disconnect signal was emitted when connection closed 
+* Fixed issue where no disconnect signal was emitted when connection closed
   during opening, LM-43
 * Plugged a memory leak in LmConnection, LM-39
 * Fixed warnings due to uninitialized value, LM-35
@@ -62,7 +62,7 @@
 * State fixes when using blocking API, LM-7           (Mikael Hallendal)
 * Check that connection is open before using it, LM-6 (Mikael Hallendal)
 * Fix infinite loop in blocking open if failed, LM-8  (Mikael Hallendal)
- 
+
 Changes in 0.90:
 ----------------
 * Two crashers for ssl read fixed (Micke, Daniel Lavalliere)
@@ -98,7 +98,7 @@
 * HTTP proxy support
 * Memory leak fix
 * Distribute the win32-config.h file needed to build on Windows.
- 
+
 Changes in 0.15.1:
 ------------------
 * Require GnuTLS >= 1.0.0
@@ -106,7 +106,7 @@
 Changes in 0.15:
 ----------------
 * Better Win32 instructions.
-* Fixed bug when disconnecting and then connecting again using the same 
+* Fixed bug when disconnecting and then connecting again using the same
   LmConnection.
 * Documentation typos and errors fixed by Ross Burton.
 * Better SSL support, now gives the application the possibility to decide
@@ -122,7 +122,7 @@
 ----------------
 * Added information about building on Windows
 * Bug when using GnuTLS fixed.
-* Fixed a bug that could cause replies to be overlooked when using 
+* Fixed a bug that could cause replies to be overlooked when using
   blocking mode.
 * Added IPv6-support, patch from Sjoerd Simons.
 * Made it easier to build RPMs without SSL-support.
@@ -138,11 +138,11 @@
 
 Changes in 0.13:
 ----------------
-* Fixed bug in the sub type checking code for messages  
+* Fixed bug in the sub type checking code for messages
 * Fixed bug that hang the app when disconnected uncleanly
-* Fixed autoconf problems with gnutls                   
-* Disconnect cleanly                                   
-* Fix sha implementation to work on Linux/PPC         
+* Fixed autoconf problems with gnutls
+* Disconnect cleanly
+* Fix sha implementation to work on Linux/PPC
 
 Changes in 0.12:
 ----------------
@@ -160,7 +160,7 @@
 
 Changes in 0.10:
 ----------------
-* Fixed case bug in message nodes. Making it not treat the XML as case 
+* Fixed case bug in message nodes. Making it not treat the XML as case
   dependant.
 * Added lm_message_node_[get|set]_raw_mode that determines if
   the node value should be escaped or not.
--- a/README	Sun Feb 15 15:30:12 2015 +0100
+++ b/README	Sat Oct 31 08:37:51 2015 +0100
@@ -43,7 +43,7 @@
 Debugging:
 ==========
 
-You can get debug information printed to STDOUT by using the environment 
+You can get debug information printed to STDOUT by using the environment
 variable LM_DEBUG.
 
 export LM_DEBUG=<keyword>
--- a/README.WIN32	Sun Feb 15 15:30:12 2015 +0100
+++ b/README.WIN32	Sat Oct 31 08:37:51 2015 +0100
@@ -1,10 +1,10 @@
 Steps to build Loudmouth 0.13.1 under Windows
 ---------------------------------------------
 
-1) Go to Tor Lillqvist's Win32 glib page 
+1) Go to Tor Lillqvist's Win32 glib page
    (http://www.gimp.org/~tml/gimp/win32/downloads.html)
 
-2) Get the pre-built glib, glib-dev, libintl and libiconv binaries 
+2) Get the pre-built glib, glib-dev, libintl and libiconv binaries
 	* libiconv-1.9.1.bin.woe32.zip
 	* gettext-runtime-0.12.1.bin.woe32.zip
 	* glib-dev-2.2.2.zip
@@ -17,7 +17,7 @@
 5) Copy the prebuilt win32-config.h to c:\loudmouth-0.13.1\config.h
 
 6) Create an empty win32 static lib project in the root of the loudmouth
-   directory 
+   directory
 
 7) Add config.h and all .c and .h files in the loudmouth subdir except
    test-lm.c
@@ -47,5 +47,5 @@
 Required Code Fixes
 -------------------
 lm-connection.c
-	The include line for unistd.h may need to be moved 
+	The include line for unistd.h may need to be moved
 	into the #ifndef __WIN32__ block
--- a/acinclude.m4	Sun Feb 15 15:30:12 2015 +0100
+++ b/acinclude.m4	Sat Oct 31 08:37:51 2015 +0100
@@ -61,7 +61,7 @@
 
 dnl Autoconf macros for libgnutls
 dnl $id$
-                                                                                
+
 dnl AM_PATH_LIBGNUTLS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
 ]]])
 dnl Test for libgnutls, and define LIBGNUTLS_CFLAGS and LIBGNUTLS_LIBS
@@ -73,14 +73,14 @@
 AC_ARG_WITH(libgnutls-prefix,
           [  --with-libgnutls-prefix=PFX   Prefix where libgnutls is installed (optional)],
           libgnutls_config_prefix="$withval", libgnutls_config_prefix="")
-                                                                                
+
   if test x$libgnutls_config_prefix != x ; then
      libgnutls_config_args="$libgnutls_config_args --prefix=$libgnutls_config_prefix"
      if test x${LIBGNUTLS_CONFIG+set} != xset ; then
         LIBGNUTLS_CONFIG=$libgnutls_config_prefix/bin/libgnutls-config
      fi
   fi
-                                                                                
+
   AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, no)
   min_libgnutls_version=ifelse([$1], ,0.1.0,$1)
   AC_MSG_CHECKING(for libgnutls - version >= $min_libgnutls_version)
@@ -91,8 +91,8 @@
     LIBGNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --cflags`
     LIBGNUTLS_LIBS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --libs`
     libgnutls_config_version=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version`
-                                                                                
-                                                                                
+
+
       ac_save_CFLAGS="$CFLAGS"
       ac_save_LIBS="$LIBS"
       CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
@@ -111,7 +111,7 @@
 main ()
 {
     system ("touch conf.libgnutlstest");
-                                                                                
+
     if( strcmp( gnutls_check_version(NULL), "$libgnutls_config_version" ) )
     {
       printf("\n*** 'libgnutls-config --version' returned %s, but LIBGNUTLS (%s)\n",
@@ -159,7 +159,7 @@
        CFLAGS="$ac_save_CFLAGS"
        LIBS="$ac_save_LIBS"
   fi
-                                                                                
+
   if test "x$no_libgnutls" = x ; then
      AC_MSG_RESULT(yes)
      ifelse([$2], , :, [$2])
--- a/configure.ac	Sun Feb 15 15:30:12 2015 +0100
+++ b/configure.ac	Sat Oct 31 08:37:51 2015 +0100
@@ -1,9 +1,9 @@
 AC_PREREQ(2.60)
 AC_INIT([Loudmouth], [1.5.0], [http://loudmouth.lighthouseapp.com/projects/17276-libloudmouth/tickets/new], [loudmouth])
 AC_COPYRIGHT([
-	Copyright (C) 2003-2008 Imendio AB
-	Copyright (C) 2007 Collabora Ltd
-	Copyright (C) 2007 Nokia Corporation
+        Copyright (C) 2003-2008 Imendio AB
+        Copyright (C) 2007 Collabora Ltd
+        Copyright (C) 2007 Nokia Corporation
 ])
 
 AC_CONFIG_SRCDIR(loudmouth/loudmouth.h)
@@ -56,7 +56,7 @@
 
 AM_PATH_GLIB_2_0
 
-AC_CHECK_HEADERS([arpa/inet.h fcntl.h memory.h netdb.h netinet/in.h netinet/in_systm.h stdlib.h string.h sys/socket.h sys/time.h unistd.h]) 
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h memory.h netdb.h netinet/in.h netinet/in_systm.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
 AC_CHECK_HEADERS([winsock2.h arpa/nameser_compat.h])
 
 if test "$ac_cv_header_winsock2_h" = "yes"; then
@@ -90,14 +90,14 @@
 
 LM_CHECK_TIMEZONE
 
-PKG_CHECK_MODULES(LOUDMOUTH, 
+PKG_CHECK_MODULES(LOUDMOUTH,
                   glib-2.0 >= $GLIB2_REQUIRED
                   gobject-2.0 >= $GLIB2_REQUIRED)
 
 PKG_CHECK_MODULES(LOUDMOUTHTEST,
                   glib-2.0 >= $GLIB2_TEST_REQUIRED
                   gobject-2.0 >= $GLIB2_REQUIRED,
-		  enable_test=yes, enable_test=no)
+                  enable_test=yes, enable_test=no)
 if test "$enable_test" = yes; then
   TEST_DIRS=tests
 else
@@ -107,7 +107,7 @@
 
 PKG_CHECK_MODULES(LIBIDN, libidn, have_idn=yes, have_idn=no)
 if test "x$have_idn" = "xyes"; then
-	AC_DEFINE(HAVE_IDN, 1, [Define if IDN support is included])
+        AC_DEFINE(HAVE_IDN, 1, [Define if IDN support is included])
 fi
 
 dnl Gtk doc
@@ -144,10 +144,10 @@
 enable_gssapi=no
 if test "x$KRB5CONFIG" != "xno"
 then
-	AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h])
-	enable_gssapi=yes
-	AC_DEFINE(HAVE_GSSAPI, 1, [whether to use GSSAPI support.])
-	LIBS="$LIBS `$KRB5CONFIG --libs gssapi`"
+        AC_CHECK_HEADERS([gssapi.h gssapi/gssapi.h])
+        enable_gssapi=yes
+        AC_DEFINE(HAVE_GSSAPI, 1, [whether to use GSSAPI support.])
+        LIBS="$LIBS `$KRB5CONFIG --libs gssapi`"
 fi
 AM_CONDITIONAL(USE_GSSAPI, test x$enable_gssapi = xyes)
 
@@ -155,20 +155,20 @@
 dnl | Checking for SSL support                               |-
 dnl +--------------------------------------------------------+
 AC_ARG_WITH(ssl,
-	    AS_HELP_STRING([--with-ssl=@<:@gnutls|openssl|no@:>@], 
-			   [Which SSL implementation to use [[default=gnutls]]]),
-	    ac_ssl=$withval,
-	    ac_ssl=gnutls)
+            AS_HELP_STRING([--with-ssl=@<:@gnutls|openssl|no@:>@],
+                           [Which SSL implementation to use [[default=gnutls]]]),
+            ac_ssl=$withval,
+            ac_ssl=gnutls)
 
 AC_ARG_WITH(openssl-includes,
-	    AC_HELP_STRING([--with-openssl-includes=DIR],[OpenSSL includes]),
-	    [ use_openssl=yes CPPFLAGS="$CPPFLAGS -I$withval" ]
-	    )
+            AC_HELP_STRING([--with-openssl-includes=DIR],[OpenSSL includes]),
+            [ use_openssl=yes CPPFLAGS="$CPPFLAGS -I$withval" ]
+            )
 
 AC_ARG_WITH(openssl-libs,
-	    AC_HELP_STRING([--with-openssl-libs=DIR],[OpenSSL libraries]),
-	    [ use_openssl=yes LDFLAGS="$LDFLAGS -L$withval" ]
-	    )
+            AC_HELP_STRING([--with-openssl-libs=DIR],[OpenSSL libraries]),
+            [ use_openssl=yes LDFLAGS="$LDFLAGS -L$withval" ]
+            )
 
 enable_ssl=no
 if test "x$ac_ssl" = "xgnutls"; then
@@ -182,43 +182,43 @@
     enable_ssl=GnuTLS
   else
     AC_MSG_ERROR([GnuTLS was not found, use
-		--with-ssl=[[no|openssl]] to build without SSL support or
-		with OpenSSL])
+                --with-ssl=[[no|openssl]] to build without SSL support or
+                with OpenSSL])
   fi
 elif test "$ac_ssl" = "openssl"; then
   dnl Look for OpenSSL
   AC_CHECK_HEADERS([openssl/ssl.h])
   OLDLIBS="$LIBS"
-  AC_CHECK_LIB(crypto, 
-	       BIO_f_base64, 
-	       [AC_CHECK_LIB(ssl, 
-		             SSL_new, 
+  AC_CHECK_LIB(crypto,
+               BIO_f_base64,
+               [AC_CHECK_LIB(ssl,
+                             SSL_new,
                              [SSL_LIB="-lssl -lcrypto"
-		             AC_DEFINE(HAVE_OPENSSL, 
-				       [], 
-				       [Have OpenSSL])], 
-		             [have_openssl=no], 
-			     [-lcrypto])], 
-	       [have_openssl=no], 
-	       [])
+                             AC_DEFINE(HAVE_OPENSSL,
+                                       [],
+                                       [Have OpenSSL])],
+                             [have_openssl=no],
+                             [-lcrypto])],
+               [have_openssl=no],
+               [])
 
   if test "x$have_openssl" = "xno"; then
     AC_MSG_ERROR([OpenSSL was not found, use --with-ssl=[[no|gnutls]] to
                   build without SSL support or with GnuTLS])
-  else 
+  else
     LIBS="$OLDLIBS $SSL_LIB"
     enable_ssl=OpenSSL
   fi
 else
-	echo "Disabling SSL support"
+        echo "Disabling SSL support"
 fi
 
 if test x$enable_ssl != xno; then
-	AC_DEFINE(HAVE_SSL, 1, [whether to use SSL support.])
+        AC_DEFINE(HAVE_SSL, 1, [whether to use SSL support.])
 else
-	if test x$ac_ssl != xno; then
-		AC_MSG_ERROR([No SSL implementation was found, if you do not want to build with SSL use --with-ssl=no])
-	fi
+        if test x$ac_ssl != xno; then
+                AC_MSG_ERROR([No SSL implementation was found, if you do not want to build with SSL use --with-ssl=no])
+        fi
 fi
 
 AM_CONDITIONAL(USE_OPENSSL, test x$enable_ssl = xOpenSSL)
@@ -228,23 +228,23 @@
 dnl | Checking for libasyncns                                           |
 dnl +-------------------------------------------------------------------+
 AC_ARG_WITH(asyncns,
-	AS_HELP_STRING([--with-asyncns],
-		[define whether to use libasyncns, @<:@default=no@:>@ (yes/no)]),
-	ac_asyncns=$withval,
-	ac_asyncns=no)
+        AS_HELP_STRING([--with-asyncns],
+                [define whether to use libasyncns, @<:@default=no@:>@ (yes/no)]),
+        ac_asyncns=$withval,
+        ac_asyncns=no)
 
 enable_asyncns=no
 if test x$ac_asyncns != xno; then
 
-	PKG_CHECK_MODULES(ASYNCNS, [libasyncns >= 0.3],
-			[enable_asyncns=yes],
-			[enable_asyncns=no])
+        PKG_CHECK_MODULES(ASYNCNS, [libasyncns >= 0.3],
+                        [enable_asyncns=yes],
+                        [enable_asyncns=no])
 fi
 
 if test "x$enable_asyncns" = "xyes"; then
-	AC_DEFINE(HAVE_ASYNCNS, 1, [Whether to use libasyncns])
+        AC_DEFINE(HAVE_ASYNCNS, 1, [Whether to use libasyncns])
 else
-	echo "Not using asynchronous dns lookups"
+        echo "Not using asynchronous dns lookups"
 fi
 
 AC_SUBST(ASYNCNS_CFLAGS)
@@ -262,8 +262,8 @@
 
 use_keepalives=no
 if test x$ac_use_keepalives != xno; then
-	use_keepalives=yes
-	AC_DEFINE(USE_TCP_KEEPALIVES, 1, [Whether to use Linux TCP keepalives])
+        use_keepalives=yes
+        AC_DEFINE(USE_TCP_KEEPALIVES, 1, [Whether to use Linux TCP keepalives])
 fi
 
 dnl +-------------+
@@ -287,10 +287,10 @@
               enable_debug=yes)
 
 if test x$enable_debug = xno ; then
-	echo "Debugging disabled"
-	LOUDMOUTH_CFLAGS="$LOUDMOUTH_CFLAGS -DLM_NO_DEBUG"
+        echo "Debugging disabled"
+        LOUDMOUTH_CFLAGS="$LOUDMOUTH_CFLAGS -DLM_NO_DEBUG"
 else
-	echo "Debugging enabled"
+        echo "Debugging enabled"
 fi
 
 AC_SUBST(LOUDMOUTH_CFLAGS)
@@ -309,20 +309,20 @@
 dnl ==========================================================================
 echo "
 
-	Loudmouth $VERSION
-	==================
+        Loudmouth $VERSION
+        ==================
 
-	prefix:                   ${prefix}
-	compiler:                 ${CC}
-	Have IDN support:         ${have_idn}
-	Enable SSL:               ${enable_ssl}
-	Asynchronous DNS:         ${enable_asyncns}
-	Linux TCP keepalives:     ${use_keepalives}
-	Enable Debug:             ${enable_debug}
-	Enable GSSAPI:            ${enable_gssapi}
-	Enable Documentation:     ${enable_gtk_doc}
-	Enable Tests:             ${enable_test}
+        prefix:                   ${prefix}
+        compiler:                 ${CC}
+        Have IDN support:         ${have_idn}
+        Enable SSL:               ${enable_ssl}
+        Asynchronous DNS:         ${enable_asyncns}
+        Linux TCP keepalives:     ${use_keepalives}
+        Enable Debug:             ${enable_debug}
+        Enable GSSAPI:            ${enable_gssapi}
+        Enable Documentation:     ${enable_gtk_doc}
+        Enable Tests:             ${enable_test}
 
-	Now type 'make' to build Loudmouth
+        Now type 'make' to build Loudmouth
 "
 
--- a/docs/reference/Makefile.am	Sun Feb 15 15:30:12 2015 +0100
+++ b/docs/reference/Makefile.am	Sat Oct 31 08:37:51 2015 +0100
@@ -26,7 +26,7 @@
 SCANGOBJ_OPTIONS=
 
 # Extra options to supply to gtkdoc-scan.
-# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" 
+# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
 SCAN_OPTIONS=
 
 # Extra options to supply to gtkdoc-mkdb.
@@ -85,4 +85,4 @@
 
 # Other files to distribute
 # e.g. EXTRA_DIST += version.xml.in
-EXTRA_DIST += 
+EXTRA_DIST +=
--- a/docs/reference/loudmouth-docs.sgml	Sun Feb 15 15:30:12 2015 +0100
+++ b/docs/reference/loudmouth-docs.sgml	Sat Oct 31 08:37:51 2015 +0100
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
 <book id="index" xmlns:xi="http://www.w3.org/2001/XInclude">
   <bookinfo>
--- a/examples/lm-change-password.c	Sun Feb 15 15:30:12 2015 +0100
+++ b/examples/lm-change-password.c	Sat Oct 31 08:37:51 2015 +0100
@@ -18,14 +18,14 @@
  * Boston, MA 02111-1307, USA.
  */
 
-/* 
+/*
  * Small tool to change password on an account
  */
 
 #include <loudmouth/loudmouth.h>
 #include <string.h>
 
-static LmSSLResponse 
+static LmSSLResponse
 ssl_func (LmSSL        *ssl,
           LmSSLStatus   status,
           gpointer      user_data)
@@ -40,7 +40,7 @@
              exec_name);
 }
 
-int 
+int
 main (int argc, char **argv)
 {
     LmConnection  *connection;
@@ -54,8 +54,8 @@
     LmMessage     *reply;
     LmMessageNode *query;
     gboolean       use_ssl = FALSE;
-    
-    
+
+
     if (argc < 5) {
         print_usage (argv[0]);
         return -1;
@@ -80,7 +80,7 @@
                 if (++i >= argc) {
                     print_usage (argv[0]);
                     return -1;
-                } 
+                }
 
                 host = argv[i];
                 g_print ("HOST: %s\n", host);
@@ -98,7 +98,7 @@
         lm_connection_set_jid (connection, jid);
         g_free (jid);
     }
-    
+
     if (use_ssl) {
         LmSSL *ssl;
 
@@ -121,17 +121,17 @@
     }
 
     if (!lm_connection_authenticate_and_block (connection,
-                                               username, old_pass, 
+                                               username, old_pass,
                                                "Password changer",
                                                &error)) {
         g_error ("Failed to authenticate: %s\n", error->message);
     }
 
-    m = lm_message_new_with_sub_type (NULL, LM_MESSAGE_TYPE_IQ, 
+    m = lm_message_new_with_sub_type (NULL, LM_MESSAGE_TYPE_IQ,
                                       LM_MESSAGE_SUB_TYPE_SET);
-    
+
     query = lm_message_node_add_child (m->node, "query", NULL);
-    
+
     lm_message_node_set_attributes (query, "xmlns", "jabber:iq:register",
                                     NULL);
     lm_message_node_add_child (query, "username", username);
@@ -140,7 +140,7 @@
     reply = lm_connection_send_with_reply_and_block (connection, m, &error);
     if (!reply) {
         g_error ("Failed to change password: %s\n", error->message);
-    }   
+    }
 
     if (lm_message_get_sub_type (reply) == LM_MESSAGE_SUB_TYPE_RESULT) {
         g_print ("Password changed\n");
@@ -149,7 +149,7 @@
         /* If this wasn't only an example we should check error code
          * here to tell the user why it failed */
     }
-    
+
     lm_connection_close (connection, NULL);
 
     return 0;
--- a/examples/lm-register.c	Sun Feb 15 15:30:12 2015 +0100
+++ b/examples/lm-register.c	Sat Oct 31 08:37:51 2015 +0100
@@ -25,7 +25,7 @@
 #include <loudmouth/loudmouth.h>
 #include <string.h>
 
-static LmSSLResponse 
+static LmSSLResponse
 ssl_func (LmSSL        *ssl,
           LmSSLStatus   status,
           gpointer      user_data)
@@ -106,11 +106,11 @@
     lm_message_node_add_child (query, "username", username);
     lm_message_node_add_child (query, "password", pass);
 
-    reply = lm_connection_send_with_reply_and_block (connection, 
+    reply = lm_connection_send_with_reply_and_block (connection,
                                                      m, &error);
-    
+
     if (!reply) {
-        g_error ("Failed to send registration request: %s\n", 
+        g_error ("Failed to send registration request: %s\n",
                  error->message);
     }
 
@@ -123,7 +123,7 @@
     default:
         g_print ("Failed to register account '%s@%s' due to: ",
                  username, server);
-        
+
         node = lm_message_node_find_child (reply->node, "error");
         if (node) {
             g_print ("%s\n", lm_message_node_get_value (node));
--- a/examples/lm-send-async.c	Sun Feb 15 15:30:12 2015 +0100
+++ b/examples/lm-send-async.c	Sat Oct 31 08:37:51 2015 +0100
@@ -21,7 +21,7 @@
 /*
  * Description:
  * A little program that let you send jabber messages to another person.
- * 
+ *
  * Build instructions:
  * gcc -o lm-send-async `pkg-config --cflags --libs loudmouth-1.0` lm-send-async.c
  */
@@ -45,23 +45,23 @@
 static gchar     *fingerprint = NULL;
 static gchar     *message = "test asynchronous message";
 
-static GOptionEntry entries[] = 
+static GOptionEntry entries[] =
 {
-    { "server", 's', 0, G_OPTION_ARG_STRING, &server, 
+    { "server", 's', 0, G_OPTION_ARG_STRING, &server,
       "Server to connect to", NULL },
-    { "port", 'P', 0, G_OPTION_ARG_INT, &port, 
+    { "port", 'P', 0, G_OPTION_ARG_INT, &port,
       "Port to connect to [default=5222]", NULL },
-    { "username", 'u', 0, G_OPTION_ARG_STRING, &username, 
+    { "username", 'u', 0, G_OPTION_ARG_STRING, &username,
       "Username to connect with (user@server.org)", NULL },
-    { "password", 'p', 0, G_OPTION_ARG_STRING, &password, 
+    { "password", 'p', 0, G_OPTION_ARG_STRING, &password,
       "Password to try", NULL },
-    { "resource", 'r', 0, G_OPTION_ARG_STRING, &resource, 
+    { "resource", 'r', 0, G_OPTION_ARG_STRING, &resource,
       "Resource connect with [default=lm-send-async]", NULL },
-    { "recipient", 'R', 0, G_OPTION_ARG_STRING, &recipient, 
+    { "recipient", 'R', 0, G_OPTION_ARG_STRING, &recipient,
       "Recipient to send the message to (e.g. user@server.org)", NULL },
-    { "fingerprint", 'f', 0, G_OPTION_ARG_STRING, &fingerprint, 
+    { "fingerprint", 'f', 0, G_OPTION_ARG_STRING, &fingerprint,
       "SSL Fingerprint to use", NULL },
-    { "message", 'm', 0, G_OPTION_ARG_STRING, &message, 
+    { "message", 'm', 0, G_OPTION_ARG_STRING, &message,
       "Message to send to recipient [default=test message]", NULL },
     { NULL }
 };
@@ -89,13 +89,13 @@
     for (i = 0; i < size-1; i++) {
         g_printerr ("%02X:", fpr[i]);
     }
-    
+
     g_printerr ("%02X", fpr[size-1]);
 }
 
 static LmSSLResponse
-ssl_cb (LmSSL       *ssl, 
-        LmSSLStatus  status, 
+ssl_cb (LmSSL       *ssl,
+        LmSSLStatus  status,
         gpointer     ud)
 {
     g_print ("LmSendAsync: SSL status:%d\n", status);
@@ -105,20 +105,20 @@
         g_printerr ("LmSendAsync: No certificate found!\n");
         break;
     case LM_SSL_STATUS_UNTRUSTED_CERT:
-        g_printerr ("LmSendAsync: Certificate is not trusted!\n"); 
+        g_printerr ("LmSendAsync: Certificate is not trusted!\n");
         break;
     case LM_SSL_STATUS_CERT_EXPIRED:
-        g_printerr ("LmSendAsync: Certificate has expired!\n"); 
+        g_printerr ("LmSendAsync: Certificate has expired!\n");
         break;
     case LM_SSL_STATUS_CERT_NOT_ACTIVATED:
-        g_printerr ("LmSendAsync: Certificate has not been activated!\n"); 
+        g_printerr ("LmSendAsync: Certificate has not been activated!\n");
         break;
     case LM_SSL_STATUS_CERT_HOSTNAME_MISMATCH:
-        g_printerr ("LmSendAsync: Certificate hostname does not match expected hostname!\n"); 
+        g_printerr ("LmSendAsync: Certificate hostname does not match expected hostname!\n");
         break;
     case LM_SSL_STATUS_CERT_FINGERPRINT_MISMATCH: {
         const char *fpr = lm_ssl_get_fingerprint (ssl);
-        g_printerr ("LmSendAsync: Certificate fingerprint does not match expected fingerprint!\n"); 
+        g_printerr ("LmSendAsync: Certificate fingerprint does not match expected fingerprint!\n");
         g_printerr ("LmSendAsync: Remote fingerprint: ");
         print_finger (fpr, 16);
 
@@ -129,7 +129,7 @@
         break;
     }
     case LM_SSL_STATUS_GENERIC_ERROR:
-        g_printerr ("LmSendAsync: Generic SSL error!\n"); 
+        g_printerr ("LmSendAsync: Generic SSL error!\n");
         break;
     }
 
@@ -137,8 +137,8 @@
 }
 
 static void
-connection_auth_cb (LmConnection *connection, 
-                    gboolean      success, 
+connection_auth_cb (LmConnection *connection,
+                    gboolean      success,
                     gpointer      user_data)
 {
     if (success) {
@@ -146,19 +146,19 @@
         LmMessage *m;
 
         g_print ("LmSendAsync: Authenticated successfully\n");
-        
+
         m = lm_message_new (recipient, LM_MESSAGE_TYPE_MESSAGE);
         lm_message_node_add_child (m->node, "body", message);
-        
+
         if (!lm_connection_send (connection, m, &error)) {
-            g_printerr ("LmSendAsync: Failed to send message:'%s'\n", 
+            g_printerr ("LmSendAsync: Failed to send message:'%s'\n",
                         lm_message_node_to_string (m->node));
         } else {
-            g_print ("LmSendAsync: Sent message:'%s'\n", 
+            g_print ("LmSendAsync: Sent message:'%s'\n",
                      lm_message_node_to_string (m->node));
             test_success = TRUE;
         }
-        
+
         lm_message_unref (m);
     } else {
         g_printerr ("LmSendAsync: Failed to authenticate\n");
@@ -177,9 +177,9 @@
         gchar *user;
 
         user = get_part_name (username);
-        if (!lm_connection_authenticate (connection, user, 
+        if (!lm_connection_authenticate (connection, user,
                                          password, resource,
-                                         connection_auth_cb, 
+                                         connection_auth_cb,
                                          NULL, FALSE,  NULL)) {
             g_free (user);
             g_printerr ("LmSendAsync: Failed to send authentication\n");
@@ -207,7 +207,7 @@
     g_option_context_add_main_entries (context, entries, NULL);
     g_option_context_parse (context, &argc, &argv, NULL);
     g_option_context_free (context);
-    
+
     if (!username || !password || !recipient) {
         g_printerr ("For usage, try %s --help\n", argv[0]);
         return EXIT_FAILURE;
@@ -227,7 +227,7 @@
         LmSSL *ssl;
         char  *p;
         int    i;
-        
+
         if (port == LM_CONNECTION_DEFAULT_PORT) {
             lm_connection_set_port (connection,
                                     LM_CONNECTION_DEFAULT_PORT_SSL);
@@ -236,18 +236,18 @@
         for (i = 0, p = fingerprint; *p && *(p+1); i++, p += 3) {
             expected_fingerprint[i] = (unsigned char) g_ascii_strtoull (p, NULL, 16);
         }
-    
+
         ssl = lm_ssl_new (expected_fingerprint,
                           (LmSSLFunction) ssl_cb,
                           NULL, NULL);
-    
+
         lm_ssl_use_starttls (ssl, TRUE, FALSE);
 
         lm_connection_set_ssl (connection, ssl);
         lm_ssl_unref (ssl);
     }
 
-    if (!lm_connection_open (connection, 
+    if (!lm_connection_open (connection,
                              (LmResultFunction) connection_open_cb,
                              NULL, NULL, NULL)) {
         g_printerr ("LmSendAsync: Could not open a connection\n");
--- a/examples/test-http-proxy.c	Sun Feb 15 15:30:12 2015 +0100
+++ b/examples/test-http-proxy.c	Sat Oct 31 08:37:51 2015 +0100
@@ -17,9 +17,9 @@
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
- 
+
 #include <config.h>
- 
+
 #include <glib.h>
 #include <string.h>
 #include <stdlib.h>
@@ -27,42 +27,42 @@
 #ifdef G_OS_WIN32
 #include <winsock2.h>
 #endif
- 
+
 typedef struct {
     gchar *name;
     gchar *passwd;
 } UserInfo;
- 
+
 static void
 free_user_info (UserInfo *info)
 {
     g_free (info->name);
     g_free (info->passwd);
- 
+
     g_free (info);
 }
- 
- 
+
+
 static void
 authentication_cb (LmConnection *connection, gboolean result, gpointer ud)
 {
     g_print ("Auth: %d\n", result);
     free_user_info ((UserInfo *) ud);
- 
+
     if (result == TRUE) {
         LmMessage *m;
-                 
+
         m = lm_message_new_with_sub_type (NULL,
                                           LM_MESSAGE_TYPE_PRESENCE,
                                           LM_MESSAGE_SUB_TYPE_AVAILABLE);
         g_print (":: %s\n", lm_message_node_to_string (m->node));
-                 
+
         lm_connection_send (connection, m, NULL);
         lm_message_unref (m);
     }
 
 }
- 
+
 static void
 connection_open_cb (LmConnection *connection, gboolean result, UserInfo *info)
 {
@@ -72,7 +72,7 @@
                                 authentication_cb, info, FALSE,  NULL);
     g_print ("Sent auth message\n");
 }
- 
+
 static LmHandlerResult
 handle_messages (LmMessageHandler *handler,
                  LmConnection     *connection,
@@ -81,7 +81,7 @@
 {
     g_print ("Incoming message from: %s\n",
              lm_message_node_get_attribute (m->node, "from"));
- 
+
     return LM_HANDLER_RESULT_REMOVE_MESSAGE;
 }
 int
@@ -92,14 +92,14 @@
     LmMessageHandler *handler;
     gboolean          result;
     UserInfo         *info;
-    LmProxy          *proxy; 
+    LmProxy          *proxy;
     guint             proxy_port;
-                                                                                
+
     if (argc < 6) {
         g_print ("Usage: %s <server> <username> <password> <proxyserver> <proxyport>\n", argv[0]);
         return 1;
     }
-                                                                                
+
     connection = lm_connection_new (argv[1]);
 
     proxy = lm_proxy_new (LM_PROXY_TYPE_HTTP);
@@ -109,31 +109,31 @@
     lm_proxy_set_port (proxy, proxy_port);
     lm_connection_set_proxy (connection, proxy);
     lm_proxy_unref (proxy);
-                                                                                
+
     handler = lm_message_handler_new (handle_messages, NULL, NULL);
     lm_connection_register_message_handler (connection, handler,
                                             LM_MESSAGE_TYPE_MESSAGE,
                                             LM_HANDLER_PRIORITY_NORMAL);
-                                                                                
+
     lm_message_handler_unref (handler);
-                                                                                
+
     info = g_new0 (UserInfo, 1);
     info->name = g_strdup (argv[2]);
     info->passwd = g_strdup (argv[3]);
-                                                                                
+
     result = lm_connection_open (connection,
                                  (LmResultFunction) connection_open_cb,
                                  info, NULL, NULL);
-                                                                                
+
     if (!result) {
         g_print ("Opening connection failed: %d\n", result);
     } else {
         g_print ("Returned from the connection_open\n");
     }
-                                                                                
+
     main_loop = g_main_loop_new (NULL, FALSE);
     g_main_loop_run (main_loop);
-                                                                                
+
     return 0;
 }
 
--- a/examples/test-lm.c	Sun Feb 15 15:30:12 2015 +0100
+++ b/examples/test-lm.c	Sat Oct 31 08:37:51 2015 +0100
@@ -38,19 +38,19 @@
 static gchar     *resource = "test-lm";
 static gchar     *fingerprint = NULL;
 
-static GOptionEntry entries[] = 
+static GOptionEntry entries[] =
 {
-    { "server", 's', 0, G_OPTION_ARG_STRING, &server, 
+    { "server", 's', 0, G_OPTION_ARG_STRING, &server,
       "Server to connect to", NULL },
-    { "port", 'P', 0, G_OPTION_ARG_INT, &port, 
+    { "port", 'P', 0, G_OPTION_ARG_INT, &port,
       "Port to connect to [default=5222]", NULL },
-    { "username", 'u', 0, G_OPTION_ARG_STRING, &username, 
+    { "username", 'u', 0, G_OPTION_ARG_STRING, &username,
       "Username to connect with (user@server.org)", NULL },
-    { "password", 'p', 0, G_OPTION_ARG_STRING, &password, 
+    { "password", 'p', 0, G_OPTION_ARG_STRING, &password,
       "Password to try", NULL },
-    { "resource", 'r', 0, G_OPTION_ARG_STRING, &resource, 
+    { "resource", 'r', 0, G_OPTION_ARG_STRING, &resource,
       "Resource connect with [default=test-lm]", NULL },
-    { "fingerprint", 'f', 0, G_OPTION_ARG_STRING, &fingerprint, 
+    { "fingerprint", 'f', 0, G_OPTION_ARG_STRING, &fingerprint,
       "SSL Fingerprint to use", NULL },
     { NULL }
 };
@@ -78,13 +78,13 @@
     for (i = 0; i < size-1; i++) {
         g_printerr ("%02X:", fpr[i]);
     }
-    
+
     g_printerr ("%02X", fpr[size-1]);
 }
 
 static LmSSLResponse
-ssl_cb (LmSSL       *ssl, 
-        LmSSLStatus  status, 
+ssl_cb (LmSSL       *ssl,
+        LmSSLStatus  status,
         gpointer     ud)
 {
     g_print ("TestLM: SSL status:%d\n", status);
@@ -94,20 +94,20 @@
         g_printerr ("TestLM: No certificate found!\n");
         break;
     case LM_SSL_STATUS_UNTRUSTED_CERT:
-        g_printerr ("TestLM: Certificate is not trusted!\n"); 
+        g_printerr ("TestLM: Certificate is not trusted!\n");
         break;
     case LM_SSL_STATUS_CERT_EXPIRED:
-        g_printerr ("TestLM: Certificate has expired!\n"); 
+        g_printerr ("TestLM: Certificate has expired!\n");
         break;
     case LM_SSL_STATUS_CERT_NOT_ACTIVATED:
-        g_printerr ("TestLM: Certificate has not been activated!\n"); 
+        g_printerr ("TestLM: Certificate has not been activated!\n");
         break;
     case LM_SSL_STATUS_CERT_HOSTNAME_MISMATCH:
-        g_printerr ("TestLM: Certificate hostname does not match expected hostname!\n"); 
+        g_printerr ("TestLM: Certificate hostname does not match expected hostname!\n");
         break;
     case LM_SSL_STATUS_CERT_FINGERPRINT_MISMATCH: {
         const char *fpr = lm_ssl_get_fingerprint (ssl);
-        g_printerr ("TestLM: Certificate fingerprint does not match expected fingerprint!\n"); 
+        g_printerr ("TestLM: Certificate fingerprint does not match expected fingerprint!\n");
         g_printerr ("TestLM: Remote fingerprint: ");
         print_finger (fpr, 16);
 
@@ -118,7 +118,7 @@
         break;
     }
     case LM_SSL_STATUS_GENERIC_ERROR:
-        g_printerr ("TestLM: Generic SSL error!\n"); 
+        g_printerr ("TestLM: Generic SSL error!\n");
         break;
     }
 
@@ -127,12 +127,12 @@
 
 static void
 connection_auth_cb (LmConnection *connection,
-                    gboolean      success, 
+                    gboolean      success,
                     gpointer      user_data)
 {
     if (success) {
         LmMessage *m;
-        
+
         test_success = TRUE;
         g_print ("TestLM: Authenticated successfully\n");
 
@@ -140,7 +140,7 @@
                                           LM_MESSAGE_TYPE_PRESENCE,
                                           LM_MESSAGE_SUB_TYPE_AVAILABLE);
         lm_connection_send (connection, m, NULL);
-        g_print ("TestLM: Sent presence message:'%s'\n", 
+        g_print ("TestLM: Sent presence message:'%s'\n",
                  lm_message_node_to_string (m->node));
 
         lm_message_unref (m);
@@ -151,7 +151,7 @@
 }
 
 static void
-connection_open_cb (LmConnection *connection, 
+connection_open_cb (LmConnection *connection,
                     gboolean      success,
                     gpointer      user_data)
 {
@@ -159,12 +159,12 @@
         gchar *user;
 
         user = get_part_name (username);
-        lm_connection_authenticate (connection, user, 
+        lm_connection_authenticate (connection, user,
                                     password, resource,
-                                    connection_auth_cb, 
+                                    connection_auth_cb,
                                     NULL, FALSE,  NULL);
         g_free (user);
-        
+
         g_print ("TestLM: Sent authentication message\n");
     } else {
         g_printerr ("TestLM: Failed to connect\n");
@@ -173,12 +173,12 @@
 }
 
 static void
-connection_close_cb (LmConnection       *connection, 
+connection_close_cb (LmConnection       *connection,
                      LmDisconnectReason  reason,
                      gpointer            user_data)
 {
     const char *str;
-    
+
     switch (reason) {
     case LM_DISCONNECT_REASON_OK:
         str = "LM_DISCONNECT_REASON_OK";
@@ -213,7 +213,7 @@
     return LM_HANDLER_RESULT_REMOVE_MESSAGE;
 }
 
-int 
+int
 main (int argc, char **argv)
 {
     GOptionContext   *context;
@@ -221,12 +221,12 @@
     LmMessageHandler *handler;
     gboolean          result;
     GError           *error = NULL;
-    
+
     context = g_option_context_new ("- test Loudmouth");
     g_option_context_add_main_entries (context, entries, NULL);
     g_option_context_parse (context, &argc, &argv, NULL);
     g_option_context_free (context);
-    
+
     if (!server || !username || !password) {
         g_printerr ("For usage, try %s --help\n", argv[0]);
         return EXIT_FAILURE;
@@ -247,12 +247,12 @@
     lm_connection_set_jid (connection, username);
 
     handler = lm_message_handler_new (handle_messages, NULL, NULL);
-    lm_connection_register_message_handler (connection, handler, 
-                                            LM_MESSAGE_TYPE_MESSAGE, 
+    lm_connection_register_message_handler (connection, handler,
+                                            LM_MESSAGE_TYPE_MESSAGE,
                                             LM_HANDLER_PRIORITY_NORMAL);
-    
+
     lm_message_handler_unref (handler);
-    
+
     lm_connection_set_disconnect_function (connection,
                                            connection_close_cb,
                                            NULL, NULL);
@@ -261,7 +261,7 @@
         LmSSL *ssl;
         char  *p;
         int    i;
-        
+
         if (port == LM_CONNECTION_DEFAULT_PORT) {
             lm_connection_set_port (connection,
                                     LM_CONNECTION_DEFAULT_PORT_SSL);
@@ -270,13 +270,13 @@
         for (i = 0, p = fingerprint; *p && *(p+1); i++, p += 3) {
             expected_fingerprint[i] = (unsigned char) g_ascii_strtoull (p, NULL, 16);
         }
-    
+
         ssl = lm_ssl_new (expected_fingerprint,
                           (LmSSLFunction) ssl_cb,
                           NULL, NULL);
 
         lm_ssl_use_starttls (ssl, TRUE, FALSE);
-    
+
         lm_connection_set_ssl (connection, ssl);
         lm_ssl_unref (ssl);
     }
@@ -286,12 +286,12 @@
                                  NULL, NULL, &error);
 
     if (!result) {
-        g_printerr ("TestLM: Opening connection failed, error:%d->'%s'\n", 
+        g_printerr ("TestLM: Opening connection failed, error:%d->'%s'\n",
                     error->code, error->message);
         g_free (error);
         return EXIT_FAILURE;
     }
-    
+
     main_loop = g_main_loop_new (NULL, FALSE);
     g_main_loop_run (main_loop);
 
--- a/examples/test-tunnel.c	Sun Feb 15 15:30:12 2015 +0100
+++ b/examples/test-tunnel.c	Sat Oct 31 08:37:51 2015 +0100
@@ -17,9 +17,9 @@
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
- 
+
 #include <config.h>
- 
+
 #include <glib.h>
 #include <string.h>
 #include <stdlib.h>
@@ -27,42 +27,42 @@
 #ifdef __WIN32__
 #include <winsock2.h>
 #endif
- 
+
 typedef struct {
     gchar *name;
     gchar *passwd;
 } UserInfo;
- 
+
 static void
 free_user_info (UserInfo *info)
 {
     g_free (info->name);
     g_free (info->passwd);
- 
+
     g_free (info);
 }
- 
- 
+
+
 static void
 authentication_cb (LmConnection *connection, gboolean result, gpointer ud)
 {
     g_print ("Auth: %d\n", result);
     free_user_info ((UserInfo *) ud);
- 
+
     if (result == TRUE) {
         LmMessage *m;
-                 
+
         m = lm_message_new_with_sub_type (NULL,
                                           LM_MESSAGE_TYPE_PRESENCE,
                                           LM_MESSAGE_SUB_TYPE_AVAILABLE);
         g_print (":: %s\n", lm_message_node_to_string (m->node));
-                 
+
         lm_connection_send (connection, m, NULL);
         lm_message_unref (m);
     }
 
 }
- 
+
 static void
 connection_open_cb (LmConnection *connection, gboolean result, UserInfo *info)
 {
@@ -72,7 +72,7 @@
                                 authentication_cb, info, FALSE,  NULL);
     g_print ("Sent auth message\n");
 }
- 
+
 static LmHandlerResult
 handle_messages (LmMessageHandler *handler,
                  LmConnection     *connection,
@@ -81,7 +81,7 @@
 {
     g_print ("Incoming message from: %s\n",
              lm_message_node_get_attribute (m->node, "from"));
- 
+
     return LM_HANDLER_RESULT_REMOVE_MESSAGE;
 }
 int
@@ -93,12 +93,12 @@
     gboolean          result;
     UserInfo         *info;
     gchar            *jid;
-                                                                                
+
     if (argc < 6) {
         g_print ("Usage: %s <server> <username> <password> <connectserver> <connectport>\n", argv[0]);
         return 1;
     }
-                                                                                
+
     connection = lm_connection_new (argv[4]);
 
     jid = g_strdup_printf ("%s@%s", argv[2], argv[1]);
@@ -111,26 +111,26 @@
     lm_connection_register_message_handler (connection, handler,
                                             LM_MESSAGE_TYPE_MESSAGE,
                                             LM_HANDLER_PRIORITY_NORMAL);
-                                                                                
+
     lm_message_handler_unref (handler);
-                                                                                
+
     info = g_new0 (UserInfo, 1);
     info->name = g_strdup (argv[2]);
     info->passwd = g_strdup (argv[3]);
-                                                                                
+
     result = lm_connection_open (connection,
                                  (LmResultFunction) connection_open_cb,
                                  info, NULL, NULL);
-                                                                                
+
     if (!result) {
         g_print ("Opening connection failed: %d\n", result);
     } else {
         g_print ("Returned from the connection_open\n");
     }
-                                                                                
+
     main_loop = g_main_loop_new (NULL, FALSE);
     g_main_loop_run (main_loop);
-                                                                                
+
     return 0;
 }
 
--- a/loudmouth/lm-error.h	Sun Feb 15 15:30:12 2015 +0100
+++ b/loudmouth/lm-error.h	Sat Oct 31 08:37:51 2015 +0100
@@ -42,7 +42,7 @@
  * @LM_ERROR_CONNECTION_OPEN: Connection is already open when trying to open it again.
  * @LM_ERROR_AUTH_FAILED: Authentication failed while opening connection
  * @LM_ERROR_CONNECTION_FAILED:
- * 
+ *
  * Describes the problem of the error.
  */
 typedef enum {
--- a/loudmouth/lm-old-socket.c	Sun Feb 15 15:30:12 2015 +0100
+++ b/loudmouth/lm-old-socket.c	Sat Oct 31 08:37:51 2015 +0100
@@ -953,7 +953,7 @@
     data = socket->connect_data;
     if (data) {
         if (data->io_channel) {
-	    socket_close_io_channel (data->io_channel);
+            socket_close_io_channel (data->io_channel);
         }
         socket->connect_data = NULL;
         g_free (data);
--- a/loudmouth/lm-parser.c	Sun Feb 15 15:30:12 2015 +0100
+++ b/loudmouth/lm-parser.c	Sat Oct 31 08:37:51 2015 +0100
@@ -188,8 +188,8 @@
             if (parser->function) {
                 (* parser->function) (parser, m, parser->user_data);
             }
-	    lm_message_unref (m);
-	}
+            lm_message_unref (m);
+        }
 
         lm_message_node_unref (parser->cur_root);
         parser->cur_node = parser->cur_root = NULL;
--- a/loudmouth/lm-sasl.c	Sun Feb 15 15:30:12 2015 +0100
+++ b/loudmouth/lm-sasl.c	Sat Oct 31 08:37:51 2015 +0100
@@ -153,7 +153,7 @@
     guint32         major_status;
     guint32         minor_status;
 
-    token.value	= g_strdup_printf ("xmpp@%s", sasl->server);
+    token.value        = g_strdup_printf ("xmpp@%s", sasl->server);
     token.length = strlen ((char *)token.value);
 
     if (token.value == NULL) {
--- a/loudmouth/lm-sock.c	Sun Feb 15 15:30:12 2015 +0100
+++ b/loudmouth/lm-sock.c	Sat Oct 31 08:37:51 2015 +0100
@@ -209,7 +209,7 @@
                     socklen_t *len)
 {
     if (getsockopt (sock, SOL_SOCKET, SO_ERROR, (void*) error, len) != 0)
-	*((int *) error) = errno;
+        *((int *) error) = errno;
 }
 
 const gchar *
--- a/loudmouth/lm-ssl-base.c	Sun Feb 15 15:30:12 2015 +0100
+++ b/loudmouth/lm-ssl-base.c	Sat Oct 31 08:37:51 2015 +0100
@@ -60,7 +60,7 @@
 
 void
 _lm_ssl_base_set_ca_path (LmSSLBase   *base,
-			  const gchar *ca_path)
+                          const gchar *ca_path)
 {
     if (base->ca_path)
         g_free (base->ca_path);
--- a/loudmouth/lm-ssl-base.h	Sun Feb 15 15:30:12 2015 +0100
+++ b/loudmouth/lm-ssl-base.h	Sat Oct 31 08:37:51 2015 +0100
@@ -50,7 +50,7 @@
                                    const gchar *cipher_list);
 
 void _lm_ssl_base_set_ca_path (LmSSLBase   *base,
-			       const gchar *ca_path);
+                               const gchar *ca_path);
 
 void _lm_ssl_base_free_fields  (LmSSLBase      *base);
 
--- a/loudmouth/lm-ssl-internals.h	Sun Feb 15 15:30:12 2015 +0100
+++ b/loudmouth/lm-ssl-internals.h	Sat Oct 31 08:37:51 2015 +0100
@@ -33,7 +33,7 @@
 
 void             _lm_ssl_initialize       (LmSSL            *ssl);
 gboolean         _lm_ssl_set_ca           (LmSSL            *ssl,
-					   const gchar    *ca_path);
+                                           const gchar    *ca_path);
 gboolean         _lm_ssl_begin            (LmSSL            *ssl,
                                            gint              fd,
                                            const gchar      *server,
--- a/loudmouth/lm-ssl-openssl.c	Sun Feb 15 15:30:12 2015 +0100
+++ b/loudmouth/lm-ssl-openssl.c	Sat Oct 31 08:37:51 2015 +0100
@@ -221,7 +221,7 @@
         if (domain != NULL) {
 
             if ((cn[0] == '*') && (cn[1] == '.')) {
-                /* 
+                /*
                  * FWB: huh? ever tested?
                  * server="sub.domain.tld";
                  * cn="*.domain.tld";
@@ -231,19 +231,19 @@
                 server = strchr(server, '.') + 1;
                 domain = cn + 2;
             }
-    
+
             if (strncasecmp (server, domain, LM_SSL_CN_MAX) != 0) {
                 /* FWB: CN doesn't match, try SANs */
                 int subject_alt_names_nb = -1;
                 int san_result = 0;
                 int san_counter;
                 STACK_OF(GENERAL_NAME) *subject_alt_names = NULL;
-    
+
                 /* g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SSL, "%s: CN does not match server name\n", __FILE__); */
                 // Try to extract the names within the SAN extension from the certificate
                 subject_alt_names = X509_get_ext_d2i((X509 *) srv_crt, NID_subject_alt_name, NULL, NULL);
                 if (subject_alt_names != NULL) {
-    
+
                     // Check each name within the extension
                     subject_alt_names_nb = sk_GENERAL_NAME_num(subject_alt_names);
                     for (san_counter=0; san_counter<subject_alt_names_nb; san_counter++) {
@@ -258,7 +258,7 @@
                             }
                         }
                     }
-    
+
                 }
                 sk_GENERAL_NAME_pop_free(subject_alt_names, GENERAL_NAME_free);
                 if (!san_result) goto cn_and_san_mismatch;
@@ -380,14 +380,14 @@
 
 gboolean
 _lm_ssl_set_ca (LmSSL       *ssl,
-		const gchar *ca_path)
+                const gchar *ca_path)
 {
     struct stat target;
     int success = 0;
 
     if (stat (ca_path, &target) != 0) {
         g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SSL,
-	       "ca_path '%s': no such file or directory", ca_path);
+               "ca_path '%s': no such file or directory", ca_path);
         return FALSE;
     }
 
@@ -398,9 +398,9 @@
     }
     if (success == 0) {
         g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SSL,
-	       "Loading of ca_path '%s' failed: %s",
-	       ca_path,
-	       ERR_error_string(ERR_peek_last_error(), NULL));
+               "Loading of ca_path '%s' failed: %s",
+               ca_path,
+               ERR_error_string(ERR_peek_last_error(), NULL));
         return FALSE;
     }
 
--- a/loudmouth/lm-ssl.h	Sun Feb 15 15:30:12 2015 +0100
+++ b/loudmouth/lm-ssl.h	Sat Oct 31 08:37:51 2015 +0100
@@ -127,7 +127,7 @@
                                               const gchar    *cipher_list);
 
 void                  lm_ssl_set_ca          (LmSSL *ssl,
-					      const gchar    *ca_path);
+                                              const gchar    *ca_path);
 
 const gchar *         lm_ssl_get_fingerprint (LmSSL          *ssl);
 
--- a/tests/Makefile.am	Sun Feb 15 15:30:12 2015 +0100
+++ b/tests/Makefile.am	Sat Oct 31 08:37:51 2015 +0100
@@ -3,7 +3,7 @@
 SUBDIRS = parser-tests
 
 noinst_PROGRAMS = $(TEST_PROGS)
-TEST_PROGS = 
+TEST_PROGS =
 
 TEST_PROGS += test-parser                       \
 			  test-data-objects
--- a/tests/test-data-objects.c	Sun Feb 15 15:30:12 2015 +0100
+++ b/tests/test-data-objects.c	Sat Oct 31 08:37:51 2015 +0100
@@ -27,12 +27,12 @@
 test_auth_parameters ()
 {
     LmAuthParameters *params;
-    
+
     params = lm_auth_parameters_new ("my_user", "my_pass", "my_resource");
     g_assert (g_strcmp0 ("my_user", lm_auth_parameters_get_username (params)) == 0);
     g_assert (g_strcmp0 ("my_pass", lm_auth_parameters_get_password (params)) == 0);
     g_assert (g_strcmp0 ("my_resource", lm_auth_parameters_get_resource (params)) == 0);
-    
+
     lm_auth_parameters_unref (params);
 }
 
@@ -40,16 +40,16 @@
 test_connect_parameters ()
 {
     LmConnectParameters *params;
-    
+
     params = lm_connect_parameters_new ("my_domain", "my_host", 5223);
     g_assert (g_strcmp0 ("my_domain", lm_connect_parameters_get_domain (params)) == 0);
     g_assert (g_strcmp0 ("my_host", lm_connect_parameters_get_host (params)) == 0);
     g_assert (5223 == lm_connect_parameters_get_port (params));
-    
+
     lm_connect_parameters_unref (params);
 }
 
-int 
+int
 main (int argc, char **argv)
 {
     g_test_init (&argc, &argv, NULL);
--- a/tests/test-parser.c	Sun Feb 15 15:30:12 2015 +0100
+++ b/tests/test-parser.c	Sat Oct 31 08:37:51 2015 +0100
@@ -24,13 +24,13 @@
 #include "loudmouth/lm-parser.h"
 
 static GSList *
-get_files (const gchar *prefix) 
+get_files (const gchar *prefix)
 {
     GSList      *list = NULL;
     GError      *error = NULL;
     GDir        *dir;
     const gchar *name;
-    
+
     dir = g_dir_open (PARSER_TEST_DIR, 0, &error);
 
     if (!dir) {
@@ -40,7 +40,7 @@
 
         return NULL;
     }
-    
+
 
     while ((name = g_dir_read_name (dir))) {
         /* Find *.xml */
@@ -49,7 +49,7 @@
             g_str_has_suffix (name, ".xml")) {
             gchar *file_path;
 
-            file_path = g_strconcat (PARSER_TEST_DIR, "/", name, 
+            file_path = g_strconcat (PARSER_TEST_DIR, "/", name,
                                      NULL);
 
             list = g_slist_prepend (list, file_path);
@@ -72,14 +72,14 @@
 
     parser = lm_parser_new (NULL, NULL, NULL);
     if (!g_file_get_contents (file_path,
-                              &file_contents, &length, 
+                              &file_contents, &length,
                               &error)) {
         g_error ("Couldn't read file '%s': %s",
                  file_path, error->message);
         g_clear_error (&error);
         return;
     }
-        
+
     g_assert (lm_parser_parse (parser, file_contents) == is_valid);
     lm_parser_free (parser);
     g_free (file_contents);
@@ -111,11 +111,11 @@
     g_slist_free (list);
 }
 
-int 
+int
 main (int argc, char **argv)
 {
     g_test_init (&argc, &argv, NULL);
-    
+
     g_test_add_func ("/parser/valid_suite", test_valid_suite);
     g_test_add_func ("/parser/invalid/suite", test_invalid_suite);