Skip to content

Instantly share code, notes, and snippets.

View hfm's full-sized avatar

Okumura Takahiro hfm

View GitHub Profile
FROM centos:7
MAINTAINER OKUMURA Takahiro <[email protected]>
RUN echo -e "[nginx]\n\
name=nginx repo\n\
baseurl=http://nginx.org/packages/mainline/centos/7/\$basearch/\n\
gpgcheck=0\n\
enabled=1\n\
" > /etc/yum.repos.d/nginx.repo
RUN yum install -y nginx
@hfm
hfm / nginx.conf
Last active January 29, 2017 13:43
nginx.confにmruby_stream関連ディレクティブが無いときにSEGVが起きる
nginx version: nginx/1.11.8
built by clang 8.0.0 (clang-800.0.42.1)
built with OpenSSL 1.0.2k 26 Jan 2017
TLS SNI support enabled
configure arguments: --add-module=/Users/hfm/src/github.com/matsumotory/ngx_mruby --add-module=/Users/hfm/src/github.com/matsumotory/ngx_mruby/dependence/ngx_devel_kit --prefix=/Users/hfm/src/github.com/matsumotory/ngx_mruby/build/nginx --with-debug --with-http_stub_status_module --with-http_ssl_module --with-cc-opt='-g -O0' --with-stream
@hfm
hfm / -
Created January 17, 2017 03:38
hello
@hfm
hfm / -
Created December 19, 2016 12:05
worker_processes 1;
events {
worker_connections 200;
}
daemon off;
master_process off;
error_log logs/error.log info;
http {
@hfm
hfm / -
Created December 19, 2016 11:48
diff --git a/build_config.rb b/build_config.rb
index 4e3e90a..047e393 100644
--- a/build_config.rb
+++ b/build_config.rb
@@ -8,6 +8,10 @@
cc.flags << ENV['NGX_MRUBY_CFLAGS'] if ENV['NGX_MRUBY_CFLAGS']
end
+ conf.linker do |linker|
+ linker.option_library << ' -lstdc++'
.git
.DS_Store
.sass-cache
.env
public/
diff --git a/src/http/modules/ngx_http_upstream_hash_module.c b/src/http/modules/ngx_http_upstream_hash_module.c
index 1e2e05c..6c28c64 100644
--- a/src/http/modules/ngx_http_upstream_hash_module.c
+++ b/src/http/modules/ngx_http_upstream_hash_module.c
@@ -242,6 +242,10 @@ ngx_http_upstream_get_hash_peer(ngx_peer_connection_t *pc, void *data)
goto next;
}
+ if (peer->max_conns && peer->conns >= peer->max_conns) {
+ goto next;
@hfm
hfm / upstream.diff
Last active October 21, 2016 07:19
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 7e4b3c5..ceb798f 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -748,6 +748,8 @@ ngx_http_upstream_init_request(ngx_http_request_t *r)
return;
}
+ u->upstream = uscf;
+
This file has been truncated, but you can view the full file.
==61212== Memcheck, a memory error detector
==61212== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==61212== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==61212== Command: build/nginx-1.11.5/objs/nginx
==61212== Parent PID: 69356
==61212==
--61212-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option
--61212-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option (repeated 2 times)
--61212-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option (repeated 4 times)
==61212== Conditional jump or move depends on uninitialised value(s)
This file has been truncated, but you can view the full file.
==56221== Memcheck, a memory error detector
==56221== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==56221== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==56221== Command: build/nginx-1.11.5/objs/nginx
==56221== Parent PID: 69356
==56221==
--56221-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option
--56221-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option (repeated 2 times)
--56221-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option (repeated 4 times)
==56221== Conditional jump or move depends on uninitialised value(s)