Permalink
Browse files

removed the "memc_bind" directive since it breaks 0.8.31.

  • Loading branch information...
1 parent c0b0f0b commit aca281f80e655d72948a4cd2976031f761051939 @agentzh agentzh committed Dec 24, 2009
Showing with 54 additions and 25 deletions.
  1. +0 −11 src/ngx_http_memc_module.c
  2. +1 −1 test/lib/Test/Nginx.pm
  3. +7 −2 test/lib/Test/Nginx/LWP.pm
  4. +7 −2 test/lib/Test/Nginx/Socket.pm
  5. +39 −9 test/lib/Test/Nginx/Util.pm
View
11 src/ngx_http_memc_module.c
@@ -61,17 +61,6 @@ static ngx_command_t ngx_http_memc_commands[] = {
0,
NULL },
-#if defined(nginx_version) && nginx_version >= 8022
-
- { ngx_string("memc_bind"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_upsteam_bind_set_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_memc_loc_conf_t, upstream.local),
- NULL },
-
-#endif
-
{ ngx_string("memc_connect_timeout"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
ngx_conf_set_msec_slot,
View
2 test/lib/Test/Nginx.pm
@@ -3,7 +3,7 @@ package Test::Nginx;
use strict;
use warnings;
-our $VERSION = '0.05';
+our $VERSION = '0.06';
__END__
View
9 test/lib/Test/Nginx/LWP.pm
@@ -4,7 +4,7 @@ use lib 'lib';
use lib 'inc';
use Test::Base -Base;
-our $VERSION = '0.05';
+our $VERSION = '0.06';
use LWP::UserAgent;
use Time::HiRes qw(sleep);
@@ -26,6 +26,8 @@ use Test::Nginx::Util qw(
$RunTestHelper
$NoNginxManager
$RepeatEach
+ worker_connections
+ master_process_enabled
config_preamble
repeat_each
);
@@ -37,7 +39,8 @@ $UserAgent->agent(__PACKAGE__);
#use Smart::Comments::JSON '##';
our @EXPORT = qw( plan run_tests run_test
- repeat_each config_preamble);
+ repeat_each config_preamble worker_connections
+ master_process_enabled);
sub run_test_helper ($);
@@ -360,6 +363,8 @@ The following sections are supported:
=item config
+=item http_config
+
=item request
=item request_headers
View
9 test/lib/Test/Nginx/Socket.pm
@@ -5,7 +5,7 @@ use lib 'inc';
use Test::Base -Base;
-our $VERSION = '0.05';
+our $VERSION = '0.06';
use Data::Dumper;
use Time::HiRes qw(sleep time);
@@ -29,6 +29,8 @@ use Test::Nginx::Util qw(
$ConfFile
$RunTestHelper
$RepeatEach
+ worker_connections
+ master_process_enabled
config_preamble
repeat_each
);
@@ -41,7 +43,8 @@ use IO::Socket;
#our ($PrevRequest, $PrevConfig);
our @EXPORT = qw( plan run_tests run_test
- repeat_each config_preamble);
+ repeat_each config_preamble worker_connections
+ master_process_enabled);
sub send_request ($$$);
@@ -490,6 +493,8 @@ The following sections are supported:
=item config
+=item http_config
+
=item request
=item request_eval
View
48 test/lib/Test/Nginx/Util.pm
@@ -3,7 +3,7 @@ package Test::Nginx::Util;
use strict;
use warnings;
-our $VERSION = '0.05';
+our $VERSION = '0.06';
use base 'Exporter';
@@ -30,6 +30,16 @@ if ($Profiling) {
$ForkManager = new Parallel::ForkManager($MAX_PROCESSES);
}
+our $Workers = 1;
+our $WorkerConnections = 64;
+our $LogLevel = 'debug';
+our $MasterProcessEnabled = 'off';
+our $DaemonEnabled = 'on';
+our $ServerPort = 1984;
+our $ServerPortForClient = 1984;
+#our $ServerPortForClient = 1984;
+
+
sub repeat_each (@) {
if (@_) {
$RepeatEach = shift;
@@ -38,6 +48,22 @@ sub repeat_each (@) {
}
}
+sub worker_connections (@) {
+ if (@_) {
+ $WorkerConnections = shift;
+ } else {
+ return $WorkerConnections;
+ }
+}
+
+sub master_process_enabled (@) {
+ if (@_) {
+ $MasterProcessEnabled = shift() ? 'on' : 'off';
+ } else {
+ return $MasterProcessEnabled;
+ }
+}
+
our @EXPORT_OK = qw(
setup_server_root
write_config_file
@@ -56,18 +82,12 @@ our @EXPORT_OK = qw(
$RunTestHelper
$NoNginxManager
$RepeatEach
+ worker_connections
+ master_process_enabled
config_preamble
repeat_each
);
-our $Workers = 1;
-our $WorkerConnections = 64;
-our $LogLevel = 'debug';
-our $MasterProcessEnabled = 'off';
-our $DaemonEnabled = 'on';
-our $ServerPort = 1984;
-our $ServerPortForClient = 1984;
-#our $ServerPortForClient = 1984;
if ($Profiling) {
$DaemonEnabled = 'off';
@@ -129,6 +149,16 @@ sub setup_server_root () {
die "Failed to do mkdir $LogDir\n";
mkdir $HtmlDir or
die "Failed to do mkdir $HtmlDir\n";
+
+ my $index_file = "$HtmlDir/index.html";
+
+ open my $out, ">$index_file" or
+ die "Can't open $index_file for writing: $!\n";
+
+ print $out '<html><head><title>It works!</title></head><body>It works!</body></html>';
+
+ close $out;
+
mkdir $ConfDir or
die "Failed to do mkdir $ConfDir\n";
}

0 comments on commit aca281f

Please sign in to comment.