summaryrefslogtreecommitdiff
path: root/net-libs/loudmouth
diff options
context:
space:
mode:
Diffstat (limited to 'net-libs/loudmouth')
-rw-r--r--net-libs/loudmouth/Manifest19
-rw-r--r--net-libs/loudmouth/files/loudmouth-1.4.3-async-fix.patch30
-rw-r--r--net-libs/loudmouth/files/loudmouth-1.4.3-asyncns-system.patch83
-rw-r--r--net-libs/loudmouth/files/loudmouth-1.4.3-drop-stanzas-on-fail.patch47
-rw-r--r--net-libs/loudmouth/files/loudmouth-1.4.3-fix-sasl-md5-digest-uri.patch24
-rw-r--r--net-libs/loudmouth/files/loudmouth-1.4.3-free-before-closed.patch137
-rw-r--r--net-libs/loudmouth/files/loudmouth-1.4.3-glib-2.32.patch13
-rw-r--r--net-libs/loudmouth/files/loudmouth-1.4.3-gnutls28.patch15
-rw-r--r--net-libs/loudmouth/files/loudmouth-1.4.3-id-tag-in-opening-headers.patch35
-rw-r--r--net-libs/loudmouth/files/loudmouth-1.4.3-invalid-unicode.patch144
-rw-r--r--net-libs/loudmouth/files/loudmouth-1.4.3-silence-chdir.patch33
-rw-r--r--net-libs/loudmouth/loudmouth-1.4.3-r2.ebuild95
-rw-r--r--net-libs/loudmouth/loudmouth-1.5.2-r1.ebuild57
-rw-r--r--net-libs/loudmouth/loudmouth-1.5.3.ebuild57
-rw-r--r--net-libs/loudmouth/metadata.xml15
15 files changed, 804 insertions, 0 deletions
diff --git a/net-libs/loudmouth/Manifest b/net-libs/loudmouth/Manifest
new file mode 100644
index 000000000000..f2033018e4b8
--- /dev/null
+++ b/net-libs/loudmouth/Manifest
@@ -0,0 +1,19 @@
+AUX loudmouth-1.4.3-async-fix.patch 971 SHA256 3d5bf6f38c0f6bfff1e3f1ac2dc3becac55e48f44760c7296a230658b2f8dd65 SHA512 56e76c103fb09766654c3d9e639420446dd184fcf8afbe191adf557fe91ef95873b7ef43cb3f72042e97b88cfca31475333f2dfe5731a09211850d34c32dc224 WHIRLPOOL b1db9a346fbf87af3260ebf7b08a550f6b1b64c80e2fc230ac7819479686939c641ac2222b8e49de84ec3bb0a4ec4da3bc639239f2b48e0be7c93533f0b0ce1b
+AUX loudmouth-1.4.3-asyncns-system.patch 2597 SHA256 80c853318b7e7111682128361acace88b496fa4b5b360d618762eb8aec1bde09 SHA512 afa6ac993f79a6e9d97f2a7d456d9b5c2052d90c97061c31c1ae74dbc687da305c55adadfc379c972811fdee1fa083287ce139bfcd1090d3c0b730edb0390550 WHIRLPOOL cb556011c2f975f69e419d8ef9999f2e5de65b71f0beada6168a954b922da06b35522d5debe3564d09517ca8cd89123eadce1fea97632fde016d8331709abde6
+AUX loudmouth-1.4.3-drop-stanzas-on-fail.patch 1413 SHA256 9bc2a0e7bf84c904f78e5d8ddf06a2c61214bae935ae3e498a690945040394d0 SHA512 95c0fdbf0558487fca53d207ce742b89f5d5fdf77c089369e80daa1541bca9bd9f28fd69b61f4e7379aac917dd6be26e47054b4571b7ccbbca26e91f11a2eb8d WHIRLPOOL b5e9611aa5a9ee346c2e923840628cb6f58ea87bb2be78e86ae00356e8a9d68b2d425dd36e44dd1ee20f836085ed733af8f985f397e15614802f14c39b31b1a7
+AUX loudmouth-1.4.3-fix-sasl-md5-digest-uri.patch 794 SHA256 d5aadd091a826597e8f9bdbe413de70093f92aa734c7888840f7314de7dae978 SHA512 050351557d5fdc62777e8e53e07bd36d805b7bbfae23f9034e41a2a3a06696281f2149b19614fb33a5e10a890d7f16d60c3f6ee0b280956d2985eb7f69f6be5b WHIRLPOOL 0c570a9b7b6ffad76ca60d6af1de1dd62e03dd075ae63d57586ba6e260e93ad26bc115b60fa0853800fbc7c9d7ef4a353007fd1224b0502fb394f3fcc21c6f31
+AUX loudmouth-1.4.3-free-before-closed.patch 4536 SHA256 04330ca3dc6619eed8017eef8604ec10e28e199e0dc02be2943fd48de7d1c568 SHA512 117740b701318241c27942413488833d8051f673800c542c63ba4cd772db59a4a94dc005d2c5bfd2eff5c132a6a147608077c70cc27d17f987f5a53ab76adf90 WHIRLPOOL 0027e3a57fa446d29d7302880518af4ac0217918bafa123aac528f8f18ac63da83ce61daf1e09a00e66ed7c9dff57873863d4b8d83c9dfc164ac33934b9a9eb9
+AUX loudmouth-1.4.3-glib-2.32.patch 320 SHA256 def4b793893dcbd25359dfb39d3757ab3279b56d026aa713a829e477bb351f83 SHA512 775d35df42e5b8f571bcdaae179c3eb0a2e720825f515139a762d4e7b9a7136245d8186e82e9f5bf171851bc8b8f57a01d872929b0be52317aeb0b0e39d972e6 WHIRLPOOL 2216bee8504ba551cf3c08dcce11e5c5c5767005508804612f082a8820f01e304227176d01a0b027b7b35585f40ecb6f47ec7e8db83828de764b5e864e0d4f91
+AUX loudmouth-1.4.3-gnutls28.patch 703 SHA256 6b74102efa1673fd57fbad52682cd002e4676768c5a8eb49c489f5618727b275 SHA512 6e1a6604fcda0b8423ecc56bdd08183c331b0c918811979ac10b2a9a3c2b58eb33c120e38a40659654b1ee4daf2f47c7e47352a7167a13db3ccd97397010cde3 WHIRLPOOL 88fe01564ab870cf1ffc93f63c0b2b0f094ca1c936a0489a9d7793dab637d31fc726905d0799cf5bbc1edba93035e8b7b3cdcb642d1036b3a41958c70fa60657
+AUX loudmouth-1.4.3-id-tag-in-opening-headers.patch 1144 SHA256 02ae7062fa8bd5dc0ce21b973b8f3d25d04740c9dd8952e46d4200bfe393f13f SHA512 f4207619acf0ed3a6cda381eac7ec8aeeac06e94019ed5883a2d1976705afbe02cfb6a2ad99ab35580d710fcc53c7646b378cae23f1c454daf7a922596b8d02d WHIRLPOOL 6c252862fa85689b0ba7a1a6a1ae522161eeb7234140ebc685f425c13ab9ac9b74108a3ca89aa769d8269688084654af04396c7fabfc470eab95501733b36159
+AUX loudmouth-1.4.3-invalid-unicode.patch 4085 SHA256 1dd5eb99c8ce01ed98b0c01bb3b5494a84ac9382f0687669755ee40b0ffdbc0e SHA512 c622f19321f4316a13608c14e6b3ddc0c9bd1aa8668a08557dc5791c6d157224285d240696ee6b2ca9868cabb8f73bd764be00dcddcb7fffd2949d757bfbb77c WHIRLPOOL 5d963e7220909924882cfcce1b428c96728d45503e29b9783e471682e45ba6a22c89ef14f5f3379216de135329d44a8e120d8baeceb02357eea655f0db4c87bd
+AUX loudmouth-1.4.3-silence-chdir.patch 891 SHA256 663edc91b0a0e996d665334c132df7f7003033ded5e52e29461601eccc5ffdd0 SHA512 9fb9c7af6ee0cf82ad667949e73dff0688b0cd3cc1b47fa38ff2bd9b57ded8e7ca8d79d15597ef06257b1e34e77a47f3e490b133dbd23b30dfed43c5205bc450 WHIRLPOOL de9ef2a27c348099cdc16b66d45da209cf1434ad067d99f3bba786b734e8f317d4a11de9908c22b045a00a85faae2e935dc93c04c7547749f5eb3d66b7e79605
+DIST loudmouth-1.4.3.tar.bz2 366818 SHA256 95a93f5d009b71ea8193d994aa11f311bc330a3efe1b7cd74dc48f11c7f929e3 SHA512 02d1de14a4d626a4c9100bd24c06d4b4203eabb0f95bab40ee18ea5e68ed81d47aa977625140157b2d9f7974ac748af857c2ee3a916f0db700e2a2d0934940ec WHIRLPOOL 4f9e3e8e4f2fd0a36996e84deebeb26c789d5334af11a3d6cc6c742b59508945a6279715f6fbb02bbbc04a0d9709e7aae4cc39803b2a60acfd47d76f0482f969
+DIST loudmouth-1.5.2.tar.gz 115940 SHA256 c3dd7b5690a7b6ee4768d71d2bdee4615cfb73b6eeaa342d6a931a5160e47421 SHA512 54c3eb7ef99604d7e2d5560dc6e5be176a188e6a0d82ae6c2f488e30f06553039aa03d6f818cec25f354479a2624f60f2233d7e63b54f331e934d554de9bfc87 WHIRLPOOL 99fd7fa00f08976242313c2bc11e9edfbe1aeea9918090347a1975d5ece438892afbf3b5c16ffe79b1c0a10b28f35f62937d45a234e63b26f051466799fd7685
+DIST loudmouth-1.5.3.tar.gz 114676 SHA256 12972fcffd9bbcc4a3b2b9fbf4b0e549f7b4caf0f11c8d2af2059087ce4e8792 SHA512 afae8b4ad1e9e5558cffa8f6b9f25331b01cfa09ea0b3defb74cac7d39477744e6d9181d3adefe242038020759df43558de0e61305fbc8e12a3b293b82856bf7 WHIRLPOOL 0a7d4a01ec4f0ae68f58f3267aabc2eb9f7eb0e812232a8ecd3664dd5c99ae404c4825bb5ae01f36a1cced48a9aaff67c4a92c23541e2e1fd9f69c4a67962007
+EBUILD loudmouth-1.4.3-r2.ebuild 2498 SHA256 df24c25a75f01711e7c1260ee09bbd383dce86b6e18c2241f0a8fccdef573e53 SHA512 2d0122e816ce11214c6ee00641535d0d9148c1412ee660fb361930e4cea95bf4866fbd68e340c57ec593afc94487a0aaeb1160ee1aff69a41f87138245cf7f4f WHIRLPOOL a9e1c8e8c2ba49b95c8f43b170bdab29288d176b01bfb50878cc36ab9df9ec0425be5808c9495ee76f841fc6e9550ef0e23002c2966827e1fe3430e23907607d
+EBUILD loudmouth-1.5.2-r1.ebuild 1165 SHA256 823877bbd602976e8df023dc4a997cf16d3b208719254f391a3a26dd829ab23a SHA512 7b536b1265090ac5d7bcb6d2460550a36fba4306a964feb5e54c37322187def0e566a85a977d86b6f3be1d6e34e2c3d2de6a988f3e278c26beec280378b15e3c WHIRLPOOL 44b08f38277ba84e0407f992ea1dd7774086b01dd39b60bb48065fa36edf362a2edd941068f781e10060b2c4d574ed0ef506d680e55c458ed32f3c4f37ec9318
+EBUILD loudmouth-1.5.3.ebuild 1166 SHA256 487caf946da6057b07075c3a9fc105bd747a8ababc75dda3b59786f7b5958a6e SHA512 7257a30439d6a17b92a04443405ea7ae10b83ad2621a411f25e1e6d593e8252a07012a5ded42d2645c39d45c9494b137fb77585c7bd47379ce128886f6e6ecd1 WHIRLPOOL 183d80e39a847257bcd2805ede690686d9dc0696ba5c1245913930e53b3ab1ef3466a28e1dbfc50c33a76af0509b16fb9c89dd5a601ff86151243abc360b3916
+MISC ChangeLog 4063 SHA256 863df6afc9f522b1f1a4af210e924437080027d82fca2fb2de38946af8e25160 SHA512 25144a9ded7506ae171913e1c1c945c19a88c27eafca6b9874ff18bdd42153b5b6cd256c3a97bf45b5f58d0542161fc4a51a971e356d13b9379f0f4878a14e96 WHIRLPOOL 2ff7e6f2b309b0517d07f873f18052654149d20c7083b3402d6ded7a690334b001e4451a6d40e8d83310fa9b10a94eda56b0baaf47c22c331c11aeda8a3f4a79
+MISC ChangeLog-2015 15204 SHA256 5feb983262f60ea734d8e4c754d13a37fbd8c12750d047fa362420a1875e3cfb SHA512 e71849c239afca32e7cbd4939905806252dab8af6a67751b480116bfb5f0dd06da4e8fd8f6ee4f1b02ab49431ac71904c0cfcb58e6bcbbc96bd110ec1fdf9a97 WHIRLPOOL 89cf0a8db229015f6478357e445a11201b595ac5e2adfc32c9e3a94309d4258a6c7191e3eac02ae07518bef9256485b4a7cdde414bd06a4ad167504c31f0c968
+MISC metadata.xml 561 SHA256 b65de9de3ee37d6bfb3e23896b647280ac08b00def14b43f04074adf9e34f06f SHA512 69e89d7b5ffc2045a760a8b094bdc6fd230c10539550f9c0efb657a480bdee487f3e6cd5c87b2e037a1b1078274ebaa25efde6535aed4dfe57876a60a2faf4aa WHIRLPOOL d3b03581e0403002d3b60dbd3785d302eff63f95ac55dee8b7ddb80713c17195de3ed67a4c199e7f5d2b273aa40ddc7349f6dc5436dfc71e17a52320f62477cd
diff --git a/net-libs/loudmouth/files/loudmouth-1.4.3-async-fix.patch b/net-libs/loudmouth/files/loudmouth-1.4.3-async-fix.patch
new file mode 100644
index 000000000000..3213d72865aa
--- /dev/null
+++ b/net-libs/loudmouth/files/loudmouth-1.4.3-async-fix.patch
@@ -0,0 +1,30 @@
+--- a/loudmouth/lm-socket.c
++++ b/loudmouth/lm-socket.c
+@@ -1022,7 +1022,7 @@ _lm_socket_create_phase2 (LmSocket *socket, struct addrinfo *ans)
+ if (socket->connect_func) {
+ (socket->connect_func) (socket, FALSE, socket->user_data;
+ }
+- g_free (socket->connect_data);
++ g_free (socket->connect_data);
+ socket->connect_data = NULL;
+ return;
+ }
+@@ -1107,6 +1107,10 @@ lm_socket_create (GMainContext *context,
+ _lm_socket_create_phase1 (socket, NULL, 0);
+ }
+
++#ifndef HAVE_ASYNCNS
++ /* Only do this check if we are not using asyncns or it will crash.
++ * Report and patch by Senko.
++ */
+ if (socket->connect_data == NULL) {
+ /* Open failed synchronously, probably a DNS lookup problem */
+ lm_socket_unref(socket);
+@@ -1118,6 +1122,7 @@ lm_socket_create (GMainContext *context,
+
+ return NULL;
+ }
++#endif /* HAVE_ASYNCNS */
+
+
+ /* If the connection fails synchronously, we don't want to call the
diff --git a/net-libs/loudmouth/files/loudmouth-1.4.3-asyncns-system.patch b/net-libs/loudmouth/files/loudmouth-1.4.3-asyncns-system.patch
new file mode 100644
index 000000000000..9cf5345e558d
--- /dev/null
+++ b/net-libs/loudmouth/files/loudmouth-1.4.3-asyncns-system.patch
@@ -0,0 +1,83 @@
+diff --git a/configure.ac b/configure.ac
+index 9369e55..17a9e1d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -199,19 +199,31 @@ AM_CONDITIONAL(USE_GNUTLS, test x$enable_ssl = xGnuTLS)
+ dnl +-------------------------------------------------------------------+
+ dnl | Checking for libasyncns |
+ dnl +-------------------------------------------------------------------+
+-AC_ARG_WITH(asyncns, [ --with-asyncns=yes/no define whether to use libasyncns, default=no],
+- ac_asyncns=$withval,
+- ac_asyncns=no
+- )
++AC_ARG_WITH(asyncns,
++ AS_HELP_STRING([--with-asyncns],
++ [define whether to use libasyncns, @<:@default=no@:>@ (internal/system/no)]),
++ ac_asyncns=$withval,
++ ac_asyncns=no)
+
+ enable_asyncns=no
++have_asyncns_system=no
+ if test x$ac_asyncns != xno; then
+ enable_asyncns=yes
+ AC_DEFINE(HAVE_ASYNCNS, 1, [Whether to use libasyncns])
++
++ if test x$ac_asyncns = xsystem; then
++ PKG_CHECK_MODULES(ASYNCNS, [libasyncns >= 0.3],
++ [have_asyncns_system=yes],
++ [have_asyncns_system=no])
++ fi
+ else
+ echo "Not using asynchronous dns lookups"
+ fi
+
++AC_SUBST(ASYNCNS_CFLAGS)
++AC_SUBST(ASYNCNS_LIBS)
++AM_CONDITIONAL(USE_SYSTEM_ASYNCNS, test x$have_asyncns_system = xyes)
++
+ dnl +-------------------------------------------------------------------+
+ dnl | Checking for Linux TCP/IP stack |
+ dnl +-------------------------------------------------------------------+
+diff --git a/loudmouth/Makefile.am b/loudmouth/Makefile.am
+index f73aa0c..e308e1c 100644
+--- a/loudmouth/Makefile.am
++++ b/loudmouth/Makefile.am
+@@ -6,6 +6,7 @@ AM_CPPFLAGS = \
+ -I. \
+ -I$(top_srcdir) \
+ $(LOUDMOUTH_CFLAGS) \
++ $(ASYNCNS_CFLAGS) \
+ $(LIBIDN_CFLAGS) \
+ -DLM_COMPILATION \
+ -DRUNTIME_ENDIAN \
+@@ -51,8 +52,6 @@ libloudmouth_1_la_SOURCES = \
+ lm-sock.c \
+ lm-socket.c \
+ lm-socket.h \
+- asyncns.c \
+- asyncns.h \
+ lm-sasl.c \
+ lm-sasl.h \
+ md5.c \
+@@ -61,6 +60,13 @@ libloudmouth_1_la_SOURCES = \
+ base64.h \
+ $(NULL)
+
++if ! USE_SYSTEM_ASYNCNS
++libloudmouth_1_la_SOURCES += \
++ asyncns.c \
++ asyncns.h \
++ $(NULL)
++endif
++
+ libloudmouthinclude_HEADERS = \
+ lm-connection.h \
+ lm-error.h \
+@@ -75,6 +81,7 @@ libloudmouthinclude_HEADERS = \
+
+ libloudmouth_1_la_LIBADD = \
+ $(LOUDMOUTH_LIBS) \
++ $(ASYNCNS_LIBS) \
+ $(LIBIDN_LIBS) \
+ -lresolv
+
diff --git a/net-libs/loudmouth/files/loudmouth-1.4.3-drop-stanzas-on-fail.patch b/net-libs/loudmouth/files/loudmouth-1.4.3-drop-stanzas-on-fail.patch
new file mode 100644
index 000000000000..05c76c590b58
--- /dev/null
+++ b/net-libs/loudmouth/files/loudmouth-1.4.3-drop-stanzas-on-fail.patch
@@ -0,0 +1,47 @@
+
+From: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+Date: Tue, 13 Jan 2009 11:28:44 +0000
+Subject: [PATCH] Drop stanzas when failing to convert them to LmMessages
+
+when a stanza comes in that for some reason can't be parsed into an LmMessage,
+just drop them on the floor instead of blocking the parser. I've seen this
+issue happen in practise because some (buggy?) client sending an iq with a
+prefix e.g. <client:iq xmlns:client="jabber:client" ... />
+---
+ loudmouth/lm-parser.c | 15 ++++++---------
+ 1 files changed, 6 insertions(+), 9 deletions(-)
+
+diff --git a/loudmouth/lm-parser.c b/loudmouth/lm-parser.c
+index 1938d56..89f6675 100644
+--- a/loudmouth/lm-parser.c
++++ b/loudmouth/lm-parser.c
+@@ -151,19 +151,16 @@ parser_end_node_cb (GMarkupParseContext *context,
+ if (!m) {
+ g_warning ("Couldn't create message: %s\n",
+ parser->cur_root->name);
+- return;
+- }
+-
+- g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_PARSER,
++ } else {
++ g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_PARSER,
+ "Have a new message\n");
+- if (parser->function) {
+- (* parser->function) (parser, m, parser->user_data);
++ 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;
+ } else {
+ LmMessageNode *tmp_node;
+--
+1.5.6.5
+
+
diff --git a/net-libs/loudmouth/files/loudmouth-1.4.3-fix-sasl-md5-digest-uri.patch b/net-libs/loudmouth/files/loudmouth-1.4.3-fix-sasl-md5-digest-uri.patch
new file mode 100644
index 000000000000..5bca69c0c15e
--- /dev/null
+++ b/net-libs/loudmouth/files/loudmouth-1.4.3-fix-sasl-md5-digest-uri.patch
@@ -0,0 +1,24 @@
+diff --git a/loudmouth/lm-connection.c b/loudmouth/lm-connection.c
+index 21c1bc2..ae8de94 100644
+--- a/loudmouth/lm-connection.c
++++ b/loudmouth/lm-connection.c
+@@ -1441,11 +1441,18 @@ lm_connection_authenticate (LmConnection *connection,
+ connection->effective_jid = g_strdup_printf ("%s/%s",
+ connection->jid, connection->resource);
+
+ if (connection->use_sasl) {
++ gchar *domain = NULL;
++
++ if (!connection_get_server_from_jid (connection->jid, &domain)) {
++ domain = g_strdup (connection->server);
++ }
++
+ lm_sasl_authenticate (connection->sasl,
+ username, password,
+- connection->server,
++ domain,
+ connection_sasl_auth_finished);
++ g_free (domain);
+
+ connection->features_cb =
+ lm_message_handler_new (connection_features_cb,
diff --git a/net-libs/loudmouth/files/loudmouth-1.4.3-free-before-closed.patch b/net-libs/loudmouth/files/loudmouth-1.4.3-free-before-closed.patch
new file mode 100644
index 000000000000..d6c43ae9d66f
--- /dev/null
+++ b/net-libs/loudmouth/files/loudmouth-1.4.3-free-before-closed.patch
@@ -0,0 +1,137 @@
+From ff113220df9073c3e6078487e87b6a7b86e2d952 Mon Sep 17 00:00:00 2001
+From: Mikael Hallendal <micke@imendio.com>
+Date: Sun, 30 Nov 2008 09:27:21 +0100
+Subject: [PATCH] Don't free connection internals before it's closed. [#34]
+
+When the connection freed up internal states (in this case the handler
+lists) before closing itself it segfaulted when trying to unregister the
+SASL handlers.
+
+Reported by Julien Puydt.
+---
+ loudmouth/lm-connection.c | 30 +++++++++++++++++-------------
+ loudmouth/lm-sasl.c | 18 +++++++++---------
+ 2 files changed, 26 insertions(+), 22 deletions(-)
+
+diff --git a/loudmouth/lm-connection.c b/loudmouth/lm-connection.c
+index 915c0ad..dda2978 100644
+--- a/loudmouth/lm-connection.c
++++ b/loudmouth/lm-connection.c
+@@ -191,13 +191,21 @@ connection_free (LmConnection *connection)
+ {
+ int i;
+
++ /* This needs to be run before starting to free internal states.
++ * It used to be run after the handlers where freed which lead to a crash
++ * when the connection was freed prior to running lm_connection_close.
++ */
++ if (connection->state >= LM_CONNECTION_STATE_OPENING) {
++ connection_do_close (connection);
++ }
++
+ g_free (connection->server);
+ g_free (connection->jid);
+ g_free (connection->effective_jid);
+ g_free (connection->stream_id);
+ g_free (connection->resource);
+
+- if (connection->sasl) {
++ if (connection->sasl) {
+ lm_sasl_free (connection->sasl);
+ }
+
+@@ -218,13 +226,9 @@ connection_free (LmConnection *connection)
+
+ g_slist_free (connection->handlers[i]);
+ }
+-
+ g_hash_table_destroy (connection->id_handlers);
+- if (connection->state >= LM_CONNECTION_STATE_OPENING) {
+- connection_do_close (connection);
+- }
+
+- if (connection->open_cb) {
++ if (connection->open_cb) {
+ _lm_utils_free_callback (connection->open_cb);
+ }
+
+@@ -2030,11 +2034,11 @@ lm_connection_unregister_message_handler (LmConnection *connection,
+ g_return_if_fail (handler != NULL);
+ g_return_if_fail (type != LM_MESSAGE_TYPE_UNKNOWN);
+
+- for (l = connection->handlers[type]; l; l = l->next) {
+- HandlerData *hd = (HandlerData *) l->data;
+-
++ for (l = connection->handlers[type]; l; l = l->next) {
++ HandlerData *hd = (HandlerData *) l->data;
++
+ if (handler == hd->handler) {
+- connection->handlers[type] = g_slist_remove_link (connection->handlers[type], l);
++ connection->handlers[type] = g_slist_remove_link (connection->handlers[type], l);
+ g_slist_free (l);
+ lm_message_handler_unref (hd->handler);
+ g_free (hd);
+@@ -2140,7 +2144,7 @@ lm_connection_ref (LmConnection *connection)
+ g_return_val_if_fail (connection != NULL, NULL);
+
+ connection->ref_count++;
+-
++
+ return connection;
+ }
+
+@@ -2157,8 +2161,8 @@ lm_connection_unref (LmConnection *connection)
+ g_return_if_fail (connection != NULL);
+
+ connection->ref_count--;
+-
++
+ if (connection->ref_count == 0) {
+- connection_free (connection);
++ connection_free (connection);
+ }
+ }
+diff --git a/loudmouth/lm-sasl.c b/loudmouth/lm-sasl.c
+index 42ee0e1..e6a72f5 100644
+--- a/loudmouth/lm-sasl.c
++++ b/loudmouth/lm-sasl.c
+@@ -807,27 +807,27 @@ lm_sasl_free (LmSASL *sasl)
+ g_free (sasl->server);
+
+ if (sasl->features_cb) {
+- lm_connection_unregister_message_handler (sasl->connection,
+- sasl->features_cb,
+- LM_MESSAGE_TYPE_STREAM_FEATURES);
++ lm_connection_unregister_message_handler (sasl->connection,
++ sasl->features_cb,
++ LM_MESSAGE_TYPE_STREAM_FEATURES);
+ }
+
+ if (sasl->challenge_cb) {
+ lm_connection_unregister_message_handler (sasl->connection,
+- sasl->challenge_cb,
+- LM_MESSAGE_TYPE_CHALLENGE);
++ sasl->challenge_cb,
++ LM_MESSAGE_TYPE_CHALLENGE);
+ }
+
+ if (sasl->success_cb) {
+ lm_connection_unregister_message_handler (sasl->connection,
+- sasl->success_cb,
+- LM_MESSAGE_TYPE_SUCCESS);
++ sasl->success_cb,
++ LM_MESSAGE_TYPE_SUCCESS);
+ }
+
+ if (sasl->failure_cb) {
+ lm_connection_unregister_message_handler (sasl->connection,
+- sasl->failure_cb,
+- LM_MESSAGE_TYPE_FAILURE);
++ sasl->failure_cb,
++ LM_MESSAGE_TYPE_FAILURE);
+ }
+
+ g_free (sasl);
+--
+1.7.7.1
+
diff --git a/net-libs/loudmouth/files/loudmouth-1.4.3-glib-2.32.patch b/net-libs/loudmouth/files/loudmouth-1.4.3-glib-2.32.patch
new file mode 100644
index 000000000000..87fc170c80da
--- /dev/null
+++ b/net-libs/loudmouth/files/loudmouth-1.4.3-glib-2.32.patch
@@ -0,0 +1,13 @@
+Index: loudmouth-1.4.3/loudmouth/lm-error.c
+===================================================================
+--- loudmouth-1.4.3.orig/loudmouth/lm-error.c
++++ loudmouth-1.4.3/loudmouth/lm-error.c
+@@ -19,7 +19,7 @@
+ */
+
+ #include <config.h>
+-#include <glib/gerror.h>
++#include <glib.h>
+ #include "lm-error.h"
+
+ /**
diff --git a/net-libs/loudmouth/files/loudmouth-1.4.3-gnutls28.patch b/net-libs/loudmouth/files/loudmouth-1.4.3-gnutls28.patch
new file mode 100644
index 000000000000..a538533db03b
--- /dev/null
+++ b/net-libs/loudmouth/files/loudmouth-1.4.3-gnutls28.patch
@@ -0,0 +1,15 @@
+# Gentoo: https://bugs.gentoo.org/show_bug.cgi?id=272027
+# Patch from mandriva
+--- a/configure.ac 2009-05-30 17:59:03.000000000 +0200
++++ b/configure.ac 2009-05-30 18:02:24.000000000 +0200
+@@ -146,8 +146,9 @@
+ enable_ssl=no
+ if test "x$ac_ssl" = "xgnutls"; then
+ dnl Look for GnuTLS
+- AM_PATH_LM_LIBGNUTLS($GNUTLS_REQUIRED, have_libgnutls=yes, have_libgnutls=no)
++ PKG_CHECK_EXISTS([gnutls >= $GNUTLS_REQUIRED], have_libgnutls=yes, have_libgnutls=no)
+ if test "x$have_libgnutls" = "xyes"; then
++ PKG_CHECK_MODULES(LIBGNUTLS, [gnutls >= $GNUTLS_REQUIRED])
+ CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
+ LIBS="$LIBS $LIBGNUTLS_LIBS"
+ AC_DEFINE(HAVE_GNUTLS, 1, [whether to use GnuTSL support.])
diff --git a/net-libs/loudmouth/files/loudmouth-1.4.3-id-tag-in-opening-headers.patch b/net-libs/loudmouth/files/loudmouth-1.4.3-id-tag-in-opening-headers.patch
new file mode 100644
index 000000000000..43b923a5e73f
--- /dev/null
+++ b/net-libs/loudmouth/files/loudmouth-1.4.3-id-tag-in-opening-headers.patch
@@ -0,0 +1,35 @@
+From 6f3a168d985d37af42e747412b5d6d427b4d1ab8 Mon Sep 17 00:00:00 2001
+From: Will Thompson <will.thompson@collabora.co.uk>
+Date: Wed, 5 Nov 2008 23:19:42 +0100
+Subject: [PATCH] Don't append the 'id'-tag in opening stream headers. [#30]
+
+According to RFC 3920 (section 4.4) the id attribute SHOULD NOT be added
+by the initiating party.
+
+[#30 responsible:Hallski state:resolved milestone:Loudmouth 1.4.4 tagged:committed]
+---
+ loudmouth/lm-message.c | 8 +++++---
+ 1 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/loudmouth/lm-message.c b/loudmouth/lm-message.c
+index a7d1b46..e2fdcc2 100644
+--- a/loudmouth/lm-message.c
++++ b/loudmouth/lm-message.c
+@@ -223,9 +223,11 @@ lm_message_new (const gchar *to, LmMessageType type)
+
+ m->node = _lm_message_node_new (_lm_message_type_to_string (type));
+
+- id = _lm_utils_generate_id ();
+- lm_message_node_set_attribute (m->node, "id", id);
+- g_free (id);
++ if (type != LM_MESSAGE_TYPE_STREAM) {
++ id = _lm_utils_generate_id ();
++ lm_message_node_set_attribute (m->node, "id", id);
++ g_free (id);
++ }
+
+ if (to) {
+ lm_message_node_set_attribute (m->node, "to", to);
+--
+1.7.7.1
+
diff --git a/net-libs/loudmouth/files/loudmouth-1.4.3-invalid-unicode.patch b/net-libs/loudmouth/files/loudmouth-1.4.3-invalid-unicode.patch
new file mode 100644
index 000000000000..2a97653c93cd
--- /dev/null
+++ b/net-libs/loudmouth/files/loudmouth-1.4.3-invalid-unicode.patch
@@ -0,0 +1,144 @@
+From e08dbcca6cf50c834e2fe4e7290cce642903251d Mon Sep 17 00:00:00 2001
+From: Hermitifier <quantifier666@gmail.com>
+Date: Mon, 3 Oct 2011 17:06:18 +0200
+Subject: [PATCH] Protect GMarkup parser against invalid unicode characters
+
+[Alexandre Rostovtsev <tetromino@gentoo.org>: backport to 1.4.3]
+
+http://loudmouth.lighthouseapp.com/projects/17276/tickets/61
+---
+ loudmouth/lm-parser.c | 94 ++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 files changed, 85 insertions(+), 9 deletions(-)
+
+diff --git a/loudmouth/lm-parser.c b/loudmouth/lm-parser.c
+index 89f6675..0a61a56 100644
+--- a/loudmouth/lm-parser.c
++++ b/loudmouth/lm-parser.c
+@@ -43,6 +43,8 @@ struct LmParser {
+
+ GMarkupParser *m_parser;
+ GMarkupParseContext *context;
++ gchar *incomplete; /* incomplete utf-8 character
++ found at the end of buffer */
+ };
+
+
+@@ -233,25 +235,98 @@ lm_parser_new (LmParserMessageFunction function,
+ parser->cur_root = NULL;
+ parser->cur_node = NULL;
+
++ parser->incomplete = NULL;
++
+ return parser;
+ }
+
++static gchar *
++_lm_parser_make_valid (const gchar *buffer, gchar **incomplete)
++{
++ GString *string;
++ const gchar *remainder, *invalid;
++ gint remaining_bytes, valid_bytes;
++ gunichar code; /*error code for invalid character*/
++
++ g_return_val_if_fail (buffer != NULL, NULL);
++
++ string = NULL;
++ remainder = buffer;
++ remaining_bytes = strlen (buffer);
++
++ while (remaining_bytes != 0)
++ {
++ if (g_utf8_validate (remainder, remaining_bytes, &invalid))
++ break;
++ valid_bytes = invalid - remainder;
++
++ if (string == NULL)
++ string = g_string_sized_new (remaining_bytes);
++
++ g_string_append_len (string, remainder, valid_bytes);
++
++ remainder = g_utf8_find_next_char(invalid, NULL);
++ remaining_bytes -= valid_bytes + (remainder - invalid);
++
++ code = g_utf8_get_char_validated (invalid, -1);
++
++ if (code == -1) {
++ /* A complete but invalid codepoint */
++ /* append U+FFFD REPLACEMENT CHARACTER */
++ g_string_append (string, "\357\277\275");
++#ifndef LM_NO_DEBUG
++ g_debug ("invalid character!\n");
++#endif
++ } else if (code == -2) {
++ /* Beginning of what could be a character */
++ *incomplete = g_strdup (invalid);
++#ifndef LM_NO_DEBUG
++ g_debug ("incomplete character: %s\n", *incomplete);
++#endif
++
++ g_assert (remaining_bytes == 0);
++ g_assert (*(g_utf8_find_next_char(invalid, NULL)) == '\0');
++ }
++ }
++
++ if (string == NULL)
++ return g_strdup (buffer);
++
++ g_string_append (string, remainder);
++
++ g_assert (g_utf8_validate (string->str, -1, NULL));
++
++ return g_string_free (string, FALSE);
++}
++
++
+ void
+ lm_parser_parse (LmParser *parser, const gchar *string)
+ {
++ gchar *valid, *completed;
+ g_return_if_fail (parser != NULL);
+
+- if (!parser->context) {
+- parser->context = g_markup_parse_context_new (parser->m_parser, 0,
+- parser, NULL);
+- }
+-
+- if (g_markup_parse_context_parse (parser->context, string,
+- (gssize)strlen (string), NULL)) {
+- } else {
++ if (!parser->context) {
++ parser->context = g_markup_parse_context_new (parser->m_parser, 0,
++ parser, NULL);
++ }
++
++ if (parser->incomplete) {
++ completed = g_strdup_printf("%s%s", parser->incomplete, string);
++ g_free(parser->incomplete);
++ parser->incomplete = NULL;
++ } else {
++ completed = g_strdup(string);
++ }
++ valid = _lm_parser_make_valid (completed, &parser->incomplete);
++ g_free(completed);
++ if (g_markup_parse_context_parse (parser->context, valid,
++ (gssize)strlen (valid), NULL)) {
++ } else {
+ g_markup_parse_context_free (parser->context);
+ parser->context = NULL;
+- }
++ }
++ g_free(valid);
+ }
+
+ void
+@@ -264,6 +339,7 @@ lm_parser_free (LmParser *parser)
+ if (parser->context) {
+ g_markup_parse_context_free (parser->context);
+ }
++ g_free (parser->incomplete);
+ g_free (parser->m_parser);
+ g_free (parser);
+ }
+--
+1.7.7.1
+
diff --git a/net-libs/loudmouth/files/loudmouth-1.4.3-silence-chdir.patch b/net-libs/loudmouth/files/loudmouth-1.4.3-silence-chdir.patch
new file mode 100644
index 000000000000..0ee8c940fade
--- /dev/null
+++ b/net-libs/loudmouth/files/loudmouth-1.4.3-silence-chdir.patch
@@ -0,0 +1,33 @@
+From 4d8a5ea64abb65ed086efc3e32125c529068acbe Mon Sep 17 00:00:00 2001
+From: Mikael Hallendal <micke@imendio.com>
+Date: Wed, 19 Nov 2008 10:16:40 +0100
+Subject: [PATCH] Silence chdir by catching return value
+
+---
+ loudmouth/asyncns.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/loudmouth/asyncns.c b/loudmouth/asyncns.c
+index 9b238fa..55cb471 100644
+--- a/loudmouth/asyncns.c
++++ b/loudmouth/asyncns.c
+@@ -382,6 +382,7 @@ static int process_worker(int in_fd, int out_fd) {
+ int have_death_sig = 0;
+ assert(in_fd > 2);
+ assert(out_fd > 2);
++ int no_warn;
+
+ close(0);
+ close(1);
+@@ -391,7 +392,7 @@ static int process_worker(int in_fd, int out_fd) {
+ open("/dev/null", O_WRONLY);
+ open("/dev/null", O_WRONLY);
+
+- chdir("/");
++ no_warn = chdir("/");
+
+ if (geteuid() == 0) {
+ struct passwd *pw;
+--
+1.7.7.1
+
diff --git a/net-libs/loudmouth/loudmouth-1.4.3-r2.ebuild b/net-libs/loudmouth/loudmouth-1.4.3-r2.ebuild
new file mode 100644
index 000000000000..073287849ae7
--- /dev/null
+++ b/net-libs/loudmouth/loudmouth-1.4.3-r2.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+GNOME_TARBALL_SUFFIX="bz2"
+GNOME2_LA_PUNT="yes"
+# Not using gnome macro, but behavior is similar, #434736
+GCONF_DEBUG="yes"
+
+inherit autotools eutils gnome2
+
+DESCRIPTION="Lightweight C Jabber library"
+HOMEPAGE="https://github.com/engineyard/loudmouth"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm ia64 ppc ppc64 sparc x86 ~ppc-macos"
+
+IUSE="asyncns ssl static-libs test"
+
+# Automagic libidn dependency
+RDEPEND="
+ >=dev-libs/glib-2.4:2
+ net-dns/libidn
+ ssl? ( >=net-libs/gnutls-1.4.0 )
+ asyncns? ( net-libs/libasyncns )
+"
+# FIXME:
+# openssl dropped because of bug #216705
+
+DEPEND="${RDEPEND}
+ test? ( dev-libs/check )
+ virtual/pkgconfig
+ >=dev-util/gtk-doc-am-1
+"
+
+src_prepare() {
+ # Use system libasyncns, bug #236844
+ epatch "${FILESDIR}/${P}-asyncns-system.patch"
+
+ # Fix detection of gnutls-2.8, bug #272027
+ epatch "${FILESDIR}/${P}-gnutls28.patch"
+
+ # Fix digest auth with SRV (or similar)
+ # Upstream: http://loudmouth.lighthouseapp.com/projects/17276-libloudmouth/tickets/44-md5-digest-uri-not-set-correctly-when-using-srv
+ epatch "${FILESDIR}/${P}-fix-sasl-md5-digest-uri.patch"
+
+ # Drop stanzas when failing to convert them to LmMessages
+ # From debian..
+ epatch "${FILESDIR}/${P}-drop-stanzas-on-fail.patch"
+
+ # Don't check for sync dns problems when using asyncns [#33]
+ # From debian..
+ epatch "${FILESDIR}/${P}-async-fix.patch"
+
+ # Don't append id tag in opening headers [#30]
+ epatch "${FILESDIR}/${P}-id-tag-in-opening-headers.patch"
+
+ # Silence chdir, from engineyard git
+ epatch "${FILESDIR}/${P}-silence-chdir.patch"
+
+ # Don't free connection internals before connection is closed [#34]
+ epatch "${FILESDIR}/${P}-free-before-closed.patch"
+
+ # Check for invalid utf8, bug #389127
+ # Upstream: http://loudmouth.lighthouseapp.com/projects/17276/tickets/61
+ epatch "${FILESDIR}/${P}-invalid-unicode.patch"
+
+ # http://loudmouth.lighthouseapp.com/projects/17276/tickets/63
+ epatch "${FILESDIR}/${P}-glib-2.32.patch"
+
+ sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.ac || die #467694
+
+ eautoreconf
+ gnome2_src_prepare
+}
+
+src_configure() {
+ local myconf
+
+ if use ssl; then
+ myconf="${myconf} --with-ssl=gnutls"
+ else
+ myconf="${myconf} --with-ssl=no"
+ fi
+
+ if use asyncns; then
+ myconf="${myconf} --with-asyncns=system"
+ else
+ myconf="${myconf} --without-asyncns"
+ fi
+ gnome2_src_configure \
+ $(use_enable static-libs static) \
+ ${myconf}
+}
diff --git a/net-libs/loudmouth/loudmouth-1.5.2-r1.ebuild b/net-libs/loudmouth/loudmouth-1.5.2-r1.ebuild
new file mode 100644
index 000000000000..0059fb3c90fc
--- /dev/null
+++ b/net-libs/loudmouth/loudmouth-1.5.2-r1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit autotools eutils
+
+DESCRIPTION="Lightweight C Jabber library"
+HOMEPAGE="https://github.com/mcabber/loudmouth"
+SRC_URI="https://github.com/mcabber/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+#SRC_URI="https://mcabber.com/files/${PN}/${P}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ia64 ~ppc ~ppc64 ~sparc ~x86 ~ppc-macos"
+
+IUSE="asyncns ssl openssl static-libs test"
+
+# Automagic libidn dependency
+RDEPEND="
+ >=dev-libs/glib-2.16:2
+ net-dns/libidn
+ ssl? (
+ !openssl? ( >=net-libs/gnutls-1.4.0 )
+ openssl? ( dev-libs/openssl:0 )
+ )
+ asyncns? ( >=net-libs/libasyncns-0.3 )
+"
+DEPEND="${RDEPEND}
+ test? ( dev-libs/check )
+ virtual/pkgconfig
+ >=dev-util/gtk-doc-1
+ >=dev-util/gtk-doc-am-1
+"
+
+src_prepare() {
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+
+ if use ssl; then
+ if ! use openssl; then
+ myconf="${myconf} --with-ssl=gnutls"
+ else
+ myconf="${myconf} --with-ssl=openssl"
+ fi
+ else
+ myconf="${myconf} --with-ssl=no"
+ fi
+
+ econf \
+ $(use_enable static-libs static) \
+ $(use_with asyncns) \
+ ${myconf}
+}
diff --git a/net-libs/loudmouth/loudmouth-1.5.3.ebuild b/net-libs/loudmouth/loudmouth-1.5.3.ebuild
new file mode 100644
index 000000000000..b5dac8fc2678
--- /dev/null
+++ b/net-libs/loudmouth/loudmouth-1.5.3.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit autotools eutils
+
+DESCRIPTION="Lightweight C Jabber library"
+HOMEPAGE="https://github.com/mcabber/loudmouth"
+SRC_URI="https://github.com/mcabber/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+#SRC_URI="https://mcabber.com/files/${PN}/${P}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~ppc-macos"
+
+IUSE="asyncns ssl openssl static-libs test"
+
+# Automagic libidn dependency
+RDEPEND="
+ >=dev-libs/glib-2.16:2
+ net-dns/libidn
+ ssl? (
+ !openssl? ( >=net-libs/gnutls-1.4.0 )
+ openssl? ( dev-libs/openssl:0 )
+ )
+ asyncns? ( >=net-libs/libasyncns-0.3 )
+"
+DEPEND="${RDEPEND}
+ test? ( dev-libs/check )
+ virtual/pkgconfig
+ >=dev-util/gtk-doc-1
+ >=dev-util/gtk-doc-am-1
+"
+
+src_prepare() {
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+
+ if use ssl; then
+ if ! use openssl; then
+ myconf="${myconf} --with-ssl=gnutls"
+ else
+ myconf="${myconf} --with-ssl=openssl"
+ fi
+ else
+ myconf="${myconf} --with-ssl=no"
+ fi
+
+ econf \
+ $(use_enable static-libs static) \
+ $(use_with asyncns) \
+ ${myconf}
+}
diff --git a/net-libs/loudmouth/metadata.xml b/net-libs/loudmouth/metadata.xml
new file mode 100644
index 000000000000..528027fd8a72
--- /dev/null
+++ b/net-libs/loudmouth/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>wschlich@gentoo.org</email>
+ <name>Wolfram Schlich</name>
+ </maintainer>
+ <use>
+ <flag name="asyncns">Use <pkg>net-libs/libasyncns</pkg> for asynchronous name resolution.</flag>
+ <flag name="openssl">Enable <pkg>dev-libs/openssl</pkg> support instead of gnutls (which is the default).</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">mcabber/loudmouth</remote-id>
+ </upstream>
+</pkgmetadata>