maximum connections ignored?

Paul Lindner lindner at inuus.com
Mon Mar 19 05:44:00 UTC 2007


I just wrote the following test case, which fails.  It appears that
we do not check against the maximum connection amount specified on the
command line.

I think it's an easy fix in conn_new().

Thoughts?




[lindner at mirth server]$ more t/maxconns.t
#!/usr/bin/perl

use strict;
use warnings;

use Test::More tests => 20;

use FindBin qw($Bin);
use lib "$Bin/lib";
use MemcachedTest;


# start up a server with 10 maximum connections
my $server = new_memcached('-c 10');
my $sock = $server->sock;
my @sockets;

ok(defined($sock), 'Connection 0');
push (@sockets, $sock);

foreach my $conn (1..20) {
  $sock = $server->new_sock;
  if ($conn > 10) {
    ok(!defined($sock), "Failed Connection $conn $sock");
  } else {
    ok(defined($sock), "Connection $conn");
    push(@sockets, $sock);
  }
}


-- 
Paul Lindner        ||||| | | | |  |  |  |   |   |
lindner at inuus.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.danga.com/pipermail/memcached/attachments/20070318/ca9b8e0b/attachment.pgp


More information about the memcached mailing list