regression in perl-ldap 0.35 and greater

Ben Poliakoff <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.ldap
Message-ID <[email protected]>
Hi All,

This is something of a late report (but I just upgraded my workstation
to Debian Lenny which entailed an update of Net::LDAP, from version 0.33
to 0.36).

This commit (apparently from June 2007):

    "send packets in sizes that IO::Socket::SSL can chew"
    http://github.com/gbarr/perl-ldap/commit/8c6c9cfcb78adf229437507f2e8ffe86d15e712d

Seems to result in intermittent fatal I/O errors, at least when talking
to an OpenLDAP server via a SASL/GSSAPI bind.  In other words scripts
that worked with version 0.33 start failing *intermittently* with later
versions.

Reverting the patch restores reliable behavior, at least in my
environment.  

Can anyone more versed in socket programming spot what might be
triggering the problem?  Here's the relevant section of LDAP.pm
(starting around line 790):

  # send packets in sizes that IO::Socket::SSL can chew
  # originally it was:
  #syswrite($socket, $mesg->pdu, length($mesg->pdu))
  #  or return _error($ldap, $mesg, LDAP_LOCAL_ERROR,"$!");
  my $to_send = \( $mesg->pdu );
  my $offset = 0;
  while($offset < length($$to_send)) {
    my $n = syswrite($socket, substr($$to_send, $offset, 15000), 15000)
      or return _error($ldap, $mesg, LDAP_LOCAL_ERROR,"$!");
    $offset += $n;
  }

Ben

-- 
________________________________________________________________________
PGP (318B6A97):  3F23 EBC8 B73E 92B7 0A67  705A 8219 DCF0 318B 6A97
signature.asc (application/pgp-signature, 827 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iQIVAwUBSmd96oIZ3PAxi2qXAQj2GxAApsXi6dsYuYwMPrWHW5Wm2GTH3ZtvYXbe
zJcHeuNpSv3rFCVI9S1JYj6H7jM0NS4m3UwExFwnYtkfhhhMaOISOvtbM5XYHDRO
xd/M6tMP1vIi9NncEPwgekPAYnIDomTgESZs4u7AQ7FopGMGozXZloYLk/278XNl
3NVn5nRdjwmMb3okpqG0VhIVk8sh2P5J7b8S8y6wMc9vjF/hwnwjuvjYVZMhMeHX
8ijNr6bsYrZ0CLje6IhCdpHsycJw2/gqFg1CNUjMgMr9KvGxsC/ymvuc1F+01ei6
UdifaztFaozLS/XqumESuBmDi+AbXnTF6O3oKN7QKRx4W8oDLUYIHpkzuSiqz6tV
fqlqhGDnoZO2cEp8ZrY3LZ/x4bpAwY3z0x8PYGCI6vElZ4WCNDlyjxVS3+kSNeif
wgGu0jb2VtyQRXfvMHpYHGTD5CHzTlKNHfG8loXqqFaiDiHK+Ixms4xA1fHeaDWI
SIFB7PWu2JtUtc03tPEFSYzsWTD21FuA3SQv9PKwbPaMJygMkQgAaIexhZX1OX1r
k1MqcBlmnh6JjG0U9hieOhrgdqHNXo4wPgSOyJoc6iYWyQW8jv5bbajZTVNMby+J
RL8eVMQUCu8El3uzKER4zwqVYYSdVuX8LIcQfqleM0R4Ealdq79yo8AD2APiKHyW
IvGCF2JaFTA=
=qZe2
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.