pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/chat/bitlbee Add patch taken from the devel branch, to...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/793c13dff479
branches:  trunk
changeset: 541329:793c13dff479
user:      tonio <tonio%pkgsrc.org@localhost>
date:      Sun Apr 20 09:29:45 2008 +0000

description:
Add patch taken from the devel branch, to fix issues with openssl and jabber

Patch is taken from
http://bugs.bitlbee.org/bitlbee/changeset/devel%2C359
And the issue: http://bugs.bitlbee.org/bitlbee/ticket/368

Thanks to Frederic Jaeckel for the report.

diffstat:

 chat/bitlbee/Makefile         |   3 +-
 chat/bitlbee/distinfo         |   7 +++++-
 chat/bitlbee/patches/patch-aa |  17 ++++++++++++++
 chat/bitlbee/patches/patch-ab |  20 +++++++++++++++++
 chat/bitlbee/patches/patch-ac |  20 +++++++++++++++++
 chat/bitlbee/patches/patch-ad |  50 +++++++++++++++++++++++++++++++++++++++++++
 chat/bitlbee/patches/patch-ae |  23 +++++++++++++++++++
 7 files changed, 138 insertions(+), 2 deletions(-)

diffs (178 lines):

diff -r 01b4812e24ee -r 793c13dff479 chat/bitlbee/Makefile
--- a/chat/bitlbee/Makefile     Sun Apr 20 02:58:51 2008 +0000
+++ b/chat/bitlbee/Makefile     Sun Apr 20 09:29:45 2008 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.40 2008/04/09 18:51:30 tonio Exp $
+# $NetBSD: Makefile,v 1.41 2008/04/20 09:29:45 tonio Exp $
 #
 
 DISTNAME=              bitlbee-1.2
+PKGREVISION=           1
 CATEGORIES=            chat
 MASTER_SITES=          http://get.bitlbee.org/src/
 
diff -r 01b4812e24ee -r 793c13dff479 chat/bitlbee/distinfo
--- a/chat/bitlbee/distinfo     Sun Apr 20 02:58:51 2008 +0000
+++ b/chat/bitlbee/distinfo     Sun Apr 20 09:29:45 2008 +0000
@@ -1,5 +1,10 @@
-$NetBSD: distinfo,v 1.18 2008/04/09 18:51:30 tonio Exp $
+$NetBSD: distinfo,v 1.19 2008/04/20 09:29:45 tonio Exp $
 
 SHA1 (bitlbee-1.2.tar.gz) = 71dc24e9025375460e999345db70fb5dff7d45d8
 RMD160 (bitlbee-1.2.tar.gz) = c48c5f8af418ba4fe7310732ced6290521cc656e
 Size (bitlbee-1.2.tar.gz) = 469482 bytes
