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

Attachment: signature.asc
Description: Digital signature

Reply via email to