Permalink
Browse files

Patch by Bill Lindley about keeping the socket alive after an abandon…

…Request.

git-svn-id: svn://localhost:3690/Net-LDAP-Server/trunk@9 79e93f9f-6f84-dc11-8383-000bcdcb7a8f
  • Loading branch information...
al
al committed Oct 1, 2009
1 parent 918f9f9 commit 6b8a9c3745893770ac36606e1dde42ba2b6e6ba4
Showing with 10 additions and 7 deletions.
  1. +4 −0 Changelog
  2. +6 −7 lib/Net/LDAP/Server.pm
View
@@ -1,3 +1,7 @@
+ - don't hangup when receiving abandonRequest in order to support
+ clients like Evolution which expect that the socket is still
+ alive after such a request (patch by Bill Lindley)
+
version 0.4 (2007/10/27):
- added support for method "abandon"
View
@@ -18,7 +18,7 @@ use Net::LDAP::ASN qw(LDAPRequest LDAPResponse);
use Net::LDAP::Constant qw(LDAP_OPERATIONS_ERROR LDAP_UNWILLING_TO_PERFORM);
use Net::LDAP::Entry;
-our $VERSION = '0.4';
+our $VERSION = '0.41';
use fields qw(socket);
our %respTypes=(
@@ -77,12 +77,11 @@ sub handle {
last;
}
}
- my $respType = $respTypes{$reqType}
- or return 1; # if no response type is present hangup the connection
-
- my $reqData = $request->{$reqType};
-
+ return 1 if !exists $respTypes{$reqType}; # unknown request type: let's hangup
+ my $respType = $respTypes{$reqType};
+
# here we can do something with the request of type $reqType
+ my $reqData = $request->{$reqType};
my $method = $functions{$reqType};
my $result;
if ($self->can($method)){
@@ -137,7 +136,7 @@ sub handle {
}
# and now send the result to the client
- print $socket &_encode_result($mid, $respType, $result);
+ print $socket &_encode_result($mid, $respType, $result) if $respType;
return 0;
}

0 comments on commit 6b8a9c3

Please sign in to comment.