+SHA1 (patch-aa) = 39f16450f87ee37b16ac4e13991ddc6baecf460b
+SHA1 (patch-ab) = 249a77118d76e1495713f28f9caf9923734afac3
+SHA1 (patch-ac) = 6ba0b3fff28f8bcc29d3d07bd7692104d5ae4bc1
+SHA1 (patch-ad) = 1d6733eed422feeac7568f519d7ae0336cbfbead
+SHA1 (patch-ae) = bd55911a6cfe49f02ecd1b7f0469dc9bfea8f5d6
diff -r 01b4812e24ee -r 793c13dff479 chat/bitlbee/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/chat/bitlbee/patches/patch-aa     Sun Apr 20 09:29:45 2008 +0000
@@ -0,0 +1,17 @@
+Fix stalling issue with OpenSSL and Jabber
+From http://bugs.bitlbee.org/bitlbee/changeset/devel%2C359
+
+$NetBSD: patch-aa,v 1.7 2008/04/20 09:29:45 tonio Exp $
+
+--- lib/ssl_client.h.orig      Sat Jun 30 23:18:42 2007
++++ lib/ssl_client.h
+@@ -59,6 +59,9 @@ G_MODULE_EXPORT void *ssl_starttls( int 
+ G_MODULE_EXPORT int ssl_read( void *conn, char *buf, int len );
+ G_MODULE_EXPORT int ssl_write( void *conn, const char *buf, int len );
+ 
++/* See ssl_openssl.c for an explanation. */
++G_MODULE_EXPORT int ssl_pending( void *conn );
++
+ /* Abort the SSL connection and disconnect the socket. Do not use close()
+    directly, both the SSL library and the peer will be unhappy! */
+ G_MODULE_EXPORT void ssl_disconnect( void *conn_ );
diff -r 01b4812e24ee -r 793c13dff479 chat/bitlbee/patches/patch-ab
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/chat/bitlbee/patches/patch-ab     Sun Apr 20 09:29:45 2008 +0000
@@ -0,0 +1,20 @@
+Fix stalling issue with OpenSSL and Jabber
+From http://bugs.bitlbee.org/bitlbee/changeset/devel%2C359
+
+$NetBSD: patch-ab,v 1.1 2008/04/20 09:29:45 tonio Exp $
+
+--- lib/ssl_gnutls.c.orig      Sat Mar 15 18:32:14 2008
++++ lib/ssl_gnutls.c
+@@ -210,6 +210,12 @@ int ssl_write( void *conn, const char *b
+       return st;
+ }
+ 
++/* See ssl_openssl.c for an explanation. */
++int ssl_pending( void *conn )
++{
++      return 0;
++}
++
+ void ssl_disconnect( void *conn_ )
+ {
+       struct scd *conn = conn_;
diff -r 01b4812e24ee -r 793c13dff479 chat/bitlbee/patches/patch-ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/chat/bitlbee/patches/patch-ac     Sun Apr 20 09:29:45 2008 +0000
@@ -0,0 +1,20 @@
+Fix stalling issue with OpenSSL and Jabber
+From http://bugs.bitlbee.org/bitlbee/changeset/devel%2C359
+
+$NetBSD: patch-ac,v 1.1 2008/04/20 09:29:45 tonio Exp $
+
+--- lib/ssl_nss.c.orig Sat Jun 30 23:18:42 2007
++++ lib/ssl_nss.c
+@@ -168,6 +168,12 @@ int ssl_write( void *conn, const char *b
+       return( PR_Write ( ((struct scd*)conn)->prfd, buf, len ) );
+ }
+ 
++/* See ssl_openssl.c for an explanation. */
++int ssl_pending( void *conn )
++{
++      return 0;
++}
++
+ void ssl_disconnect( void *conn_ )
+ {
+       struct scd *conn = conn_;
diff -r 01b4812e24ee -r 793c13dff479 chat/bitlbee/patches/patch-ad
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/chat/bitlbee/patches/patch-ad     Sun Apr 20 09:29:45 2008 +0000
@@ -0,0 +1,50 @@
+Fix stalling issue with OpenSSL and Jabber
+From http://bugs.bitlbee.org/bitlbee/changeset/devel%2C359
+
+$NetBSD: patch-ad,v 1.1 2008/04/20 09:29:45 tonio Exp $
+
+--- lib/ssl_openssl.c.orig     Sat Jun 30 23:18:42 2007
++++ lib/ssl_openssl.c
+@@ -61,16 +61,16 @@ void *ssl_connect( char *host, int port,
+       struct scd *conn = g_new0( struct scd, 1 );
+       
+       conn->fd = proxy_connect( host, port, ssl_connected, conn );
+-      conn->func = func;
+-      conn->data = data;
+-      conn->inpa = -1;
+-      
+       if( conn->fd < 0 )
+       {
+               g_free( conn );
+               return NULL;
+       }
+       
++      conn->func = func;
++      conn->data = data;
++      conn->inpa = -1;
++      
+       return conn;
+ }
+ 
+@@ -228,6 +228,21 @@ int ssl_write( void *conn, const char *b
+       }
+       
+       return st;
++}
++
++/* Only OpenSSL *really* needs this (and well, maybe NSS). See for more info:
++   http://www.gnu.org/software/gnutls/manual/gnutls.html#index-gnutls_005frecord_005fcheck_005fpending-209
++   http://www.openssl.org/docs/ssl/SSL_pending.html
++   
++   Required because OpenSSL empties the TCP buffer completely but doesn't
++   necessarily give us all the unencrypted data.
++   
++   Returns 0 if there's nothing left or if we don't have to care (GnuTLS),
++   1 if there's more data. */
++int ssl_pending( void *conn )
++{
++      return ( ((struct scd*)conn) && ((struct scd*)conn)->established ) ?
++             SSL_pending( ((struct scd*)conn)->ssl ) > 0 : 0;
+ }
+ 
+ void ssl_disconnect( void *conn_ )
diff -r 01b4812e24ee -r 793c13dff479 chat/bitlbee/patches/patch-ae
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/chat/bitlbee/patches/patch-ae     Sun Apr 20 09:29:45 2008 +0000
@@ -0,0 +1,23 @@
+Fix stalling issue with OpenSSL and Jabber
+From http://bugs.bitlbee.org/bitlbee/changeset/devel%2C359
+
+$NetBSD: patch-ae,v 1.1 2008/04/20 09:29:45 tonio Exp $
+
+--- protocols/jabber/io.c.orig Sat Feb 16 23:39:47 2008
++++ protocols/jabber/io.c
+@@ -240,8 +240,13 @@ static gboolean jabber_read_callback( gp
+               return FALSE;
+       }
+       
+-      /* EAGAIN/etc or a successful read. */
+-      return TRUE;
++      if( ssl_pending( jd->ssl ) )
++              /* OpenSSL empties the TCP buffers completely but may keep some
++                 data in its internap buffers. select() won't see that, but
++                 ssl_pending() does. */
++              return jabber_read_callback( data, fd, cond );
++      else
++              return TRUE;
+ }
+ 
+ gboolean jabber_connected_plain( gpointer data, gint source, b_input_condition cond )



Home | Main Index | Thread Index | Old Index