Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added even more diagnostics.

  • Loading branch information...
commit 2761222e093601005be346d1af1890230318bbd0 1 parent 3980d08
@agentzh authored
View
15 src/chunked_parser.c
@@ -593,6 +593,13 @@ case 13:
"chunk size %uz, chunk data read %uz, "
"total to disk %uz, "
"raw body size %O, caller \"%s\", "
+ "plain_http %d, "
+
+#if (NGX_HTTP_SSL)
+
+ "ssl %d, "
+#endif
+
"keepalive %d, err ctx \"%s\", "
"ctx ref count %ud, user agent \"%V\", "
"at char '%c' (%d), "
@@ -602,6 +609,14 @@ case 13:
ctx->chunk_size, ctx->chunk_bytes_read,
ctx->chunks_written_size,
(off_t) ctx->raw_body_size, caller_info,
+ (int) r->plain_http,
+
+#if (NGX_HTTP_SSL)
+
+ r->connection->ssl ? 1 : 0,
+
+#endif
+
(int) r->keepalive, err_ctx,
ctx->count, &user_agent,
*p, *p,
View
15 src/chunked_parser.rl
@@ -219,6 +219,13 @@ ngx_http_chunkin_run_chunked_parser(ngx_http_request_t *r,
"chunk size %uz, chunk data read %uz, "
"total to disk %uz, "
"raw body size %O, caller \"%s\", "
+ "plain_http %d, "
+
+#if (NGX_HTTP_SSL)
+
+ "ssl %d, "
+#endif
+
"keepalive %d, err ctx \"%s\", "
"ctx ref count %ud, user agent \"%V\", "
"at char '%c' (%d), "
@@ -228,6 +235,14 @@ ngx_http_chunkin_run_chunked_parser(ngx_http_request_t *r,
ctx->chunk_size, ctx->chunk_bytes_read,
ctx->chunks_written_size,
(off_t) ctx->raw_body_size, caller_info,
+ (int) r->plain_http,
+
+#if (NGX_HTTP_SSL)
+
+ r->connection->ssl ? 1 : 0,
+
+#endif
+
(int) r->keepalive, err_ctx,
ctx->count, &user_agent,
*p, *p,
View
2  src/ngx_http_chunkin_util.c
@@ -1,4 +1,4 @@
-#define DDEBUG 1
+#define DDEBUG 0
#include "ddebug.h"
View
102 test/lib/Test/Nginx/Socket.pm
@@ -15,6 +15,7 @@ use Time::HiRes qw(sleep time);
use Test::LongString;
#use Smart::Comments::JSON '###';
+use POSIX qw( SIGQUIT SIGKILL SIGTERM );
use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK);
use POSIX qw(EAGAIN);
use IO::Socket;
@@ -236,53 +237,6 @@ sub run_test ($) {
die;
}
- if (!$NoNginxManager) {
- my $nginx_is_running = 1;
- if (-f $PidFile) {
- my $pid = get_pid_from_pidfile($name);
- if (system("ps $pid > /dev/null") == 0) {
- write_config_file(\$config);
- if (kill(1, $pid) == 0) { # send HUP signal
- Test::More::BAIL_OUT("$name - Failed to send signal to the nginx process with PID $pid using signal HUP");
- }
- sleep 0.02;
- } else {
- unlink $PidFile or
- die "Failed to remove pid file $PidFile\n";
- undef $nginx_is_running;
- }
- } else {
- undef $nginx_is_running;
- }
-
- unless ($nginx_is_running) {
- warn "*** Restarting the nginx server...\n";
- setup_server_root();
- write_config_file(\$config);
- if ( ! Module::Install::Can->can_run('nginx') ) {
- Test::More::BAIL_OUT("$name - Cannot find the nginx executable in the PATH environment");
- die;
- }
- #if (system("nginx -p $ServRoot -c $ConfFile -t") != 0) {
- #Test::More::BAIL_OUT("$name - Invalid config file");
- #}
- #my $cmd = "nginx -p $ServRoot -c $ConfFile > /dev/null";
-
- my $cmd;
- if ($NginxVersion >= 0.007053) {
- $cmd = "nginx -p $ServRoot/ -c $ConfFile > /dev/null";
- } else {
- $cmd = "nginx -c $ConfFile > /dev/null";
- }
-
- if (system($cmd) != 0) {
- Test::More::BAIL_OUT("$name - Cannot start nginx using command \"$cmd\".");
- die;
- }
- sleep 0.1;
- }
- }
-
my $skip_nginx = $block->skip_nginx;
my ($tests_to_skip, $should_skip, $skip_reason);
if (defined $skip_nginx) {
@@ -294,6 +248,7 @@ sub run_test ($) {
$tests_to_skip = $1;
my ($op, $ver1, $ver2, $ver3) = ($2, $3, $4, $5);
$skip_reason = $6;
+ #warn "$ver1 $ver2 $ver3";
my $ver = get_canon_version($ver1, $ver2, $ver3);
if ((!defined $NginxVersion and $op =~ /^</)
or eval "$NginxVersion $op $ver")
@@ -332,10 +287,63 @@ sub run_test ($) {
die;
}
}
+
if (!defined $todo_reason) {
$todo_reason = "various reasons";
}
+ if (!$NoNginxManager && !$should_skip) {
+ my $nginx_is_running = 1;
+ if (-f $PidFile) {
+ my $pid = get_pid_from_pidfile($name);
+ if (system("ps $pid > /dev/null") == 0) {
+ write_config_file(\$config);
+ if (kill(SIGQUIT, $pid) == 0) { # send quit signal
+ #warn("$name - Failed to send quit signal to the nginx process with PID $pid");
+ }
+ sleep 0.02;
+ if (system("ps $pid > /dev/null") == 0) {
+ #warn "killing with force...\n";
+ kill(SIGKILL, $pid);
+ sleep 0.01;
+ }
+ undef $nginx_is_running;
+ } else {
+ unlink $PidFile or
+ die "Failed to remove pid file $PidFile\n";
+ undef $nginx_is_running;
+ }
+ } else {
+ undef $nginx_is_running;
+ }
+
+ unless ($nginx_is_running) {
+ #warn "*** Restarting the nginx server...\n";
+ setup_server_root();
+ write_config_file(\$config);
+ if ( ! Module::Install::Can->can_run('nginx') ) {
+ Test::More::BAIL_OUT("$name - Cannot find the nginx executable in the PATH environment");
+ die;
+ }
+ #if (system("nginx -p $ServRoot -c $ConfFile -t") != 0) {
+ #Test::More::BAIL_OUT("$name - Invalid config file");
+ #}
+ #my $cmd = "nginx -p $ServRoot -c $ConfFile > /dev/null";
+ my $cmd;
+ if ($NginxVersion >= 0.007053) {
+ $cmd = "nginx -p $ServRoot/ -c $ConfFile > /dev/null";
+ } else {
+ $cmd = "nginx -c $ConfFile > /dev/null";
+ }
+
+ if (system($cmd) != 0) {
+ Test::More::BAIL_OUT("$name - Cannot start nginx using command \"$cmd\".");
+ die;
+ }
+ sleep 0.1;
+ }
+ }
+
my $i = 0;
while ($i++ < $RepeatEach) {
if ($should_skip) {
View
1  util/build.sh
@@ -20,6 +20,7 @@ if [[ "$BUILD_CLEAN" -eq 1 || ! -f Makefile || "$root/config" -nt Makefile || "$
./configure --prefix=/opt/nginx \
--add-module=$root/../echo-nginx-module \
--add-module=$root $opts \
+ --with-http_ssl_module \
--with-debug
#--without-http_ssi_module # we cannot disable ssi because echo_location_async depends on it (i dunno why?!)
Please sign in to comment.
Something went wrong with that request. Please try again.