ports/185836: new port www/tengine

Jim Ohlstein jim at selenium.jlkhosting.com
Fri Jan 17 05:10:00 UTC 2014


>Number:         185836
>Category:       ports
>Synopsis:       new port www/tengine
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 17 05:10:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Jim Ohlstein
>Release:        FreeBSD 10.0-PRERELEASE amd64
>Organization:
JLK Hosting
>Environment:
System: FreeBSD selenium.jlkhosting.com 10.0-PRERELEASE FreeBSD 10.0-PRERELEASE #0 r260431: Tue Jan 7 21:59:51 EST 2014 root at selenium.jlkhosting.com:/usr/obj/usr/src/sys/SELENIUMKERNEL amd64


>Description:
	Tengine is a fork of the popular web server nginx with enhanced features including support for DSO's. This is the development branch which has added support for SPDYv3 and other features not yet found in nginx.
>How-To-Repeat:
	
>Fix:

	

--- tengine-devel.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	tengine-devel
#	tengine-devel/pkg-descr
#	tengine-devel/Makefile
#	tengine-devel/files
#	tengine-devel/files/extra-patch-nginx-modsecurity-config
#	tengine-devel/files/extra-patch-calio-iconv-nginx-module-config
#	tengine-devel/files/extra-patch-ngx_http_notice_module.c
#	tengine-devel/files/extra-patch-ngx_http_upstream.h
#	tengine-devel/files/extra-patch-ngx_http_upload_module.c
#	tengine-devel/files/patch-man-nginx
#	tengine-devel/files/extra-patch-ngx_http_sflow_config.h
#	tengine-devel/files/extra-patch-agentzh-set-misc-nginx-module-config
#	tengine-devel/files/patch-conf-nginx.conf
#	tengine-devel/files/extra-patch-ngx_http_sflow_config.c
#	tengine-devel/files/extra-patch-chaoslawful-drizzle-nginx-module-config
#	tengine-devel/files/nginx.in
#	tengine-devel/files/extra-patch-ngx_postgres-config
#	tengine-devel/pkg-plist
#	tengine-devel/distinfo
#
echo c - tengine-devel
mkdir -p tengine-devel > /dev/null 2>&1
echo x - tengine-devel/pkg-descr
sed 's/^X//' >tengine-devel/pkg-descr << 'c6d89fb3be76d928a7a82e85ea33d365'
XNGINX is a high performance edge web server with the lowest memory footprint
Xand the key features to build modern and efficient web infrastructure.
X
XNGINX functionality includes HTTP server, HTTP and mail reverse proxy, caching,
Xload balancing, compression, request throttling, connection multiplexing and
Xreuse, SSL offload and HTTP media streaming.
X
XTENGINE is a fork of nginx byTaoBao.
X
XWWW: http://tengine.taobao.org/
XWWW: http://nginx.org/
XWWW: http://nginx.com/
c6d89fb3be76d928a7a82e85ea33d365
echo x - tengine-devel/Makefile
sed 's/^X//' >tengine-devel/Makefile << 'e276eaee7b2aa48194b2eabdfaa57ffd'
X# Created by: Jim Ohlstein <jim at ohlste.in>
X# $FreeBSD$
X
XPORTNAME=	tengine
XPORTVERSION=	2.0.0
XCATEGORIES=	www
XMASTER_SITES=	https://github.com/alibaba/${PORTNAME}/archive/:${PORTNAME}
XPKGNAMESUFFIX=	-devel
XDISTFILES=	${DISTNAME}${EXTRACT_SUFX}:${PORTNAME}
X
XMAINTAINER=	jim at ohlste.in
XCOMMENT=	Robust and small WWW server forked from nginx by Taobao
X
XLICENSE=	BSD2CLAUSE
X
XWRKSRC=	${WRKDIR}/${PORTNAME}-${PORTNAME}-${PORTVERSION}
X
XUSE_GNOME=	libxml2 \
X		libxslt
X
XLIB_DEPENDS+=	libluajit-5.1.so:${PORTSDIR}/lang/luajit \
X			libgd.so:${PORTSDIR}/graphics/gd \
X			libGeoIP.so:${PORTSDIR}/net/GeoIP
X
XNO_OPTIONS_SORT=	yes
XOPTIONS_DEFINE=	\
X	DEBUG \
X	DEBUGLOG \
X	FILE_AIO \
X	IPV6 \
X	HTTP \
X	HTTP_CACHE \
X	HTTP_DAV \
X	HTTP_GZIP_STATIC \
X	HTTP_GUNZIP \
X	HTTP_PERL \
X	HTTP_REALIP \
X	HTTP_REWRITE \
X	HTTP_SSL \
X	HTTP_STATUS \
X	MAIL \
X	MAIL_IMAP \
X	MAIL_POP3 \
X	MAIL_SMTP \
X	MAIL_SSL \
X	SPDY \
X	CPP_TEST \
X	TFS \
X	WWW \
X	CACHE_PURGE \
X	ECHO \
X	HEADERS_MORE \
X	HTTP_ACCEPT_LANGUAGE \
X	HTTP_ACCESSKEY \
X	HTTP_AUTH_DIGEST \
X	HTTP_AUTH_LDAP \
X	HTTP_AUTH_PAM \
X	HTTP_AUTH_REQ \
X	HTTP_DAV_EXT \
X	HTTP_EVAL \
X	HTTP_FANCYINDEX \
X	HTTP_MOGILEFS \
X	HTTP_NOTICE \
X	HTTP_PUSH \
X	HTTP_PUSH_STREAM \
X	HTTP_REDIS \
X	HTTP_RESPONSE \
X	HTTP_UPLOAD \
X	HTTP_UPLOAD_PROGRESS \
X	HTTP_UPSTREAM_FAIR \
X	HTTP_VIDEO_THUMBEXTRACTOR \
X	HTTP_ZIP \
X	ARRAYVAR \
X	DRIZZLE \
X	ENCRYPTSESSION \
X	FORMINPUT \
X	GRIDFS \
X	ICONV \
X	LET \
X	MEMC \
X	MODSECURITY \
X	POSTGRES \
X	RDS_CSV \
X	RDS_JSON \
X	REDIS2 \
X	RTMP \
X	SET_MISC \
X	SFLOW \
X	SLOWFS_CACHE \
X	SRCACHE \
X	SUPERVISORD \
X	TCP_PROXY \
X	XRID_HEADER \
X	XSS
X
XOPTIONS_DEFAULT=	IPV6 HTTP HTTP_CACHE HTTP_REWRITE HTTP_STATUS WWW
X
XDEBUGLOG_DESC=			Enable debug log (--with-debug)
XFILE_AIO_DESC=			Enable file aio
XHTTP_DESC=			Enable HTTP module
XHTTP_CACHE_DESC=		Enable http_cache module
XHTTP_DAV_DESC=			Enable http_webdav module
XHTTP_GZIP_STATIC_DESC=		Enable http_gzip_static module
XHTTP_GUNZIP_DESC=	Enable http_gunzip module
XHTTP_PERL_DESC=			Enable http_perl module
XHTTP_REALIP_DESC=		Enable http_realip module
XHTTP_REWRITE_DESC=			Enable http_rewrite module
XHTTP_SSL_DESC=			Enable http_ssl module
XHTTP_STATUS_DESC=		Enable http_stub_status module
XMAIL_DESC=			Enable IMAP4/POP3/SMTP proxy module
XMAIL_IMAP_DESC=			Enable IMAP4 proxy module
XMAIL_POP3_DESC=			Enable POP3 proxy module
XMAIL_SMTP_DESC=			Enable SMTP proxy module
XMAIL_SSL_DESC=			Enable mail_ssl module
XSPDY_DESC=			Enable SPDY v3 protocol support (SSL req.)
XCPP_TEST_DESC=			Enable CPP Test module
XTFS_DESC=			Enable TaoBao File System
XWWW_DESC=			Enable html sample files
XCACHE_PURGE_DESC=		3rd party cache_purge module
XECHO_DESC=			3rd party echo module
XHEADERS_MORE_DESC=		3rd party headers_more module
XHTTP_ACCEPT_LANGUAGE_DESC=	3rd party accept_language module
XHTTP_ACCESSKEY_DESC=		3rd party http_accesskey module
XHTTP_AUTH_DIGEST_DESC=		3rd party http_authdigest module
XHTTP_AUTH_LDAP_DESC=		3rd party http_auth_ldap module
XHTTP_AUTH_PAM_DESC=		3rd party http_auth_pam module
XHTTP_AUTH_REQ_DESC=		3rd party http_auth_request module
XHTTP_DAV_EXT_DESC=		3rd party webdav_ext module
XHTTP_EVAL_DESC=			3rd party eval module
XHTTP_FANCYINDEX_DESC=		3rd party http_fancyindex module
XHTTP_MOGILEFS_DESC=		3rd party mogilefs module
XHTTP_NOTICE_DESC=		3rd party notice module
XHTTP_PUSH_DESC=			3rd party push module
XHTTP_PUSH_STREAM_DESC=		3rd party push stream module
XHTTP_REDIS_DESC=		3rd party http_redis module
XHTTP_RESPONSE_DESC=		3rd party http_response module
XHTTP_UPLOAD_DESC=		3rd party upload module
XHTTP_UPLOAD_PROGRESS_DESC=	3rd party uploadprogress module
XHTTP_UPSTREAM_FAIR_DESC=	3rd party upstream fair module
XHTTP_VIDEO_THUMBEXTRACTOR_DESC=		3rd party video_thumbextractor module
XHTTP_ZIP_DESC=			3rd party http_zip module
XARRAYVAR_DESC=			3rd party array_var module
XDRIZZLE_DESC=			3rd party drizzlie module
XENCRYPTSESSION_DESC=		3rd party encrypted_session module
XFORMINPUT_DESC=			3rd party form_input module
XGRIDFS_DESC=			3rd party gridfs module
XICONV_DESC=				3rd party iconv module
XLET_DESC=			3rd party let module
XMEMC_DESC=			3rd party memc (memcached) module
XMODSECURITY_DESC=		3rd party mod_security module
XPOSTGRES_DESC=			3rd party postgresql module
XRDS_CSV_DESC=			3rd party rds_csv module
XRDS_JSON_DESC=			3rd party rds_json module
XREDIS2_DESC=			3rd party redis2 module
XRTMP_DESC=			3rd party rtmp module
XSET_MISC_DESC=			3rd party set_misc module
XSFLOW_DESC=			3rd party sflow module
XSLOWFS_CACHE_DESC=		3rd party slowfs_cache module
XSRCACHE_DESC=			3rd party srcache module
XSUPERVISORD_DESC=		3rd party supervisord module
XTCP_PROXY_DESC=			3rd party tcp_proxy module
XXRID_HEADER_DESC=		3rd party x-rid header module
XXSS_DESC=			3rd party xss module
X
XWANT_GNOME=	yes
X
X.include <bsd.port.options.mk>
X
X# FreeBSD 8 and earlier are unsupported
X.if ${OSVERSION} < 900500
XIGNORE=	is unsupported on FreeBSD 8 and earlier
X.endif
X
XNGINX_VARDIR?=	/var
XNGINX_LOGDIR?=	${NGINX_VARDIR}/log
XNGINX_RUNDIR?=	${NGINX_VARDIR}/run
XNGINX_TMPDIR?=	${NGINX_VARDIR}/tmp/nginx
XHTTP_PORT?=	80
X
XNGINX_ACCESSLOG?=	${NGINX_LOGDIR}/nginx-access.log
XNGINX_ERRORLOG?=	${NGINX_LOGDIR}/nginx-error.log
X
XCONFLICTS?=	tengine-[0-9].* nginx-devel-[0-9].* nginx-[0-9].*
X
XUSE_RC_SUBR=	nginx
XSUB_LIST+=	WWWOWN=${WWWOWN} \
X		WWWGRP=${WWWGRP} \
X		NGINX_RUNDIR=${NGINX_RUNDIR} \
X		NGINX_TMPDIR=${NGINX_TMPDIR}
X
XHAS_CONFIGURE=	yes
XCONFIGURE_ARGS+=--prefix=${ETCDIR} \
X		--with-cc-opt="-I ${LOCALBASE}/include" \
X		--with-ld-opt="-L ${LOCALBASE}/lib" \
X		--conf-path=${ETCDIR}/nginx.conf \
X		--sbin-path=${PREFIX}/sbin/nginx \
X		--pid-path=${NGINX_RUNDIR}/nginx.pid \
X		--error-log-path=${NGINX_ERRORLOG} \
X		--user=${WWWOWN} --group=${WWWGRP}
X
X.if empty(PORT_OPTIONS:MHTTP) && empty(PORT_OPTIONS:MMAIL)
XIGNORE=		requires at least HTTP or MAIL to \
X		be defined.  Please do 'make config' again
X.endif
X
X.if ${PORT_OPTIONS:MDEBUG}
XCFLAGS+=	-g
XSTRIP=		#Do not strip if nginx with debug information
X.endif
X
X.if ${PORT_OPTIONS:MDEBUGLOG}
XCONFIGURE_ARGS+=--with-debug
X.endif
X
X.if ${PORT_OPTIONS:MFILE_AIO}
XCONFIGURE_ARGS+=--with-file-aio
X.endif
X
X.if ${PORT_OPTIONS:MIPV6}
XCONFIGURE_ARGS+=--with-ipv6
XCATEGORIES+=	ipv6
X.endif
X
X.if ${PORT_OPTIONS:MHTTP}
XCONFIGURE_ARGS+=--dso-path=${ETCDIR}/modules \
X		--with-http_access_module=shared \
X		--with-http_addition_module=shared \
X		--with-http_autoindex_module=shared \
X		--with-http_browser_module=shared \
X		--with-http_charset_filter_module=shared \
X		--with-http_concat_module=shared \
X		--with-http_empty_gif_module=shared \
X		--with-http_fastcgi_module=shared \
X		--with-http_flv_module=shared \
X		--with-http_footer_filter_module=shared \
X		--with-http_geoip_module=shared \
X		--with-http_image_filter_module=shared \
X		--with-http_limit_conn_module=shared \
X		--with-http_limit_req_module=shared \
X		--with-http_lua_module=shared \
X		--with-http_map_module=shared \
X		--with-http_memcached_module=shared \
X		--with-http_mp4_module=shared \
X		--with-http_random_index_module=shared \
X		--with-http_referer_module=shared \
X		--with-http_scgi_module=shared \
X		--with-http_secure_link_module=shared \
X		--with-http_slice_module=shared \
X		--with-http_split_clients_module=shared \
X		--with-http_sub_module=shared \
X		--with-http_sysguard_module=shared \
X		--with-http_trim_filter_module=shared \
X		--with-http_upstream_ip_hash_module=shared \
X		--with-http_upstream_least_conn_module=shared \
X		--with-http_upstream_session_sticky_module=shared \
X		--with-http_user_agent_module=shared \
X		--with-http_userid_filter_module=shared \
X		--with-http_uwsgi_module=shared \
X		--with-http_xslt_module=shared \
X		--http-client-body-temp-path=${NGINX_TMPDIR}/client_body_temp \
X		--http-fastcgi-temp-path=${NGINX_TMPDIR}/fastcgi_temp \
X		--http-proxy-temp-path=${NGINX_TMPDIR}/proxy_temp \
X		--http-scgi-temp-path=${NGINX_TMPDIR}/scgi_temp \
X		--http-uwsgi-temp-path=${NGINX_TMPDIR}/uwsgi_temp \
X		--http-log-path=${NGINX_ACCESSLOG}
X
X.if ${PORT_OPTIONS:MHTTP_ACCEPT_LANGUAGE}
XGIT_ACCEPT_LANGUAGE_VERSION=	2f69842
XMASTER_SITES+=	https://github.com/giom/nginx_accept_language_module/tarball/master/:accept_language
XDISTFILES+=	giom-nginx_accept_language_module-${GIT_ACCEPT_LANGUAGE_VERSION}.tar.gz:accept_language
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/giom-nginx_accept_language_module-${GIT_ACCEPT_LANGUAGE_VERSION}
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_ACCESSKEY}
XNGINX_ACCESSKEY_VERSION=	2.0.3
XMASTER_SITES+=	${MASTER_SITE_LOCAL:S/$/:accesskey/}
XMASTER_SITE_SUBDIR+=	osa/:accesskey
XDISTFILES+=	nginx-accesskey-${NGINX_ACCESSKEY_VERSION}.tar.gz:accesskey
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/nginx-accesskey-${NGINX_ACCESSKEY_VERSION}
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_AUTH_DIGEST}
XGIT_AUTH_DIGEST_VERSION=	bd1c86a
XMASTER_SITES+=	https://github.com/samizdatco/nginx-http-auth-digest/tarball/master/:auth_digest
XDISTFILES+=	samizdatco-nginx-http-auth-digest-${GIT_AUTH_DIGEST_VERSION}.tar.gz:auth_digest
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/samizdatco-nginx-http-auth-digest-${GIT_AUTH_DIGEST_VERSION}
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_GZIP_STATIC}
XCONFIGURE_ARGS+=--with-http_gzip_static_module
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_AUTH_LDAP}
X# WWW: https://github.com/kvspb/nginx-auth-ldap
XGIT_HTTP_AUTH_LDAP_VERSION=	c4dc7c9153
XMASTER_SITES+=	LOCAL/rm:http_auth_ldap
XDISTFILES+=	http_auth_ldap-${GIT_HTTP_AUTH_LDAP_VERSION}.tar.gz:http_auth_ldap
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/http_auth_ldap-${GIT_HTTP_AUTH_LDAP_VERSION}
XUSE_OPENLDAP=	yes
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_AUTH_PAM}
XNGINX_AUTH_PAM_VERSION=	1.2
XMASTER_SITES+=	http://web.iti.upv.es/~sto/nginx/:auth_pam
XDISTFILES+=	ngx_http_auth_pam_module-${NGINX_AUTH_PAM_VERSION}.tar.gz:auth_pam
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/ngx_http_auth_pam_module-${NGINX_AUTH_PAM_VERSION}
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_AUTH_REQ}
XNGINX_AUTH_REQ_VERSION=	0.2
XMASTER_SITES+=	http://mdounin.ru/files/:auth_request
XDISTFILES+=	ngx_http_auth_request_module-${NGINX_AUTH_REQ_VERSION}.tar.gz:auth_request
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/ngx_http_auth_request_module-${NGINX_AUTH_REQ_VERSION}
X.endif
X
X.if empty(PORT_OPTIONS:MHTTP_CACHE)
XCONFIGURE_ARGS+=--without-http-cache
X.endif
X
X.if ${PORT_OPTIONS:MCACHE_PURGE}
XNGINX_CACHE_PURGE_VERSION=	2.1
XMASTER_SITES+=	http://labs.frickle.com/files/:cache_purge
XDISTFILES+=	ngx_cache_purge-${NGINX_CACHE_PURGE_VERSION}.tar.gz:cache_purge
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/ngx_cache_purge-${NGINX_CACHE_PURGE_VERSION}
X.endif
X
X.if ${PORT_OPTIONS:MECHO}
XNGINX_ECHO_VERSION=	0.50
XGIT_ECHO_VERSION=	0-gf827a4f
XMASTER_SITES+=	https://github.com/agentzh/echo-nginx-module/tarball/v${NGINX_ECHO_VERSION}/:echo
XDISTFILES+=	agentzh-echo-nginx-module-v${NGINX_ECHO_VERSION}-${GIT_ECHO_VERSION}.tar.gz:echo
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/agentzh-echo-nginx-module-${GIT_ECHO_VERSION:S/^0-g//}
X.endif
X
X.if ${PORT_OPTIONS:MHEADERS_MORE}
XNGINX_HEADERS_MORE_VERSION=	0.24
XGIT_HEADERS_MORE_VERSION=	0-g7a6fd11
XMASTER_SITES+=	https://github.com/agentzh/headers-more-nginx-module/tarball/v${NGINX_HEADERS_MORE_VERSION}/:headers_more
XDISTFILES+=	agentzh-headers-more-nginx-module-v${NGINX_HEADERS_MORE_VERSION}-${GIT_HEADERS_MORE_VERSION}.tar.gz:headers_more
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/agentzh-headers-more-nginx-module-${GIT_HEADERS_MORE_VERSION:S/^0-g//}
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_DAV}
XCONFIGURE_ARGS+=--with-http_dav_module
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_DAV_EXT}
XLIB_DEPENDS+=	libexpat.so:${PORTSDIR}/textproc/expat2
XNGINX_DAV_EXT_VERSION=	0.0.2
XGIT_DAV_EXT_VERSION=	0-g0e07a3e
XMASTER_SITES+=	https://github.com/arut/nginx-dav-ext-module/tarball/v${NGINX_DAV_EXT_VERSION}/:dav_ext
XDISTFILES+=	arut-nginx-dav-ext-module-v${NGINX_DAV_EXT_VERSION}-${GIT_DAV_EXT_VERSION}.tar.gz:dav_ext
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/arut-nginx-dav-ext-module-${GIT_DAV_EXT_VERSION:S/^0-g//} \
X		--with-http_dav_module
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_EVAL}
XNGINX_EVAL_VERSION=	1.0.3
XGIT_EVAL_VERSION=	0-g125fa2e
XMASTER_SITES+=	https://github.com/vkholodkov/nginx-eval-module/tarball/${NGINX_EVAL_VERSION}/:eval
XDISTFILES+=	vkholodkov-nginx-eval-module-${NGINX_EVAL_VERSION}-${GIT_EVAL_VERSION}.tar.gz:eval
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/vkholodkov-nginx-eval-module-${GIT_EVAL_VERSION:S/^0-g//}
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_FANCYINDEX}
XNGINX_FANCYINDEX_VERSION=	0.3.1
XMASTER_SITES+=	${MASTER_SITE_LOCAL:S/$/:fancyindex/}
XMASTER_SITE_SUBDIR+=	osa/:fancyindex
XDISTFILES+=	ngx-fancyindex-${NGINX_FANCYINDEX_VERSION}.tar.gz:fancyindex
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/ngx-fancyindex-${NGINX_FANCYINDEX_VERSION}
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_GZIP_STATIC}
XCONFIGURE_ARGS+=--with-http_gzip_static_module
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_GUNZIP}
XCONFIGURE_ARGS+=--with-http_gunzip_module
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_MOGILEFS}
XNGINX_MOGILEFS_VERSION=	1.0.4
XMASTER_SITES+=	http://www.grid.net.ru/nginx/download/:mogilefs
XDISTFILES+=	nginx_mogilefs_module-${NGINX_MOGILEFS_VERSION}.tar.gz:mogilefs
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/nginx_mogilefs_module-${NGINX_MOGILEFS_VERSION}
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_NOTICE}
XGIT_NOTICE_VERSION=	0-g3c95966
XMASTER_SITES+=	https://github.com/kr/nginx-notice/tarball/master/:notice
XDISTFILES+=	kr-nginx-notice-${GIT_NOTICE_VERSION}.tar.gz:notice
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/kr-nginx-notice-${GIT_NOTICE_VERSION:S/^0-g//}
XEXTRA_PATCHES+=	${PATCHDIR}/extra-patch-ngx_http_notice_module.c
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_PERL}
XCATEGORIES+=	perl5
XCONFIGURE_ARGS+=--with-http_perl_module
XUSES+=		perl5
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_PUSH}
XNGINX_PUSH_VERSION=	0.692
XMASTER_SITES+=	http://pushmodule.slact.net/downloads/:push
XDISTFILES+=	nginx_http_push_module-${NGINX_PUSH_VERSION}.tar.gz:push
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/nginx_http_push_module-${NGINX_PUSH_VERSION}
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_PUSH_STREAM}
XNGINX_PUSH_STREAM_VERSION=	0.3.5
XGIT_PUSH_STREAM_VERSION=	0-gb6a8c46
XMASTER_SITES+=	https://github.com/wandenberg/nginx-push-stream-module/tarball/${NGINX_PUSH_STREAM_VERSION}/:pushstream
XDISTFILES+=	wandenberg-nginx-push-stream-module-${NGINX_PUSH_STREAM_VERSION}-${GIT_PUSH_STREAM_VERSION}.tar.gz:pushstream
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/wandenberg-nginx-push-stream-module-${GIT_PUSH_STREAM_VERSION:S/^0-g//}
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_REALIP}
XCONFIGURE_ARGS+=--with-http_realip_module
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_REDIS}
XNGINX_REDIS_VERSION=	0.3.7
XMASTER_SITES+=	${MASTER_SITE_LOCAL:S/$/:redis/}
XMASTER_SITE_SUBDIR+=	osa/:redis
XDISTFILES+=	ngx_http_redis-${NGINX_REDIS_VERSION}.tar.gz:redis
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/ngx_http_redis-${NGINX_REDIS_VERSION}
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_RESPONSE}
XNGINX_RESPONSE_VERSION=	0.3
XMASTER_SITES+=	http://catap.ru/downloads/nginx/:response
XDISTFILES+=	ngx_http_response-${NGINX_RESPONSE_VERSION}.tar.gz:response
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/ngx_http_response-${NGINX_RESPONSE_VERSION}
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_STATUS}
XCONFIGURE_ARGS+=--with-http_stub_status_module
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_UPLOAD}
XNGINX_UPLOAD_VERSION=	2.2.0
XMASTER_SITES+=	http://www.grid.net.ru/nginx/download/:upload
XDISTFILES+=	nginx_upload_module-${NGINX_UPLOAD_VERSION}.tar.gz:upload
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/nginx_upload_module-${NGINX_UPLOAD_VERSION}
XEXTRA_PATCHES+=	${PATCHDIR}/extra-patch-ngx_http_upload_module.c
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_UPLOAD_PROGRESS}
XNGINX_UPLOADPROGRESS_VERSION=	0.9.0
XGIT_UPLOADPROGRESS_VERSION=	0-ga788dea
XMASTER_SITES+=	https://github.com/masterzen/nginx-upload-progress-module/tarball/v${NGINX_UPLOADPROGRESS_VERSION}/:uploadprogress
XDISTFILES+=	masterzen-nginx-upload-progress-module-v${NGINX_UPLOADPROGRESS_VERSION}-${GIT_UPLOADPROGRESS_VERSION}.tar.gz:uploadprogress
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/masterzen-nginx-upload-progress-module-${GIT_UPLOADPROGRESS_VERSION:S/^0-g//}
X.endif
X
X.if !empty(PORT_OPTIONS:MHTTP_UPSTREAM_FAIR) || !empty(PORT_OPTIONS:MSUPERVISORD)
XNGINX_UPSTREAM_FAIR_VERSION=	20090923
XMASTER_SITES+=	${MASTER_SITE_LOCAL:S/$/:upstreamfair/}
XMASTER_SITE_SUBDIR+=	osa/:upstreamfair
XDISTFILES+=	nginx_upstream_fair-${NGINX_UPSTREAM_FAIR_VERSION}.tar.gz:upstreamfair
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/nginx_upstream_fair-${NGINX_UPSTREAM_FAIR_VERSION}
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_VIDEO_THUMBEXTRACTOR}
XLIB_DEPENDS+=	libjpeg.so:${PORTSDIR}/graphics/jpeg \
X			libavformat.so:${PORTSDIR}/multimedia/ffmpeg \
X			libavcodec.so:${PORTSDIR}/multimedia/ffmpeg \
X			libavutil.so:${PORTSDIR}/multimedia/ffmpeg \
X			libswscale.so:${PORTSDIR}/multimedia/ffmpeg \
X			libMagickWand.so:${PORTSDIR}/graphics/ImageMagick
XNGINX_VIDEO_THUMBEXTRACTOR_VERSION=	0.2.0
XGIT_VIDEO_THUMBEXTRACTOR_VERSION=	0-g9406457
XMASTER_SITES+=	https://github.com/wandenberg/nginx-video-thumbextractor-module/tarball/${NGINX_VIDEO_THUMBEXTRACTOR_VERSION}/:videothumbextractor
XDISTFILES+=	wandenberg-nginx-video-thumbextractor-module-${NGINX_VIDEO_THUMBEXTRACTOR_VERSION}-${GIT_VIDEO_THUMBEXTRACTOR_VERSION}.tar.gz:videothumbextractor
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/wandenberg-nginx-video-thumbextractor-module-${GIT_VIDEO_THUMBEXTRACTOR_VERSION:S/^0-g//} \
X			--with-cc-opt="-I ${LOCALBASE}/include -I ${LOCALBASE}/include/ImageMagick"
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_ZIP}
XNGINX_ZIP_VERSION=	1.1.6
XMASTER_SITES+=	http://mod-zip.googlecode.com/files/:zip
XDISTFILES+=	mod_zip-${NGINX_ZIP_VERSION}.tar.gz:zip
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/mod_zip-${NGINX_ZIP_VERSION}
X.endif
X
X.if ${PORT_OPTIONS:MDRIZZLE}
XLIB_DEPENDS+=	libdrizzle.so:${PORTSDIR}/databases/libdrizzle
XNGINX_DRIZZLE_VERSION=	0.1.6
XGIT_DRIZZLE_VERSION=	0-ge6937ba
XMASTER_SITES+=	https://github.com/chaoslawful/drizzle-nginx-module/tarball/v${NGINX_DRIZZLE_VERSION}/:drizzle
XDISTFILES+=	chaoslawful-drizzle-nginx-module-v${NGINX_DRIZZLE_VERSION}-${GIT_DRIZZLE_VERSION}.tar.gz:drizzle
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/chaoslawful-drizzle-nginx-module-${GIT_DRIZZLE_VERSION:S/^0-g//}
XEXTRA_PATCHES+=	${PATCHDIR}/extra-patch-chaoslawful-drizzle-nginx-module-config
X.endif
X
X.if ${PORT_OPTIONS:MARRAYVAR} || ${PORT_OPTIONS:MENCRYPTSESSION} || ${PORT_OPTIONS:MFORMINPUT} || ${PORT_OPTIONS:MICONV} || ${PORT_OPTIONS:MSET_MISC}
XWITH_HTTP_REWRITE=	yes
XNGINX_DEVEL_KIT_VERSION=	0.2.19
XGIT_DEVEL_KIT_VERSION=	0-g8dd0df5
XMASTER_SITES+=	https://github.com/simpl/ngx_devel_kit/tarball/v${NGINX_DEVEL_KIT_VERSION}/:devel_kit
XDISTFILES+=	simpl-ngx_devel_kit-v${NGINX_DEVEL_KIT_VERSION}-${GIT_DEVEL_KIT_VERSION}.tar.gz:devel_kit
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/simpl-ngx_devel_kit-${GIT_DEVEL_KIT_VERSION:S/^0-g//}
X.endif
X
X.if ${PORT_OPTIONS:MENCRYPTSESSION}
XNGINX_ENCRYPTSESSION_VERSION=	0.03
XGIT_ENCRYPTSESSION_VERSION=	0-g49d741b
XMASTER_SITES+=	https://github.com/agentzh/encrypted-session-nginx-module/tarball/v${NGINX_ENCRYPTSESSION_VERSION}/:encryptsession
XDISTFILES+=	agentzh-encrypted-session-nginx-module-v${NGINX_ENCRYPTSESSION_VERSION}-${GIT_ENCRYPTSESSION_VERSION}.tar.gz:encryptsession
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/agentzh-encrypted-session-nginx-module-${GIT_ENCRYPTSESSION_VERSION:S/^0-g//}
X.endif
X
X.if ${PORT_OPTIONS:MGRIDFS}
XNGINX_GRIDFS_VERSION=	0.8
XGIT_GRIDFS_VERSION=	0-gb5f8113
XMONGO_C_DRIVER_VERSION=		0.3.1
XGIT_MONGO_C_DRIVER_VERSION=	0-g9b4b232
XMASTER_SITES+=	https://github.com/mdirolf/nginx-gridfs/tarball/v${NGINX_GRIDFS_VERSION}/:gridfs
XMASTER_SITES+=	https://github.com/mongodb/mongo-c-driver/tarball/v${MONGO_C_DRIVER_VERSION}/:mongo_c
XDISTFILES+=	mdirolf-nginx-gridfs-v${NGINX_GRIDFS_VERSION}-${GIT_GRIDFS_VERSION}.tar.gz:gridfs
XDISTFILES+=	mongodb-mongo-c-driver-v${MONGO_C_DRIVER_VERSION}-${GIT_MONGO_C_DRIVER_VERSION}.tar.gz:mongo_c
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/mdirolf-nginx-gridfs-${GIT_GRIDFS_VERSION:S/^0-g//}
X.endif
X
X.if ${PORT_OPTIONS:MLET}
XNGINX_LET_VERSION=	0.0.4
XGIT_LET_VERSION=	0-ga5e1dc5
XMASTER_SITES+=	https://github.com/arut/nginx-let-module/tarball/v${NGINX_LET_VERSION}/:let
XDISTFILES+=	arut-nginx-let-module-v${NGINX_LET_VERSION}-${GIT_LET_VERSION}.tar.gz:let
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/arut-nginx-let-module-${GIT_LET_VERSION:S/^0-g//}
X.endif
X
X.if ${PORT_OPTIONS:MMEMC}
XNGINX_MEMC_VERSION=	0.14
XGIT_MEMC_VERSION=	0-gde4cf86
XMASTER_SITES+=	https://github.com/agentzh/memc-nginx-module/tarball/v${NGINX_MEMC_VERSION}/:memc
XDISTFILES+=	agentzh-memc-nginx-module-v${NGINX_MEMC_VERSION}-${GIT_MEMC_VERSION}.tar.gz:memc
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/agentzh-memc-nginx-module-${GIT_MEMC_VERSION:S/^0-g//}
X.endif
X
X.if ${PORT_OPTIONS:MMODSECURITY}
XNGINX_MODSECURITY_VERSION=	2.7.5
XLIB_DEPENDS+=	libpcre.so:${PORTSDIR}/devel/pcre \
X	libcurl.so:${PORTSDIR}/ftp/curl \
X	libapr-1.so:${PORTSDIR}/devel/apr1
XUSE_APACHE=	22+
XMASTER_SITES+=	http://www.modsecurity.org/tarball/${NGINX_MODSECURITY_VERSION}/:modsecurity
XDISTFILES+=	modsecurity-apache_${NGINX_MODSECURITY_VERSION}.tar.gz:modsecurity
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/modsecurity-apache_${NGINX_MODSECURITY_VERSION}/nginx/modsecurity
XEXTRA_PATCHES+=	${PATCHDIR}/extra-patch-nginx-modsecurity-config
X.endif
X
X.if ${PORT_OPTIONS:MHTTP_REWRITE}
XWITH_HTTP_REWRITE=	yes
X.endif
X
X.if ${PORT_OPTIONS:MPOSTGRES}
XUSE_PGSQL=	yes
XWITH_HTTP_REWRITE=	yes
XNGINX_POSTGRES_VERSION=	0.9
XMASTER_SITES+=	http://labs.frickle.com/files/:postgres
XDISTFILES+=	ngx_postgres-${NGINX_POSTGRES_VERSION}.tar.gz:postgres
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/ngx_postgres-${NGINX_POSTGRES_VERSION}
XEXTRA_PATCHES+=	${PATCHDIR}/extra-patch-ngx_postgres-config
X.endif
X
X.if ${PORT_OPTIONS:MRDS_CSV}
XNGINX_RDS_CSV_VERSION=	0.05
XGIT_RDS_CSV_VERSION=	0-g607e26b
XMASTER_SITES+=	https://github.com/agentzh/rds-csv-nginx-module/tarball/v${NGINX_RDS_CSV_VERSION}/:rdscsv
XDISTFILES+=	agentzh-rds-csv-nginx-module-v${NGINX_RDS_CSV_VERSION}-${GIT_RDS_CSV_VERSION}.tar.gz:rdscsv
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/agentzh-rds-csv-nginx-module-${GIT_RDS_CSV_VERSION:S/^0-g//}
X.endif
X
X.if ${PORT_OPTIONS:MRDS_JSON}
XNGINX_RDS_JSON_VERSION=	0.13
XGIT_RDS_JSON_VERSION=	0-g8292070
XMASTER_SITES+=	https://github.com/agentzh/rds-json-nginx-module/tarball/v${NGINX_RDS_JSON_VERSION}/:rdsjson
XDISTFILES+=	agentzh-rds-json-nginx-module-v${NGINX_RDS_JSON_VERSION}-${GIT_RDS_JSON_VERSION}.tar.gz:rdsjson
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/agentzh-rds-json-nginx-module-${GIT_RDS_JSON_VERSION:S/^0-g//}
X.endif
X
X.if ${PORT_OPTIONS:MREDIS2}
XNGINX_REDIS2_VERSION=	0.10
XGIT_REDIS2_VERSION=	0-g78a7622
XMASTER_SITES+=	https://github.com/agentzh/redis2-nginx-module/tarball/v${NGINX_REDIS2_VERSION}/:redis2
XDISTFILES+=	agentzh-redis2-nginx-module-v${NGINX_REDIS2_VERSION}-${GIT_REDIS2_VERSION}.tar.gz:redis2
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/agentzh-redis2-nginx-module-${GIT_REDIS2_VERSION:S/^0-g//}
X.endif
X
X.if ${PORT_OPTIONS:MRTMP}
XNGINX_RTMP_VERSION=	1.0.8
XMASTER_SITES+=	https://github.com/arut/nginx-rtmp-module/archive/v${NGINX_RTMP_VERSION}/:rtmp
XDISTFILES+=	rtmp-nginx-module-v${NGINX_RTMP_VERSION}.tar.gz:rtmp
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/nginx-rtmp-module-${NGINX_RTMP_VERSION}
X.endif
X
X.if ${PORT_OPTIONS:MSET_MISC}
XNGINX_SET_MISC_VERSION=	0.23
XGIT_SET_MISC_VERSION=	0-g6ce586e
XMASTER_SITES+=	https://github.com/agentzh/set-misc-nginx-module/tarball/v${NGINX_SET_MISC_VERSION}/:setmisc
XDISTFILES+=	agentzh-set-misc-nginx-module-v${NGINX_SET_MISC_VERSION}-${GIT_SET_MISC_VERSION}.tar.gz:setmisc
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/agentzh-set-misc-nginx-module-${GIT_SET_MISC_VERSION:S/^0-g//}
XEXTRA_PATCHES+=	${PATCHDIR}/extra-patch-agentzh-set-misc-nginx-module-config
X.endif
X
X.if ${PORT_OPTIONS:MSFLOW}
XNGINX_SFLOW_VERSION=	0.9.7
XMASTER_SITES+=	http://nginx-sflow-module.googlecode.com/files/:sflow
XDISTFILES+=	nginx-sflow-module-${NGINX_SFLOW_VERSION}.tar.gz:sflow
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/nginx-sflow-module-${NGINX_SFLOW_VERSION}
XEXTRA_PATCHES+=	${PATCHDIR}/extra-patch-ngx_http_sflow_config.c \
X		${PATCHDIR}/extra-patch-ngx_http_sflow_config.h
X.endif
X
X.if ${PORT_OPTIONS:MSLOWFS_CACHE}
XNGINX_SLOWFS_CACHE_VERSION=	1.10
XMASTER_SITES+=	http://labs.frickle.com/files/:slowfs_cache
XDISTFILES+=	ngx_slowfs_cache-${NGINX_SLOWFS_CACHE_VERSION}.tar.gz:slowfs_cache
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/ngx_slowfs_cache-${NGINX_SLOWFS_CACHE_VERSION}
X.endif
X
X.if ${PORT_OPTIONS:MSRCACHE}
XNGINX_SRCACHE_VERSION=	0.24
XGIT_SRCACHE_VERSION=	0-g33f0f29
XMASTER_SITES+=	https://github.com/agentzh/srcache-nginx-module/tarball/v${NGINX_SRCACHE_VERSION}/:srcache
XDISTFILES+=	agentzh-srcache-nginx-module-v${NGINX_SRCACHE_VERSION}-${GIT_SRCACHE_VERSION}.tar.gz:srcache
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/agentzh-srcache-nginx-module-${GIT_SRCACHE_VERSION:S/^0-g//}
X.endif
X
X.if ${PORT_OPTIONS:MSUPERVISORD}
XNGINX_SUPERVISORD_VERSION=	1.4
XMASTER_SITES+=	http://labs.frickle.com/files/:supervisord
XDISTFILES+=	ngx_supervisord-${NGINX_SUPERVISORD_VERSION}.tar.gz:supervisord
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/ngx_supervisord-${NGINX_SUPERVISORD_VERSION}
X.endif
X
X.if ${PORT_OPTIONS:MTCP_PROXY}
XNGINX_TCP_PROXY_VERSION=	0.26
XGIT_TCP_PROXY_VERSION=	0-gb83e5a6
XMASTER_SITES+=	https://github.com/yaoweibin/nginx_tcp_proxy_module/tarball/v${NGINX_TCP_PROXY_VERSION}/:tcp_proxy
XDISTFILES+=	yaoweibin-nginx_tcp_proxy_module-v${NGINX_TCP_PROXY_VERSION}-${GIT_TCP_PROXY_VERSION}.tar.gz:tcp_proxy
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/yaoweibin-nginx_tcp_proxy_module-${GIT_TCP_PROXY_VERSION:S/^0-g//}
X.endif
X
X.if ${PORT_OPTIONS:MXRID_HEADER}
XGIT_XRID_VERSION=	0daa3cc
XMASTER_SITES+=	https://github.com/gabor/nginx-x-rid-header/tarball/master/:xrid
XDISTFILES+=	gabor-nginx-x-rid-header-${GIT_XRID_VERSION}.tar.gz:xrid
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/gabor-nginx-x-rid-header-${GIT_XRID_VERSION}
X.endif
X
X.if ${PORT_OPTIONS:MXSS}
XNGINX_XSS_VERSION=	0.04
XGIT_XSS_VERSION=	0-g7e37038
XMASTER_SITES+=	https://github.com/agentzh/xss-nginx-module/tarball/v${NGINX_XSS_VERSION}/:xss
XDISTFILES+=	agentzh-xss-nginx-module-v${NGINX_XSS_VERSION}-${GIT_XSS_VERSION}.tar.gz:xss
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/agentzh-xss-nginx-module-${GIT_XSS_VERSION:S/^0-g//}
X.endif
X
X.if ${PORT_OPTIONS:MSPDY}
XWITH_HTTP_SSL=	yes
XCONFIGURE_ARGS+=--with-http_spdy_module
X.endif
X
X.if ${PORT_OPTIONS:MCPP_TEST}
XCONFIGURE_ARGS+=--with-cpp_test_module
X.endif
X
X.if ${PORT_OPTIONS:MTFS}
XLIB_DEPENDS+=	libyajl.so:${PORTSDIR}/devel/yajl
XCONFIGURE_ARGS+=--with-http_tfs_module
X.endif
X
X.if ${PORT_OPTIONS:MWWW}
XPLIST_SUB+=	WWWDATA=""
X.else
XPLIST_SUB+=	WWWDATA="@comment "
X.endif
X
X.else
XCONFIGURE_ARGS+=--without-http
XPLIST_SUB+=	WWWDATA="@comment "
X.endif		# WITH_HTTP
X
X.if ${PORT_OPTIONS:MMAIL}
XCONFIGURE_ARGS+=--with-mail
X.if empty(PORT_OPTIONS:MMAIL_IMAP)
XCONFIGURE_ARGS+=--without-mail_imap_module
X.endif
X.if empty(PORT_OPTIONS:MMAIL_POP3)
XCONFIGURE_ARGS+=--without-mail_pop3_module
X.endif
X.if empty(PORT_OPTIONS:MMAIL_SMTP)
XCONFIGURE_ARGS+=--without-mail_smtp_module
X.endif
X.if ${PORT_OPTIONS:MMAIL_SSL}
XNGINX_OPENSSL=	yes
XCONFIGURE_ARGS+=--with-mail_ssl_module
X.endif
X.endif		# WITH_MAIL
X
X.if ${PORT_OPTIONS:MHTTP_SSL}
XWITH_HTTP_SSL=	yes
X.endif
X
X.if ${PORT_OPTIONS:MARRAYVAR}
XNGINX_ARRAYVAR_VERSION=	0.03
XGIT_ARRAYVAR_VERSION=	0-g4676747
XMASTER_SITES+=	https://github.com/agentzh/array-var-nginx-module/tarball/v${NGINX_ARRAYVAR_VERSION}/:arrayvar
XDISTFILES+=	agentzh-array-var-nginx-module-v${NGINX_ARRAYVAR_VERSION}-${GIT_ARRAYVAR_VERSION}.tar.gz:arrayvar
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/agentzh-array-var-nginx-module-${GIT_ARRAYVAR_VERSION:S/^0-g//}
X.endif
X
X.if ${PORT_OPTIONS:MFORMINPUT}
XNGINX_FORMINPUT_VERSION=	0.07
XGIT_FORMINPUT_VERSION=		0-g78de845
XMASTER_SITES+=	https://github.com/calio/form-input-nginx-module/tarball/v${NGINX_FORMINPUT_VERSION}/:forminput
XDISTFILES+=	calio-form-input-nginx-module-v${NGINX_FORMINPUT_VERSION}-${GIT_FORMINPUT_VERSION}.tar.gz:forminput
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/calio-form-input-nginx-module-${GIT_FORMINPUT_VERSION:S/^0-g//}
X.endif
X
X.if ${PORT_OPTIONS:MICONV}
XUSES+=		iconv
XNGINX_ICONV_VERSION=	0.10
XGIT_ICONV_VERSION=	0-gb37efb5
XMASTER_SITES+=	https://github.com/calio/iconv-nginx-module/tarball/v${NGINX_ICONV_VERSION}/:iconv
XDISTFILES+=	calio-iconv-nginx-module-v${NGINX_ICONV_VERSION}-${GIT_ICONV_VERSION}.tar.gz:iconv
XCONFIGURE_ARGS+=--add-module=${WRKDIR}/calio-iconv-nginx-module-${GIT_ICONV_VERSION:S/^0-g//}
XEXTRA_PATCHES+=	${PATCHDIR}/extra-patch-calio-iconv-nginx-module-config
X.endif
X
XPLIST_SUB+=	NGINX_TMPDIR=${NGINX_TMPDIR} WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}
X
XUSERS?=	${WWWOWN}
XGROUPS?=${WWWGRP}
X
X.if defined(NGINX_OPENSSL)
XUSE_OPENSSL=	yes
X.if ${PORT_OPTIONS:MSPDY}
X.if ${OSVERSION} < 1000028
XWITH_OPENSSL_PORT=	yes
X.else
XWITH_OPENSSL_BASE=	yes
X.endif
X.endif
X.endif
X
X.if defined(WITH_HTTP_REWRITE)
XLIB_DEPENDS+=	libpcre.so:${PORTSDIR}/devel/pcre
XCONFIGURE_ARGS+=--with-pcre
X.else
XPKGNAMESUFFIX:=	${PKGNAMESUFFIX}-nopcre
XCONFIGURE_ARGS+=--without-http_rewrite_module \
X		--without-pcre
X.endif
X
X.if defined(WITH_HTTP_SSL)
XNGINX_OPENSSL=	yes
XCONFIGURE_ARGS+=--with-http_ssl_module
X.endif
X
Xpre-everything::
X	@${ECHO_MSG}
X.if ${PORT_OPTIONS:MHTTP_UPSTREAM_FAIR}
X	@${ECHO_MSG} "Enable http_ssl module to build upstream_fair with SSL support"
X.endif
X	@${ECHO_MSG}
X
Xpost-extract:
X.if ${PORT_OPTIONS:MGRIDFS}
X	@${RMDIR} ${WRKDIR}/mdirolf-nginx-gridfs-${GIT_GRIDFS_VERSION:S/^0-g//}/mongo-c-driver/
X	@${MV} \
X	${WRKDIR}/mongodb-mongo-c-driver-${GIT_MONGO_C_DRIVER_VERSION:S/^0-g//}/ \
X	${WRKDIR}/mdirolf-nginx-gridfs-${GIT_GRIDFS_VERSION:S/^0-g//}/mongo-c-driver/
X.endif
X
Xpost-patch:
X	@${REINPLACE_CMD} 's!%%HTTP_PORT%%!${HTTP_PORT}!; \
X		s!%%PREFIX%%!${PREFIX}!' \
X		${WRKSRC}/conf/nginx.conf
X.if ${PORT_OPTIONS:MHTTP_ACCESSKEY}
X	@${REINPLACE_CMD} \
X		's!$$HTTP_ACCESSKEY_MODULE!ngx_http_accesskey_module!' \
X		${WRKDIR}/nginx-accesskey-${NGINX_ACCESSKEY_VERSION}/config
X.endif
X# Linker error acquire if --std=c99 defined, add "static" to inline function
X.if ${PORT_OPTIONS:MHTTP_ZIP}
X	@${REINPLACE_CMD} \
X		's!^inline!static inline!' \
X		${WRKDIR}/mod_zip-${NGINX_ZIP_VERSION}/ngx_http_zip_parsers.*
X.endif
X.if ${PORT_OPTIONS:MDRIZZLE}
X	@${REINPLACE_CMD} \
X		's!%%PREFIX%%!${LOCALBASE}!g' \
X		${WRKDIR}/chaoslawful-drizzle-nginx-module-${GIT_DRIZZLE_VERSION:S/^0-g//}/config
X.endif
X# Respect CFLAGS by remove needless --std=c99 flag
X.if ${PORT_OPTIONS:MGRIDFS}
X	@${REINPLACE_CMD} \
X		's!--std=c99!-DMONGO_HAVE_STDINT!' \
X		${WRKDIR}/mdirolf-nginx-gridfs-${GIT_GRIDFS_VERSION:S/^0-g//}/config
X.endif
X.if ${PORT_OPTIONS:MPOSTGRES}
X	@${REINPLACE_CMD} \
X		's!%%PREFIX%%!${LOCALBASE}!g' \
X		${WRKDIR}/ngx_postgres-${NGINX_POSTGRES_VERSION}/config
X.endif
X.if ${PORT_OPTIONS:MSFLOW}
X	@${REINPLACE_CMD} \
X		's!%%PREFIX%%!${LOCALBASE}!g' \
X		${WRKDIR}/nginx-sflow-module-${NGINX_SFLOW_VERSION}/ngx_http_sflow_config.h
X.endif
X.if ${PORT_OPTIONS:MSPDY}
X.if ${PORT_OPTIONS:MDRIZZLE}
X	@${REINPLACE_CMD} '584d' \
X		${WRKDIR}/chaoslawful-drizzle-nginx-module-${GIT_DRIZZLE_VERSION:S/^0-g//}/src/ngx_http_drizzle_util.c
X.endif
X.endif
X.if ${PORT_OPTIONS:MSUPERVISORD}
X	( cd ${WRKDIR}/nginx_upstream_fair-${NGINX_UPSTREAM_FAIR_VERSION} && \
X		${PATCH} -p0 < \
X			${WRKDIR}/ngx_supervisord-${NGINX_SUPERVISORD_VERSION}/patches/ngx_http_upstream_fair_module.patch )
X	( cd ${WRKSRC} && \
X		${PATCH} -p0 < \
X			${WRKDIR}/ngx_supervisord-${NGINX_SUPERVISORD_VERSION}/patches/ngx_http_upstream_init_busy-0.8.17.patch )
X.endif
X.if ${PORT_OPTIONS:MTCP_PROXY}
X	( cd ${WRKSRC} && \
X		${PATCH} -p1 < \
X			${WRKDIR}/yaoweibin-nginx_tcp_proxy_module-${GIT_TCP_PROXY_VERSION:S/^0-g//}/tcp.patch )
X.endif
X.if ${PORT_OPTIONS:MICONV}
X	@${REINPLACE_CMD} \
X		's!%%PREFIX%%!${LOCALBASE}!g' \
X		${WRKDIR}/calio-iconv-nginx-module-${GIT_ICONV_VERSION:S/^0-g//}/config
X.endif
X.if ${PORT_OPTIONS:MMODSECURITY}
X	@${REINPLACE_CMD} \
X		's!%%PREFIX%%!${LOCALBASE}!g' \
X		${WRKDIR}/modsecurity-apache_${NGINX_MODSECURITY_VERSION}/nginx/modsecurity/config
X.endif
X
Xpre-configure:
X.if ${PORT_OPTIONS:MMODSECURITY}
X	( cd ${WRKDIR}/modsecurity-apache_${NGINX_MODSECURITY_VERSION} && \
X		CC="${CC}" ./${CONFIGURE_SCRIPT} --enable-standalone-module && \
X		${MAKE} )
X.endif
X
Xdo-build:
X	@cd ${WRKSRC} && ${MAKE}
X
Xdo-install:
X	${MKDIR}  ${STAGEDIR}${ETCDIR}/modules
X	${MKDIR}  ${STAGEDIR}${ETCDIR}/include
X	${MKDIR}  ${STAGEDIR}${NGINX_TMPDIR}
X	${INSTALL_PROGRAM} ${WRKSRC}/objs/nginx ${STAGEDIR}${PREFIX}/sbin
X	${INSTALL_SCRIPT} ${WRKSRC}/objs/dso_tool ${STAGEDIR}${PREFIX}/sbin
X.for i in koi-utf koi-win win-utf
X	${INSTALL_DATA} ${WRKSRC}/conf/${i} ${STAGEDIR}${ETCDIR}
X.endfor
X.for i in *.so
X	${INSTALL_PROGRAM} ${WRKSRC}/objs/modules/${i} ${STAGEDIR}${ETCDIR}/modules
X.endfor
X.for i in *.h
X	${INSTALL_DATA} ${WRKSRC}/src/core/${i} ${STAGEDIR}${ETCDIR}/include
X	${INSTALL_DATA} ${WRKSRC}/src/event/${i} ${STAGEDIR}${ETCDIR}/include
X	${INSTALL_DATA} ${WRKSRC}/src/os/unix/${i} ${STAGEDIR}${ETCDIR}/include
X	${INSTALL_DATA} ${WRKSRC}/src/http/${i} ${STAGEDIR}${ETCDIR}/include
X	${INSTALL_DATA} ${WRKSRC}/src/http/modules/${i} ${STAGEDIR}${ETCDIR}/include
X	${INSTALL_DATA} ${WRKSRC}/src/http/modules/lua/${i} ${STAGEDIR}${ETCDIR}/include
X.endfor
X.for i in ngx_auto_headers.h ngx_auto_config.h
X	${INSTALL_DATA} ${WRKSRC}/objs/${i} ${STAGEDIR}${ETCDIR}/include
X.endfor
X.for i in fastcgi_params mime.types nginx.conf scgi_params uwsgi_params
X	${INSTALL_DATA} ${WRKSRC}/conf/${i} ${STAGEDIR}${ETCDIR}/${i}-dist
X.endfor
X.if !empty(PORT_OPTIONS:MHTTP) && !empty(PORT_OPTIONS:MWWW)
X	${MKDIR} ${STAGEDIR}${PREFIX}/www/nginx-dist
X.for i in index.html 50x.html
X	${INSTALL_DATA} ${WRKSRC}/html/${i} ${STAGEDIR}${PREFIX}/www/nginx-dist
X.endfor
X	${ECHO_CMD} "" >>${STAGEDIR}${PREFIX}/www/nginx-dist/EXAMPLE_DIRECTORY-DONT_ADD_OR_TOUCH_ANYTHING
X.endif
X
X.if !empty(PORT_OPTIONS:MHTTP) && !empty(PORT_OPTIONS:MHTTP_PERL)
X	${MKDIR} ${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/auto/nginx
X	${INSTALL_PROGRAM} ${WRKSRC}/objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so \
X		${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/auto/nginx
X	${INSTALL_DATA} ${WRKSRC}/objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.bs \
X		${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/auto/nginx
X	${INSTALL_DATA} ${WRKSRC}/objs/src/http/modules/perl/blib/lib/nginx.pm \
X		${STAGEDIR}${PREFIX}/${SITE_PERL_REL}/${PERL_ARCH}/
X.endif
X
Xpost-install:
X.if !empty(PORT_OPTIONS:MHTTP) && !empty(PORT_OPTIONS:MHTTP_PERL)
X	${ECHO_CMD} ${SITE_PERL_REL}/${PERL_ARCH}/auto/nginx/nginx.so >> ${TMPPLIST}
X	${ECHO_CMD} ${SITE_PERL_REL}/${PERL_ARCH}/auto/nginx/nginx.bs >> ${TMPPLIST}
X	${ECHO_CMD} ${SITE_PERL_REL}/${PERL_ARCH}/nginx.pm >> ${TMPPLIST}
X	${ECHO_CMD} @dirrm ${SITE_PERL_REL}/${PERL_ARCH}/auto/nginx >> ${TMPPLIST}
X.endif
X	@${INSTALL_MAN} ${WRKSRC}/objs/nginx.8 ${STAGEDIR}${MAN8PREFIX}/man/man8
X
X	@${ECHO_MSG} ""
X	@${ECHO_MSG} "For more info and documentation of advanced features, please visit http://tengine.taobao.org/."
X	@${ECHO_MSG} ""
X
X.include <bsd.port.mk>
e276eaee7b2aa48194b2eabdfaa57ffd
echo c - tengine-devel/files
mkdir -p tengine-devel/files > /dev/null 2>&1
echo x - tengine-devel/files/extra-patch-nginx-modsecurity-config
sed 's/^X//' >tengine-devel/files/extra-patch-nginx-modsecurity-config << 'b785f585c503e84b86bde79040975b97'
X--- ../modsecurity-apache_2.7.5/nginx/modsecurity/config.orig	2013-06-04 10:14:07.000000000 +0400
X+++ ../modsecurity-apache_2.7.5/nginx/modsecurity/config	2013-06-04 10:17:30.000000000 +0400
X@@ -3,5 +3,5 @@
X HTTP_AUX_FILTER_MODULES="ngx_http_modsecurity $HTTP_AUX_FILTER_MODULES"
X NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_modsecurity.c $ngx_addon_dir/apr_bucket_nginx.c $ngx_addon_dir/ngx_pool_context.c"
X NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/apr_bucket_nginx.h $ngx_addon_dir/ngx_pool_context.h"
X-CORE_LIBS="$CORE_LIBS $ngx_addon_dir/../../standalone/.libs/standalone.a -L/usr/local/apr/lib -lapr-1  -L/usr/local/apr/lib -laprutil-1 -lpcre -lxml2 -lz -lm -ldl  "
X-CORE_INCS="$CORE_INCS $ngx_addon_dir $ngx_addon_dir/../../standalone $ngx_addon_dir/../../apache2 /usr/include/libxml2  /usr/local/apache2/include /usr/local/apr/include/apr-1 /usr/local/apr/include/apr-1"
X+CORE_LIBS="$CORE_LIBS $ngx_addon_dir/../../standalone/.libs/standalone.a -lapr-1 -laprutil-1 -lpcre -lxml2 -lz -lm "
X+CORE_INCS="$CORE_INCS $ngx_addon_dir $ngx_addon_dir/../../standalone $ngx_addon_dir/../../apache2 %%PREFIX%%/include/libxml2  %%PREFIX%%/include/apache22 %%PREFIX%%/include/apr-1 "
b785f585c503e84b86bde79040975b97
echo x - tengine-devel/files/extra-patch-calio-iconv-nginx-module-config
sed 's/^X//' >tengine-devel/files/extra-patch-calio-iconv-nginx-module-config << '4c350f43a4c5863bccafd19531400e5f'
X--- ../calio-iconv-nginx-module-b37efb5/config.orig	2013-04-16 17:57:17.000000000 -0700
X+++ ../calio-iconv-nginx-module-b37efb5/config	2013-05-01 17:16:28.134624745 -0700
X@@ -39,12 +39,12 @@
X     fi
X 
X     if [ $ngx_found = no ]; then
X-        ngx_feature="libiconv in /usr/local/"
X-        ngx_feature_path="/usr/local/include"
X+        ngx_feature="libiconv in %%PREFIX%%/"
X+        ngx_feature_path="%%PREFIX%%/include"
X         if [ $NGX_RPATH = YES ]; then
X-            ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -liconv"
X+            ngx_feature_libs="-R%%PREFIX%%/lib -L%%PREFIX%%/lib -liconv"
X         else
X-            ngx_feature_libs="-L/usr/local/lib -liconv"
X+            ngx_feature_libs="-L%%PREFIX%%/lib -liconv"
X         fi
X         . auto/feature
X     fi
4c350f43a4c5863bccafd19531400e5f
echo x - tengine-devel/files/extra-patch-ngx_http_notice_module.c
sed 's/^X//' >tengine-devel/files/extra-patch-ngx_http_notice_module.c << '4ed63abe84bf79ad43932d35fe81fba5'
X--- ../kr-nginx-notice-3c95966/ngx_http_notice_module.c.orig	2009-07-16 18:37:57.000000000 +0200
X+++ ../kr-nginx-notice-3c95966/ngx_http_notice_module.c	2009-07-16 08:09:38.000000000 +0200
X@@ -153,7 +153,7 @@
X         return NGX_HTTP_NOT_ALLOWED;
X     }
X 
X-    rc = ngx_http_discard_body(r);
X+    rc = ngx_http_discard_request_body(r);
X 
X     if (rc != NGX_OK && rc != NGX_AGAIN) {
X         return rc;
4ed63abe84bf79ad43932d35fe81fba5
echo x - tengine-devel/files/extra-patch-ngx_http_upstream.h
sed 's/^X//' >tengine-devel/files/extra-patch-ngx_http_upstream.h << '2ab8c44a142b5acdc8a2b257103a0e96'
X--- src/http/ngx_http_upstream.h.orig	2010-01-14 04:20:57.000000000 +0300
X+++ src/http/ngx_http_upstream.h	2010-01-14 04:22:00.000000000 +0300
X@@ -105,6 +105,10 @@
X 
X     ngx_array_t                     *servers;  /* ngx_http_upstream_server_t */
X 
X+    ngx_array_t                     *values;
X+    ngx_array_t                     *lengths;
X+    ngx_uint_t                       retries;
X+
X     ngx_uint_t                       flags;
X     ngx_str_t                        host;
X     u_char                          *file_name;
2ab8c44a142b5acdc8a2b257103a0e96
echo x - tengine-devel/files/extra-patch-ngx_http_upload_module.c
sed 's/^X//' >tengine-devel/files/extra-patch-ngx_http_upload_module.c << 'c27d3f0b6463a1682564dc8082406685'
X--- ../nginx_upload_module-2.2.0/ngx_http_upload_module.c.orig	2010-09-27 21:54:15.000000000 +0300
X+++ ../nginx_upload_module-2.2.0/ngx_http_upload_module.c	2013-09-10 17:40:59.570815847 +0300
X@@ -50,7 +50,7 @@
X  * State of multipart/form-data parser
X  */
X typedef enum {
X-	upload_state_boundary_seek,
X+  upload_state_boundary_seek,
X 	upload_state_after_boundary,
X 	upload_state_headers,
X 	upload_state_data,
X@@ -95,6 +95,14 @@
X } ngx_http_upload_field_template_t;
X 
X /*
X+ * Template for a header
X+ */
X+typedef struct {
X+    ngx_http_complex_value_t      *name;
X+    ngx_http_complex_value_t      *value;
X+} ngx_http_upload_header_template_t;
X+
X+/*
X  * Filter for fields in output form
X  */
X typedef struct {
X@@ -106,6 +114,12 @@
X #endif
X } ngx_http_upload_field_filter_t;
X 
X+typedef struct {
X+    ngx_path_t                  *path;
X+    ngx_http_complex_value_t    dynamic;
X+    unsigned                    is_dynamic:1;
X+} ngx_http_upload_path_t;
X+
X /*
X  * Upload cleanup record
X  */
X@@ -124,8 +138,8 @@
X typedef struct {
X     ngx_str_t                     url;
X     ngx_http_complex_value_t      *url_cv;
X-    ngx_path_t                    *state_store_path;
X-    ngx_path_t                    *store_path;
X+    ngx_http_upload_path_t        *state_store_path;
X+    ngx_http_upload_path_t        *store_path;
X     ngx_uint_t                    store_access;
X     size_t                        buffer_size;
X     size_t                        merge_buffer_size;
X@@ -137,13 +151,17 @@
X     ngx_array_t                   *aggregate_field_templates;
X     ngx_array_t                   *field_filters;
X     ngx_array_t                   *cleanup_statuses;
X+    ngx_array_t                   *header_templates;
X     ngx_flag_t                    forward_args;
X     ngx_flag_t                    tame_arrays;
X     ngx_flag_t                    resumable_uploads;
X+    ngx_flag_t                    empty_field_names;
X     size_t                        limit_rate;
X 
X     unsigned int                  md5:1;
X     unsigned int                  sha1:1;
X+    unsigned int                  sha256:1;
X+    unsigned int                  sha512:1;
X     unsigned int                  crc32:1;
X } ngx_http_upload_loc_conf_t;
X 
X@@ -157,6 +175,16 @@
X     u_char      sha1_digest[SHA_DIGEST_LENGTH * 2];
X } ngx_http_upload_sha1_ctx_t;
X 
X+typedef struct ngx_http_upload_sha256_ctx_s {
X+    SHA256_CTX  sha256;
X+    u_char      sha256_digest[SHA256_DIGEST_LENGTH * 2];
X+} ngx_http_upload_sha256_ctx_t;
X+
X+typedef struct ngx_http_upload_sha512_ctx_s {
X+    SHA512_CTX  sha512;
X+    u_char      sha512_digest[SHA512_DIGEST_LENGTH * 2];
X+} ngx_http_upload_sha512_ctx_t;
X+
X struct ngx_http_upload_ctx_s;
X 
X /*
X@@ -219,7 +247,11 @@
X 
X     ngx_http_upload_md5_ctx_t   *md5_ctx;    
X     ngx_http_upload_sha1_ctx_t  *sha1_ctx;    
X+    ngx_http_upload_sha256_ctx_t *sha256_ctx;
X+    ngx_http_upload_sha512_ctx_t *sha512_ctx;
X     uint32_t                    crc32;    
X+    ngx_path_t          *store_path;
X+    ngx_path_t          *state_store_path;
X 
X     unsigned int        first_part:1;
X     unsigned int        discard_data:1;
X@@ -233,7 +265,21 @@
X     unsigned int        raw_input:1;
X } ngx_http_upload_ctx_t;
X 
X+static ngx_int_t ngx_http_upload_test_expect(ngx_http_request_t *r);
X+
X+static void ngx_http_read_client_request_body_handler(ngx_http_request_t *r);
X+static ngx_int_t ngx_http_do_read_client_request_body(ngx_http_request_t *r);
X+
X+static ngx_int_t ngx_http_write_request_body(ngx_http_request_t *r);
X+static ngx_int_t ngx_http_request_body_filter(ngx_http_request_t *r, ngx_chain_t *in);
X+
X+static ngx_int_t ngx_http_request_body_length_filter(ngx_http_request_t *r, ngx_chain_t *in);
X+static ngx_int_t ngx_http_request_body_chunked_filter(ngx_http_request_t *r, ngx_chain_t *in);
X+
X+static ngx_int_t ngx_http_request_body_save_filter(ngx_http_request_t *r, ngx_chain_t *in);
X+
X static ngx_int_t ngx_http_upload_handler(ngx_http_request_t *r);
X+static ngx_int_t ngx_http_upload_options_handler(ngx_http_request_t *r);
X static ngx_int_t ngx_http_upload_body_handler(ngx_http_request_t *r);
X 
X static void *ngx_http_upload_create_loc_conf(ngx_conf_t *cf);
X@@ -248,6 +294,10 @@
X     ngx_http_variable_value_t *v, uintptr_t data);
X static ngx_int_t ngx_http_upload_sha1_variable(ngx_http_request_t *r,
X     ngx_http_variable_value_t *v, uintptr_t data);
X+static ngx_int_t ngx_http_upload_sha256_variable(ngx_http_request_t *r,
X+    ngx_http_variable_value_t *v, uintptr_t data);
X+static ngx_int_t ngx_http_upload_sha512_variable(ngx_http_request_t *r,
X+    ngx_http_variable_value_t *v, uintptr_t data);
X static ngx_int_t ngx_http_upload_file_size_variable(ngx_http_request_t *r,
X     ngx_http_variable_value_t *v, uintptr_t data);
X static void ngx_http_upload_content_range_variable_set(ngx_http_request_t *r,
X@@ -271,6 +321,7 @@
X static ngx_int_t ngx_http_upload_merge_ranges(ngx_http_upload_ctx_t *u, ngx_http_upload_range_t *range_n);
X static ngx_int_t ngx_http_upload_parse_range(ngx_str_t *range, ngx_http_upload_range_t *range_n);
X 
X+
X static void ngx_http_read_upload_client_request_body_handler(ngx_http_request_t *r);
X static ngx_int_t ngx_http_do_read_upload_client_request_body(ngx_http_request_t *r);
X static ngx_int_t ngx_http_process_request_body(ngx_http_request_t *r, ngx_chain_t *body);
X@@ -279,8 +330,16 @@
X 
X static char *ngx_http_upload_set_form_field(ngx_conf_t *cf, ngx_command_t *cmd,
X     void *conf);
X+static char *ngx_http_upload_add_header(ngx_conf_t *cf, ngx_command_t *cmd,
X+    void *conf);
X+static ngx_int_t ngx_http_upload_eval_path(ngx_http_request_t *r);
X+static ngx_int_t ngx_http_upload_eval_state_path(ngx_http_request_t *r);
X static char *ngx_http_upload_pass_form_field(ngx_conf_t *cf, ngx_command_t *cmd,
X     void *conf);
X+static char *ngx_http_upload_set_path_slot(ngx_conf_t *cf, ngx_command_t *cmd,
X+    void *conf);
X+static char *ngx_http_upload_merge_path_value(ngx_conf_t *cf, ngx_http_upload_path_t **path, ngx_http_upload_path_t *prev,
X+    ngx_path_init_t *init);
X static char *ngx_http_upload_cleanup(ngx_conf_t *cf, ngx_command_t *cmd,
X     void *conf);
X static void ngx_upload_cleanup_handler(void *data);
X@@ -391,7 +450,7 @@
X     { ngx_string("upload_store"),
X       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LMT_CONF|NGX_HTTP_LIF_CONF
X                         |NGX_CONF_TAKE1234,
X-      ngx_conf_set_path_slot,
X+      ngx_http_upload_set_path_slot,
X       NGX_HTTP_LOC_CONF_OFFSET,
X       offsetof(ngx_http_upload_loc_conf_t, store_path),
X       NULL },
X@@ -401,7 +460,7 @@
X      */
X     { ngx_string("upload_state_store"),
X       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234,
X-      ngx_conf_set_path_slot,
X+      ngx_http_upload_set_path_slot,
X       NGX_HTTP_LOC_CONF_OFFSET,
X       offsetof(ngx_http_upload_loc_conf_t, state_store_path),
X       NULL },
X@@ -575,6 +634,28 @@
X        offsetof(ngx_http_upload_loc_conf_t, resumable_uploads),
X        NULL },
X 
X+     /*
X+      * Specifies whether empty field names are allowed
X+      */
X+     { ngx_string("upload_empty_fiels_names"),
X+       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LMT_CONF|NGX_HTTP_LIF_CONF
X+                         |NGX_CONF_FLAG,
X+       ngx_conf_set_flag_slot,
X+       NGX_HTTP_LOC_CONF_OFFSET,
X+       offsetof(ngx_http_upload_loc_conf_t, empty_field_names),
X+       NULL },
X+
X+    /*
X+     * Specifies the name and content of the header that will be added to the response
X+     */
X+    { ngx_string("upload_add_header"),
X+      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LMT_CONF|NGX_HTTP_LIF_CONF
X+                        |NGX_CONF_TAKE2,
X+      ngx_http_upload_add_header,
X+      NGX_HTTP_LOC_CONF_OFFSET,
X+      offsetof(ngx_http_upload_loc_conf_t, header_templates),
X+      NULL},
X+
X       ngx_null_command
X }; /* }}} */
X 
X@@ -658,6 +739,22 @@
X       (uintptr_t) "0123456789ABCDEF",
X       NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
X 
X+    { ngx_string("upload_file_sha256"), NULL, ngx_http_upload_sha256_variable,
X+      (uintptr_t) "0123456789abcdef",
X+      NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
X+
X+    { ngx_string("upload_file_sha256_uc"), NULL, ngx_http_upload_sha256_variable,
X+      (uintptr_t) "0123456789ABCDEF",
X+      NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
X+
X+    { ngx_string("upload_file_sha512"), NULL, ngx_http_upload_sha512_variable,
X+      (uintptr_t) "0123456789abcdef",
X+      NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
X+
X+    { ngx_string("upload_file_sha512_uc"), NULL, ngx_http_upload_sha512_variable,
X+      (uintptr_t) "0123456789ABCDEF",
X+      NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
X+
X     { ngx_string("upload_file_crc32"), NULL, ngx_http_upload_crc32_variable,
X       (uintptr_t) offsetof(ngx_http_upload_ctx_t, crc32),
X       NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
X@@ -688,6 +785,9 @@
X     ngx_http_upload_ctx_t     *u;
X     ngx_int_t                 rc;
X 
X+    if(r->method & NGX_HTTP_OPTIONS)
X+        return ngx_http_upload_options_handler(r);
X+
X     if (!(r->method & NGX_HTTP_POST))
X         return NGX_HTTP_NOT_ALLOWED;
X 
X@@ -724,6 +824,26 @@
X     }else
X         u->sha1_ctx = NULL;
X 
X+    if(ulcf->sha256) {
X+        if(u->sha256_ctx == NULL) {
X+            u->sha256_ctx = ngx_palloc(r->pool, sizeof(ngx_http_upload_sha256_ctx_t));
X+            if (u->sha256_ctx == NULL) {
X+                return NGX_HTTP_INTERNAL_SERVER_ERROR;
X+            }
X+        }
X+    }else
X+        u->sha256_ctx = NULL;
X+
X+    if(ulcf->sha512) {
X+        if(u->sha512_ctx == NULL) {
X+            u->sha512_ctx = ngx_palloc(r->pool, sizeof(ngx_http_upload_sha512_ctx_t));
X+            if (u->sha512_ctx == NULL) {
X+                return NGX_HTTP_INTERNAL_SERVER_ERROR;
X+            }
X+        }
X+    }else
X+        u->sha512_ctx = NULL;
X+
X     u->calculate_crc32 = ulcf->crc32;
X 
X     u->request = r;
X@@ -746,6 +866,25 @@
X         return rc;
X     }
X 
X+    rc = ngx_http_upload_eval_path(r);
X+
X+    if(rc != NGX_OK) {
X+        upload_shutdown_ctx(u);
X+        return rc;
X+    }
X+
X+    rc = ngx_http_upload_eval_state_path(r);
X+
X+    if(rc != NGX_OK) {
X+        upload_shutdown_ctx(u);
X+        return rc;
X+    }
X+
X+    if (ngx_http_upload_test_expect(r) != NGX_OK) {
X+        upload_shutdown_ctx(u);
X+        return NGX_HTTP_INTERNAL_SERVER_ERROR;
X+    }
X+
X     if(upload_start(u, ulcf) != NGX_OK)
X         return NGX_HTTP_INTERNAL_SERVER_ERROR;
X 
X@@ -758,6 +897,124 @@
X     return NGX_DONE;
X } /* }}} */
X 
X+static ngx_int_t ngx_http_upload_add_headers(ngx_http_request_t *r, ngx_http_upload_loc_conf_t *ulcf) { /* {{{ */
X+    ngx_str_t                            name;
X+    ngx_str_t                            value;
X+    ngx_http_upload_header_template_t    *t;
X+    ngx_table_elt_t                      *h;
X+    ngx_uint_t                           i;
X+
X+    if(ulcf->header_templates != NULL) {
X+        t = ulcf->header_templates->elts;
X+        for(i = 0; i < ulcf->header_templates->nelts; i++) {
X+            if(ngx_http_complex_value(r, t->name, &name) != NGX_OK) {
X+                return NGX_ERROR;
X+            }
X+
X+            if(ngx_http_complex_value(r, t->value, &value) != NGX_OK) {
X+                return NGX_ERROR;
X+            }
X+
X+            if(name.len != 0 && value.len != 0) {
X+                h = ngx_list_push(&r->headers_out.headers);
X+                if(h == NULL) {
X+                    return NGX_ERROR;
X+                }
X+
X+                h->hash = 1;
X+                h->key.len = name.len;
X+                h->key.data = name.data;
X+                h->value.len = value.len;
X+                h->value.data = value.data;
X+            }
X+
X+            t++;
X+        }
X+    }
X+
X+    return NGX_OK;
X+} /* }}} */
X+
X+static ngx_int_t /* {{{  */
X+ngx_http_upload_eval_path(ngx_http_request_t *r) {
X+    ngx_http_upload_ctx_t       *u;
X+    ngx_http_upload_loc_conf_t  *ulcf;
X+    ngx_str_t                   value;
X+
X+    ulcf = ngx_http_get_module_loc_conf(r, ngx_http_upload_module);
X+    u = ngx_http_get_module_ctx(r, ngx_http_upload_module);
X+
X+    if(ulcf->store_path->is_dynamic) {
X+        u->store_path = ngx_pcalloc(r->pool, sizeof(ngx_path_t));
X+        if(u->store_path == NULL) {
X+            return NGX_ERROR;
X+        }
X+
X+        ngx_memcpy(u->store_path, ulcf->store_path->path, sizeof(ngx_path_t));
X+
X+        if(ngx_http_complex_value(r, &ulcf->store_path->dynamic, &value) != NGX_OK) {
X+            return NGX_ERROR;
X+        }
X+
X+        u->store_path->name.data = value.data;
X+        u->store_path->name.len = value.len;
X+    }
X+    else{
X+        u->store_path = ulcf->store_path->path;
X+    }
X+
X+    return NGX_OK;
X+} /* }}} */
X+
X+static ngx_int_t /* {{{  */
X+ngx_http_upload_eval_state_path(ngx_http_request_t *r) {
X+    ngx_http_upload_ctx_t       *u;
X+    ngx_http_upload_loc_conf_t  *ulcf;
X+    ngx_str_t                   value;
X+
X+    ulcf = ngx_http_get_module_loc_conf(r, ngx_http_upload_module);
X+    u = ngx_http_get_module_ctx(r, ngx_http_upload_module);
X+
X+    if(ulcf->state_store_path->is_dynamic) {
X+        u->state_store_path = ngx_pcalloc(r->pool, sizeof(ngx_path_t));
X+        if(u->store_path == NULL) {
X+            return NGX_ERROR;
X+        }
X+
X+        ngx_memcpy(u->state_store_path, ulcf->state_store_path->path, sizeof(ngx_path_t));
X+
X+        if(ngx_http_complex_value(r, &ulcf->state_store_path->dynamic, &value) != NGX_OK) {
X+            return NGX_ERROR;
X+        }
X+
X+        u->state_store_path->name.data = value.data;
X+        u->state_store_path->name.len = value.len;
X+    }
X+    else{
X+        u->state_store_path = ulcf->state_store_path->path;
X+    }
X+
X+    return NGX_OK;
X+} /* }}} */
X+
X+static ngx_int_t ngx_http_upload_options_handler(ngx_http_request_t *r) { /* {{{ */
X+    ngx_http_upload_loc_conf_t *ulcf;
X+
X+    ulcf = ngx_http_get_module_loc_conf(r, ngx_http_upload_module);
X+
X+    r->headers_out.status = NGX_HTTP_OK;
X+
X+    if(ngx_http_upload_add_headers(r, ulcf) != NGX_OK) {
X+        return NGX_HTTP_INTERNAL_SERVER_ERROR;
X+    }
X+
X+    r->header_only = 1;
X+    r->headers_out.content_length_n = 0;
X+    r->allow_ranges = 0;
X+
X+    return ngx_http_send_header(r);
X+} /* }}} */
X+
X static ngx_int_t ngx_http_upload_body_handler(ngx_http_request_t *r) { /* {{{ */
X     ngx_http_upload_loc_conf_t  *ulcf = ngx_http_get_module_loc_conf(r, ngx_http_upload_module);
X     ngx_http_upload_ctx_t       *ctx = ngx_http_get_module_ctx(r, ngx_http_upload_module);
X@@ -771,6 +1028,10 @@
X     ngx_str_t                   dummy = ngx_string("<ngx_upload_module_dummy>");
X     ngx_table_elt_t             *h;
X 
X+    if(ngx_http_upload_add_headers(r, ulcf) != NGX_OK) {
X+        return NGX_HTTP_INTERNAL_SERVER_ERROR;
X+    }
X+
X     if(ctx->prevent_output) {
X         r->headers_out.status = NGX_HTTP_CREATED;
X 
X@@ -952,7 +1213,8 @@
X     ngx_http_upload_loc_conf_t  *ulcf = ngx_http_get_module_loc_conf(r, ngx_http_upload_module);
X 
X     ngx_file_t  *file = &u->output_file;
X-    ngx_path_t  *path = ulcf->store_path;
X+    ngx_path_t  *path = u->store_path;
X+    ngx_path_t  *state_path = u->state_store_path;
X     uint32_t    n;
X     ngx_uint_t  i;
X     ngx_int_t   rc;
X@@ -992,6 +1254,7 @@
X                            "hashed path: %s", file->name.data);
X 
X             if(u->partial_content) {
X+                ngx_file_t *state_file = &u->state_file;
X                 if(u->merge_buffer == NULL) {
X                     u->merge_buffer = ngx_palloc(r->pool, ulcf->merge_buffer_size);
X 
X@@ -999,21 +1262,20 @@
X                         return NGX_UPLOAD_NOMEM;
X                 }
X 
X-                u->state_file.name.len = file->name.len + sizeof(".state") - 1;
X-                u->state_file.name.data = ngx_palloc(u->request->pool, u->state_file.name.len + 1);
X+                state_file->name.len = state_path->name.len + 1 + state_path->len + u->session_id.len + sizeof(".state");
X+                state_file->name.data = ngx_palloc(u->request->pool, state_file->name.len + 1);
X 
X-                if(u->state_file.name.data == NULL)
X+                if(state_file->name.data == NULL)
X                     return NGX_UPLOAD_NOMEM;
X 
X-                ngx_memcpy(u->state_file.name.data, file->name.data, file->name.len);
X+                ngx_memcpy(state_file->name.data, state_path->name.data, state_path->name.len);
X+                (void) ngx_sprintf(state_file->name.data + state_path->name.len + 1 + state_path->len,
X+                        "%V.state%Z", &u->session_id);
X 
X-                /*
X-                 * NOTE: we add terminating zero for system calls
X-                 */
X-                ngx_memcpy(u->state_file.name.data + file->name.len, ".state", sizeof(".state") - 1 + 1);
X+                ngx_create_hashed_filename(state_path, state_file->name.data, state_file->name.len);
X 
X                 ngx_log_debug1(NGX_LOG_DEBUG_CORE, file->log, 0,
X-                               "hashed path of state file: %s", u->state_file.name.data);
X+                               "hashed path of state file: %s", state_file->name.data);
X             }
X 
X             file->fd = ngx_open_file(file->name.data, NGX_FILE_WRONLY, NGX_FILE_CREATE_OR_OPEN, ulcf->store_access);
X@@ -1117,6 +1379,12 @@
X         if(u->sha1_ctx != NULL)
X             SHA1_Init(&u->sha1_ctx->sha1);
X 
X+        if(u->sha256_ctx != NULL)
X+            SHA256_Init(&u->sha256_ctx->sha256);
X+
X+        if(u->sha512_ctx != NULL)
X+            SHA512_Init(&u->sha512_ctx->sha512);
X+
X         if(u->calculate_crc32)
X             ngx_crc32_init(u->crc32);
X 
X@@ -1150,7 +1418,10 @@
X #if (NGX_PCRE)
X                 rc = ngx_regex_exec(f[i].regex, &u->field_name, NULL, 0);
X 
X-                if (rc != NGX_REGEX_NO_MATCHED && rc < 0) {
X+                /* Modified by Naren to work around iMovie and Quicktime which send empty values Added:  &&  u->field_name.len > 0 */
X+                if ((ulcf->empty_field_names && rc != NGX_REGEX_NO_MATCHED && rc < 0 && u->field_name.len != 0)
X+                    || (!ulcf->empty_field_names && rc != NGX_REGEX_NO_MATCHED && rc < 0))
X+                {
X                     return NGX_UPLOAD_SCRIPTERROR;
X                 }
X 
X@@ -1166,7 +1437,7 @@
X             }
X         }
X 
X-        if(pass_field && u->field_name.len > 0) { 
X+        if(pass_field && u->field_name.len != 0) { 
X             /*
X              * Here we do a small hack: the content of a non-file field
X              * is not known until ngx_http_upload_flush_output_buffer
X@@ -1207,6 +1478,12 @@
X         if(u->sha1_ctx)
X             SHA1_Final(u->sha1_ctx->sha1_digest, &u->sha1_ctx->sha1);
X 
X+        if(u->sha256_ctx)
X+            SHA256_Final(u->sha256_ctx->sha256_digest, &u->sha256_ctx->sha256);
X+
X+        if(u->sha512_ctx)
X+            SHA512_Final(u->sha512_ctx->sha512_digest, &u->sha512_ctx->sha512);
X+
X         if(u->calculate_crc32)
X             ngx_crc32_final(u->crc32);
X 
X@@ -1369,6 +1646,12 @@
X         if(u->sha1_ctx)
X             SHA1_Update(&u->sha1_ctx->sha1, buf, len);
X 
X+        if(u->sha256_ctx)
X+            SHA256_Update(&u->sha256_ctx->sha256, buf, len);
X+
X+        if(u->sha512_ctx)
X+            SHA512_Update(&u->sha512_ctx->sha512, buf, len);
X+
X         if(u->calculate_crc32)
X             ngx_crc32_update(&u->crc32, buf, len);
X 
X@@ -1678,7 +1961,7 @@
X     ngx_http_upload_merger_state_t ms;
X     off_t        remaining;
X     ssize_t      rc;
X-    int          result;
X+    __attribute__((__unused__)) int result;
X     ngx_buf_t    in_buf;
X     ngx_buf_t    out_buf;
X     ngx_http_upload_loc_conf_t  *ulcf = ngx_http_get_module_loc_conf(u->request, ngx_http_upload_module);
X@@ -1799,6 +2082,7 @@
X     conf->forward_args = NGX_CONF_UNSET;
X     conf->tame_arrays = NGX_CONF_UNSET;
X     conf->resumable_uploads = NGX_CONF_UNSET;
X+    conf->empty_field_names = NGX_CONF_UNSET;
X 
X     conf->buffer_size = NGX_CONF_UNSET_SIZE;
X     conf->merge_buffer_size = NGX_CONF_UNSET_SIZE;
X@@ -1809,6 +2093,7 @@
X     conf->limit_rate = NGX_CONF_UNSET_SIZE;
X 
X     /*
X+     * conf->header_templates,
X      * conf->field_templates,
X      * conf->aggregate_field_templates,
X      * and conf->field_filters are
X@@ -1830,27 +2115,15 @@
X     }
X 
X     if(conf->url.len != 0) {
X-#if defined nginx_version && nginx_version >= 7052
X-        ngx_conf_merge_path_value(cf,
X+        ngx_http_upload_merge_path_value(cf,
X                                   &conf->store_path,
X                                   prev->store_path,
X                                   &ngx_http_upload_temp_path);
X 
X-        ngx_conf_merge_path_value(cf,
X+        ngx_http_upload_merge_path_value(cf,
X                                   &conf->state_store_path,
X                                   prev->state_store_path,
X                                   &ngx_http_upload_temp_path);
X-#else
X-        ngx_conf_merge_path_value(conf->store_path,
X-                                  prev->store_path,
X-                                  NGX_HTTP_PROXY_TEMP_PATH, 1, 2, 0,
X-                                  ngx_garbage_collector_temp_handler, cf);
X-
X-        ngx_conf_merge_path_value(conf->state_store_path,
X-                                  prev->state_store_path,
X-                                  NGX_HTTP_PROXY_TEMP_PATH, 1, 2, 0,
X-                                  ngx_garbage_collector_temp_handler, cf);
X-#endif
X     }
X 
X     ngx_conf_merge_uint_value(conf->store_access,
X@@ -1897,6 +2170,11 @@
X             prev->resumable_uploads : 0;
X     }
X 
X+    if(conf->empty_field_names == NGX_CONF_UNSET) {
X+        conf->empty_field_names = (prev->empty_field_names != NGX_CONF_UNSET) ?
X+            prev->empty_field_names : 0;
X+    }
X+
X     if(conf->field_templates == NULL) {
X         conf->field_templates = prev->field_templates;
X     }
X@@ -1912,6 +2190,14 @@
X             conf->sha1 = prev->sha1;
X         }
X 
X+        if(prev->sha256) {
X+            conf->sha256 = prev->sha256;
X+        }
X+
X+        if(prev->sha512) {
X+            conf->sha512 = prev->sha512;
X+        }
X+
X         if(prev->crc32) {
X             conf->crc32 = prev->crc32;
X         }
X@@ -1925,6 +2211,10 @@
X         conf->cleanup_statuses = prev->cleanup_statuses;
X     }
X 
X+    if(conf->header_templates == NULL) {
X+        conf->header_templates = prev->header_templates;
X+    }
X+
X     return NGX_CONF_OK;
X } /* }}} */
X 
X@@ -2066,6 +2356,80 @@
X     return NGX_OK;
X } /* }}} */
X 
X+static ngx_int_t /* {{{ ngx_http_upload_sha256_variable */
X+ngx_http_upload_sha256_variable(ngx_http_request_t *r,
X+    ngx_http_variable_value_t *v,  uintptr_t data)
X+{
X+    ngx_uint_t             i;
X+    ngx_http_upload_ctx_t  *u;
X+    u_char                 *c;
X+    u_char                 *hex_table;
X+
X+    u = ngx_http_get_module_ctx(r, ngx_http_upload_module);
X+
X+    if(u->sha256_ctx == NULL || u->partial_content) {
X+        v->not_found = 1;
X+        return NGX_OK;
X+    }
X+
X+    v->valid = 1;
X+    v->no_cacheable = 0;
X+    v->not_found = 0;
X+
X+    hex_table = (u_char*)data;
X+    c = u->sha256_ctx->sha256_digest + SHA256_DIGEST_LENGTH * 2;
X+
X+    i = SHA256_DIGEST_LENGTH;
X+
X+    do{
X+        i--;
X+        *--c = hex_table[u->sha256_ctx->sha256_digest[i] & 0xf];
X+        *--c = hex_table[u->sha256_ctx->sha256_digest[i] >> 4];
X+    }while(i != 0);
X+
X+    v->data = u->sha256_ctx->sha256_digest;
X+    v->len = SHA256_DIGEST_LENGTH * 2;
X+
X+    return NGX_OK;
X+} /* }}} */
X+
X+static ngx_int_t /* {{{ ngx_http_upload_sha512_variable */
X+ngx_http_upload_sha512_variable(ngx_http_request_t *r,
X+    ngx_http_variable_value_t *v,  uintptr_t data)
X+{
X+    ngx_uint_t             i;
X+    ngx_http_upload_ctx_t  *u;
X+    u_char                 *c;
X+    u_char                 *hex_table;
X+
X+    u = ngx_http_get_module_ctx(r, ngx_http_upload_module);
X+
X+    if(u->sha512_ctx == NULL || u->partial_content) {
X+        v->not_found = 1;
X+        return NGX_OK;
X+    }
X+
X+    v->valid = 1;
X+    v->no_cacheable = 0;
X+    v->not_found = 0;
X+
X+    hex_table = (u_char*)data;
X+    c = u->sha512_ctx->sha512_digest + SHA512_DIGEST_LENGTH * 2;
X+
X+    i = SHA512_DIGEST_LENGTH;
X+
X+    do{
X+        i--;
X+        *--c = hex_table[u->sha512_ctx->sha512_digest[i] & 0xf];
X+        *--c = hex_table[u->sha512_ctx->sha512_digest[i] >> 4];
X+    }while(i != 0);
X+
X+    v->data = u->sha512_ctx->sha512_digest;
X+    v->len = SHA512_DIGEST_LENGTH * 2;
X+
X+    return NGX_OK;
X+} /* }}} */
X+
X static ngx_int_t /* {{{ ngx_http_upload_crc32_variable */
X ngx_http_upload_crc32_variable(ngx_http_request_t *r,
X     ngx_http_variable_value_t *v,  uintptr_t data)
X@@ -2299,6 +2663,10 @@
X                                        ", upload_file_md5_uc"
X                                        ", upload_file_sha1"
X                                        ", upload_file_sha1_uc"
X+                                       ", upload_file_sha256"
X+                                       ", upload_file_sha256_uc"
X+                                       ", upload_file_sha512"
X+                                       ", upload_file_sha512_uc"
X                                        ", upload_file_crc32"
X                                        ", upload_content_range"
X                                        " and upload_file_size"
X@@ -2312,6 +2680,12 @@
X                 if(v->get_handler == ngx_http_upload_sha1_variable)
X                     ulcf->sha1 = 1;
X 
X+                if(v->get_handler == ngx_http_upload_sha256_variable)
X+                    ulcf->sha256 = 1;
X+
X+                if(v->get_handler == ngx_http_upload_sha512_variable)
X+                    ulcf->sha512 = 1;
X+
X                 if(v->get_handler == ngx_http_upload_crc32_variable)
X                     ulcf->crc32 = 1;
X             }
X@@ -2396,37 +2770,104 @@
X     return NGX_CONF_OK;
X } /* }}} */
X 
X-static char * /* {{{ ngx_http_upload_cleanup */
X-ngx_http_upload_cleanup(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
X+static char * /* {{{ ngx_http_upload_add_header */
X+ngx_http_upload_add_header(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
X {
X-    ngx_http_upload_loc_conf_t *ulcf = conf;
X-
X     ngx_str_t                  *value;
X-    ngx_uint_t                 i;
X-    ngx_int_t                  status, lo, hi;
X-    uint16_t                   *s;
X+    ngx_http_upload_header_template_t *h;
X+    ngx_array_t                 **field;
X+    ngx_http_compile_complex_value_t   ccv;
X+
X+    field = (ngx_array_t**) (((u_char*)conf) + cmd->offset);
X 
X     value = cf->args->elts;
X 
X-    if (ulcf->cleanup_statuses == NULL) {
X-        ulcf->cleanup_statuses = ngx_array_create(cf->pool, 1,
X-                                        sizeof(uint16_t));
X-        if (ulcf->cleanup_statuses == NULL) {
X+    /*
X+     * Add new entry to header template list
X+     */
X+    if (*field == NULL) {
X+        *field = ngx_array_create(cf->pool, 1,
X+                                  sizeof(ngx_http_upload_header_template_t));
X+        if (*field == NULL) {
X             return NGX_CONF_ERROR;
X         }
X     }
X 
X-    for (i = 1; i < cf->args->nelts; i++) {
X-        if(value[i].len > 4 && value[i].data[3] == '-') {
X-            lo = ngx_atoi(value[i].data, 3);
X-
X-            if (lo == NGX_ERROR) {
X-                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
X-                                   "invalid lower bound \"%V\"", &value[i]);
X-                return NGX_CONF_ERROR;
X-            }
X-
X-            hi = ngx_atoi(value[i].data + 4, value[i].len - 4);
X+    h = ngx_array_push(*field);
X+    if (h == NULL) {
X+        return NGX_CONF_ERROR;
X+    }
X+
X+    /*
X+     * Compile header name
X+     */
X+    h->name = ngx_palloc(cf->pool, sizeof(ngx_http_complex_value_t));
X+    if(h->name == NULL) {
X+        return NGX_CONF_ERROR;
X+    }
X+
X+    ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
X+
X+    ccv.cf = cf;
X+    ccv.value = &value[1];
X+    ccv.complex_value = h->name;
X+
X+    if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
X+        return NGX_CONF_ERROR;
X+    }
X+
X+    /*
X+     * Compile header value
X+     */
X+    h->value = ngx_palloc(cf->pool, sizeof(ngx_http_complex_value_t));
X+    if(h->value == NULL) {
X+        return NGX_CONF_ERROR;
X+    }
X+
X+    ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
X+
X+    ccv.cf = cf;
X+    ccv.value = &value[2];
X+    ccv.complex_value = h->value;
X+
X+    if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
X+        return NGX_CONF_ERROR;
X+    }
X+
X+    return NGX_CONF_OK;
X+} /* }}} */
X+
X+static char * /* {{{ ngx_http_upload_cleanup */
X+ngx_http_upload_cleanup(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
X+{
X+    ngx_http_upload_loc_conf_t *ulcf = conf;
X+
X+    ngx_str_t                  *value;
X+    ngx_uint_t                 i;
X+    ngx_int_t                  status, lo, hi;
X+    uint16_t                   *s;
X+
X+    value = cf->args->elts;
X+
X+    if (ulcf->cleanup_statuses == NULL) {
X+        ulcf->cleanup_statuses = ngx_array_create(cf->pool, 1,
X+                                        sizeof(uint16_t));
X+        if (ulcf->cleanup_statuses == NULL) {
X+            return NGX_CONF_ERROR;
X+        }
X+    }
X+
X+    for (i = 1; i < cf->args->nelts; i++) {
X+        if(value[i].len > 4 && value[i].data[3] == '-') {
X+            lo = ngx_atoi(value[i].data, 3);
X+
X+            if (lo == NGX_ERROR) {
X+                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
X+                                   "invalid lower bound \"%V\"", &value[i]);
X+                return NGX_CONF_ERROR;
X+            }
X+
X+            hi = ngx_atoi(value[i].data + 4, value[i].len - 4);
X 
X             if (hi == NGX_ERROR) {
X                 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
X@@ -2453,9 +2894,9 @@
X             hi = lo = status;
X         }
X 
X-        if (lo < 400 || hi > 599) {
X+        if (lo < 200 || hi > 599) {
X             ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
X-                               "value(s) \"%V\" must be between 400 and 599",
X+                               "value(s) \"%V\" must be between 200 and 599",
X                                &value[i]);
X             return NGX_CONF_ERROR;
X         }
X@@ -2523,6 +2964,665 @@
X     return NGX_CONF_OK;
X } /* }}} */
X 
X+static char * /* {{{ ngx_http_upload_set_path_slot */
X+ngx_http_upload_set_path_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
X+{
X+    char  *p = conf;
X+
X+    ssize_t      level;
X+    ngx_str_t   *value;
X+    ngx_uint_t   i, n;
X+    ngx_http_upload_path_t *path, **slot;
X+    ngx_http_compile_complex_value_t   ccv;
X+
X+    slot = (ngx_http_upload_path_t **) (p + cmd->offset);
X+
X+    if (*slot) {
X+        return "is duplicate";
X+    }
X+
X+    path = ngx_pcalloc(cf->pool, sizeof(ngx_http_upload_path_t));
X+    if (path == NULL) {
X+        return NGX_CONF_ERROR;
X+    }
X+
X+    path->path = ngx_pcalloc(cf->pool, sizeof(ngx_path_t));
X+    if (path->path == NULL) {
X+        return NGX_CONF_ERROR;
X+    }
X+
X+    value = cf->args->elts;
X+
X+    path->path->name = value[1];
X+
X+    if (path->path->name.data[path->path->name.len - 1] == '/') {
X+        path->path->name.len--;
X+    }
X+
X+    if (ngx_conf_full_name(cf->cycle, &path->path->name, 0) != NGX_OK) {
X+        return NULL;
X+    }
X+
X+    path->path->len = 0;
X+    path->path->manager = NULL;
X+    path->path->loader = NULL;
X+    path->path->conf_file = cf->conf_file->file.name.data;
X+    path->path->line = cf->conf_file->line;
X+
X+    for (i = 0, n = 2; n < cf->args->nelts; i++, n++) {
X+        level = ngx_atoi(value[n].data, value[n].len);
X+        if (level == NGX_ERROR || level == 0) {
X+            return "invalid value";
X+        }
X+
X+        path->path->level[i] = level;
X+        path->path->len += level + 1;
X+    }
X+
X+    while (i < 3) {
X+        path->path->level[i++] = 0;
X+    }
X+
X+    *slot = path;
X+
X+    if(ngx_http_script_variables_count(&value[1])) {
X+        ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
X+
X+        ccv.cf = cf;
X+        ccv.value = &value[1];
X+        ccv.complex_value = &path->dynamic;
X+
X+        if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
X+            return NGX_CONF_ERROR;
X+        }
X+
X+        path->is_dynamic = 1;
X+    }
X+    else {
X+        if (ngx_add_path(cf, &path->path) == NGX_ERROR) {
X+            return NGX_CONF_ERROR;
X+        }
X+    }
X+
X+    return NGX_CONF_OK;
X+} /* }}} */
X+
X+
X+static char * /* {{{ ngx_http_upload_merge_path_value */
X+ngx_http_upload_merge_path_value(ngx_conf_t *cf, ngx_http_upload_path_t **path, ngx_http_upload_path_t *prev,
X+    ngx_path_init_t *init)
X+{
X+    if (*path) {
X+        return NGX_CONF_OK;
X+    }
X+
X+    if (prev) {
X+        *path = prev;
X+        return NGX_CONF_OK;
X+    }
X+
X+    *path = ngx_palloc(cf->pool, sizeof(ngx_http_upload_path_t));
X+    if(*path == NULL) {
X+        return NGX_CONF_ERROR;
X+    }
X+
X+    (*path)->path = ngx_pcalloc(cf->pool, sizeof(ngx_path_t));
X+    if((*path)->path == NULL) {
X+        return NGX_CONF_ERROR;
X+    }
X+
X+    (*path)->path->name = init->name;
X+
X+    if(ngx_conf_full_name(cf->cycle, &(*path)->path->name, 0) != NGX_OK) {
X+        return NGX_CONF_ERROR;
X+    }
X+
X+    (*path)->path->level[0] = init->level[0];
X+    (*path)->path->level[1] = init->level[1];
X+    (*path)->path->level[2] = init->level[2];
X+
X+    (*path)->path->len = init->level[0] + (init->level[0] ? 1 : 0)
X+                   + init->level[1] + (init->level[1] ? 1 : 0)
X+                   + init->level[2] + (init->level[2] ? 1 : 0);
X+
X+    (*path)->path->manager = NULL;
X+    (*path)->path->loader = NULL;
X+    (*path)->path->conf_file = NULL;
X+
X+    if(ngx_add_path(cf, &(*path)->path) != NGX_OK) {
X+        return NGX_CONF_ERROR;
X+    }
X+
X+    return NGX_CONF_OK;
X+} /* }}} */
X+
X+static ngx_int_t
X+ngx_http_write_request_body(ngx_http_request_t *r)
X+{
X+    ssize_t                    n;
X+    ngx_chain_t               *cl;
X+    ngx_temp_file_t           *tf;
X+    ngx_http_request_body_t   *rb;
X+    ngx_http_core_loc_conf_t  *clcf;
X+
X+    rb = r->request_body;
X+
X+    ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
X+                   "http write client request body, bufs %p", rb->bufs);
X+
X+    if (rb->temp_file == NULL) {
X+        tf = ngx_pcalloc(r->pool, sizeof(ngx_temp_file_t));
X+        if (tf == NULL) {
X+            return NGX_ERROR;
X+        }
X+
X+        clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
X+
X+        tf->file.fd = NGX_INVALID_FILE;
X+        tf->file.log = r->connection->log;
X+        tf->path = clcf->client_body_temp_path;
X+        tf->pool = r->pool;
X+        tf->warn = "a client request body is buffered to a temporary file";
X+        tf->log_level = r->request_body_file_log_level;
X+        tf->persistent = r->request_body_in_persistent_file;
X+        tf->clean = r->request_body_in_clean_file;
X+
X+        if (r->request_body_file_group_access) {
X+            tf->access = 0660;
X+        }
X+
X+        rb->temp_file = tf;
X+
X+        if (rb->bufs == NULL) {
X+            /* empty body with r->request_body_in_file_only */
X+
X+            if (ngx_create_temp_file(&tf->file, tf->path, tf->pool,
X+                                     tf->persistent, tf->clean, tf->access)
X+                != NGX_OK)
X+            {
X+                return NGX_ERROR;
X+            }
X+
X+            return NGX_OK;
X+        }
X+    }
X+
X+    if (rb->bufs == NULL) {
X+        return NGX_OK;
X+    }
X+
X+    n = ngx_write_chain_to_temp_file(rb->temp_file, rb->bufs);
X+
X+    /* TODO: n == 0 or not complete and level event */
X+
X+    if (n == NGX_ERROR) {
X+        return NGX_ERROR;
X+    }
X+
X+    rb->temp_file->offset += n;
X+
X+    /* mark all buffers as written */
X+
X+    for (cl = rb->bufs; cl; cl = cl->next) {
X+        cl->buf->pos = cl->buf->last;
X+    }
X+
X+    rb->bufs = NULL;
X+
X+    return NGX_OK;
X+}
X+
X+static ngx_int_t
X+ngx_http_request_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
X+{
X+    if (r->headers_in.chunked) {
X+        return ngx_http_request_body_chunked_filter(r, in);
X+
X+    } else {
X+        return ngx_http_request_body_length_filter(r, in);
X+    }
X+}
X+
X+static ngx_int_t
X+ngx_http_request_body_save_filter(ngx_http_request_t *r, ngx_chain_t *in)
X+{
X+#if (NGX_DEBUG)
X+    ngx_chain_t               *cl;
X+#endif
X+    ngx_http_request_body_t   *rb;
X+
X+    rb = r->request_body;
X+
X+#if (NGX_DEBUG)
X+
X+    for (cl = rb->bufs; cl; cl = cl->next) {
X+        ngx_log_debug7(NGX_LOG_DEBUG_EVENT, r->connection->log, 0,
X+                       "http body old buf t:%d f:%d %p, pos %p, size: %z "
X+                       "file: %O, size: %z",
X+                       cl->buf->temporary, cl->buf->in_file,
X+                       cl->buf->start, cl->buf->pos,
X+                       cl->buf->last - cl->buf->pos,
X+                       cl->buf->file_pos,
X+                       cl->buf->file_last - cl->buf->file_pos);
X+    }
X+
X+    for (cl = in; cl; cl = cl->next) {
X+        ngx_log_debug7(NGX_LOG_DEBUG_EVENT, r->connection->log, 0,
X+                       "http body new buf t:%d f:%d %p, pos %p, size: %z "
X+                       "file: %O, size: %z",
X+                       cl->buf->temporary, cl->buf->in_file,
X+                       cl->buf->start, cl->buf->pos,
X+                       cl->buf->last - cl->buf->pos,
X+                       cl->buf->file_pos,
X+                       cl->buf->file_last - cl->buf->file_pos);
X+    }
X+
X+#endif
X+
X+    /* TODO: coalesce neighbouring buffers */
X+
X+    if (ngx_chain_add_copy(r->pool, &rb->bufs, in) != NGX_OK) {
X+        return NGX_HTTP_INTERNAL_SERVER_ERROR;
X+    }
X+
X+    return NGX_OK;
X+}
X+
X+
X+static ngx_int_t
X+ngx_http_request_body_length_filter(ngx_http_request_t *r, ngx_chain_t *in)
X+{
X+    size_t                     size;
X+    ngx_int_t                  rc;
X+    ngx_buf_t                 *b;
X+    ngx_chain_t               *cl, *tl, *out, **ll;
X+    ngx_http_request_body_t   *rb;
X+
X+    rb = r->request_body;
X+
X+    if (rb->rest == -1) {
X+        ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
X+                       "http request body content length filter");
X+
X+        rb->rest = r->headers_in.content_length_n;
X+    }
X+
X+    out = NULL;
X+    ll = &out;
X+
X+    for (cl = in; cl; cl = cl->next) {
X+
X+        tl = ngx_chain_get_free_buf(r->pool, &rb->free);
X+        if (tl == NULL) {
X+            return NGX_HTTP_INTERNAL_SERVER_ERROR;
X+        }
X+
X+        b = tl->buf;
X+
X+        ngx_memzero(b, sizeof(ngx_buf_t));
X+
X+        b->temporary = 1;
X+        b->tag = (ngx_buf_tag_t) &ngx_http_read_client_request_body;
X+        b->start = cl->buf->start;
X+        b->pos = cl->buf->pos;
X+        b->last = cl->buf->last;
X+        b->end = cl->buf->end;
X+
X+        size = cl->buf->last - cl->buf->pos;
X+
X+        if ((off_t) size < rb->rest) {
X+            cl->buf->pos = cl->buf->last;
X+            rb->rest -= size;
X+
X+        } else {
X+            cl->buf->pos += rb->rest;
X+            rb->rest = 0;
X+            b->last = cl->buf->pos;
X+            b->last_buf = 1;
X+        }
X+
X+        *ll = tl;
X+        ll = &tl->next;
X+    }
X+
X+    rc = ngx_http_request_body_save_filter(r, out);
X+
X+    ngx_chain_update_chains(r->pool, &rb->free, &rb->busy, &out,
X+                            (ngx_buf_tag_t) &ngx_http_read_client_request_body);
X+
X+    return rc;
X+}
X+
X+static ngx_int_t
X+ngx_http_request_body_chunked_filter(ngx_http_request_t *r, ngx_chain_t *in)
X+{
X+    size_t                     size;
X+    ngx_int_t                  rc;
X+    ngx_buf_t                 *b;
X+    ngx_chain_t               *cl, *out, *tl, **ll;
X+    ngx_http_request_body_t   *rb;
X+    ngx_http_core_loc_conf_t  *clcf;
X+
X+    rb = r->request_body;
X+
X+    if (rb->rest == -1) {
X+
X+        ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
X+                       "http request body chunked filter");
X+
X+        rb->chunked = ngx_pcalloc(r->pool, sizeof(ngx_http_chunked_t));
X+        if (rb->chunked == NULL) {
X+            return NGX_HTTP_INTERNAL_SERVER_ERROR;
X+        }
X+
X+        r->headers_in.content_length_n = 0;
X+        rb->rest = 3;
X+    }
X+
X+    out = NULL;
X+    ll = &out;
X+
X+    for (cl = in; cl; cl = cl->next) {
X+
X+        for ( ;; ) {
X+
X+            ngx_log_debug7(NGX_LOG_DEBUG_EVENT, r->connection->log, 0,
X+                           "http body chunked buf "
X+                           "t:%d f:%d %p, pos %p, size: %z file: %O, size: %z",
X+                           cl->buf->temporary, cl->buf->in_file,
X+                           cl->buf->start, cl->buf->pos,
X+                           cl->buf->last - cl->buf->pos,
X+                           cl->buf->file_pos,
X+                           cl->buf->file_last - cl->buf->file_pos);
X+
X+            rc = ngx_http_parse_chunked(r, cl->buf, rb->chunked);
X+
X+            if (rc == NGX_OK) {
X+
X+                /* a chunk has been parsed successfully */
X+
X+                clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
X+
X+                if (clcf->client_max_body_size
X+                    && clcf->client_max_body_size
X+                       < r->headers_in.content_length_n + rb->chunked->size)
X+                {
X+                    ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
X+                                  "client intended to send too large chunked "
X+                                  "body: %O bytes",
X+                                  r->headers_in.content_length_n
X+                                  + rb->chunked->size);
X+
X+                    r->lingering_close = 1;
X+
X+                    return NGX_HTTP_REQUEST_ENTITY_TOO_LARGE;
X+                }
X+
X+                tl = ngx_chain_get_free_buf(r->pool, &rb->free);
X+                if (tl == NULL) {
X+                    return NGX_HTTP_INTERNAL_SERVER_ERROR;
X+                }
X+
X+                b = tl->buf;
X+
X+                ngx_memzero(b, sizeof(ngx_buf_t));
X+
X+                b->temporary = 1;
X+                b->tag = (ngx_buf_tag_t) &ngx_http_read_client_request_body;
X+                b->start = cl->buf->start;
X+                b->pos = cl->buf->pos;
X+                b->last = cl->buf->last;
X+                b->end = cl->buf->end;
X+
X+                *ll = tl;
X+                ll = &tl->next;
X+
X+                size = cl->buf->last - cl->buf->pos;
X+
X+                if ((off_t) size > rb->chunked->size) {
X+                   cl->buf->pos += rb->chunked->size;
X+                    r->headers_in.content_length_n += rb->chunked->size;
X+                    rb->chunked->size = 0;
X+
X+                } else {
X+                    rb->chunked->size -= size;
X+                    r->headers_in.content_length_n += size;
X+                    cl->buf->pos = cl->buf->last;
X+                }
X+
X+                b->last = cl->buf->pos;
X+
X+                continue;
X+            }
X+
X+            if (rc == NGX_DONE) {
X+
X+                /* a whole response has been parsed successfully */
X+
X+                rb->rest = 0;
X+
X+                tl = ngx_chain_get_free_buf(r->pool, &rb->free);
X+                if (tl == NULL) {
X+                    return NGX_HTTP_INTERNAL_SERVER_ERROR;
X+                }
X+
X+                b = tl->buf;
X+
X+                ngx_memzero(b, sizeof(ngx_buf_t));
X+
X+                b->last_buf = 1;
X+
X+                *ll = tl;
X+                ll = &tl->next;
X+
X+                break;
X+            }
X+
X+            if (rc == NGX_AGAIN) {
X+
X+                /* set rb->rest, amount of data we want to see next time */
X+
X+                rb->rest = rb->chunked->length;
X+
X+                break;
X+            }
X+
X+            /* invalid */
X+
X+            ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
X+                          "client sent invalid chunked body");
X+
X+            return NGX_HTTP_BAD_REQUEST;
X+        }
X+    }
X+
X+    rc = ngx_http_request_body_save_filter(r, out);
X+
X+    ngx_chain_update_chains(r->pool, &rb->free, &rb->busy, &out,
X+                            (ngx_buf_tag_t) &ngx_http_read_client_request_body);
X+
X+    return rc;
X+}
X+
X+static ngx_int_t
X+ngx_http_do_read_client_request_body(ngx_http_request_t *r)
X+{
X+    off_t                      rest;
X+    size_t                     size;
X+    ssize_t                    n;
X+    ngx_int_t                  rc;
X+    ngx_buf_t                 *b;
X+    ngx_chain_t               *cl, out;
X+    ngx_connection_t          *c;
X+    ngx_http_request_body_t   *rb;
X+    ngx_http_core_loc_conf_t  *clcf;
X+
X+    c = r->connection;
X+    rb = r->request_body;
X+
X+    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
X+                   "http read client request body");
X+
X+    for ( ;; ) {
X+        for ( ;; ) {
X+            if (rb->buf->last == rb->buf->end) {
X+
X+                /* pass buffer to request body filter chain */
X+
X+                out.buf = rb->buf;
X+                out.next = NULL;
X+
X+                rc = ngx_http_request_body_filter(r, &out);
X+
X+                if (rc != NGX_OK) {
X+                    return rc;
X+                }
X+
X+                /* write to file */
X+
X+                if (ngx_http_write_request_body(r) != NGX_OK) {
X+                    return NGX_HTTP_INTERNAL_SERVER_ERROR;
X+                }
X+
X+                /* update chains */
X+
X+                rc = ngx_http_request_body_filter(r, NULL);
X+
X+                if (rc != NGX_OK) {
X+                    return rc;
X+                }
X+
X+                if (rb->busy != NULL) {
X+                    return NGX_HTTP_INTERNAL_SERVER_ERROR;
X+                }
X+
X+                rb->buf->pos = rb->buf->start;
X+                rb->buf->last = rb->buf->start;
X+            }
X+            size = rb->buf->end - rb->buf->last;
X+            rest = rb->rest - (rb->buf->last - rb->buf->pos);
X+
X+            if ((off_t) size > rest) {
X+                size = (size_t) rest;
X+            }
X+
X+            n = c->recv(c, rb->buf->last, size);
X+
X+            ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
X+                           "http client request body recv %z", n);
X+
X+            if (n == NGX_AGAIN) {
X+                break;
X+            }
X+
X+            if (n == 0) {
X+                ngx_log_error(NGX_LOG_INFO, c->log, 0,
X+                              "client prematurely closed connection");
X+            }
X+
X+            if (n == 0 || n == NGX_ERROR) {
X+                c->error = 1;
X+                return NGX_HTTP_BAD_REQUEST;
X+            }
X+
X+            rb->buf->last += n;
X+            r->request_length += n;
X+
X+            if (n == rest) {
X+                /* pass buffer to request body filter chain */
X+
X+                out.buf = rb->buf;
X+                out.next = NULL;
X+
X+                rc = ngx_http_request_body_filter(r, &out);
X+
X+                if (rc != NGX_OK) {
X+                    return rc;
X+                }
X+            }
X+
X+            if (rb->rest == 0) {
X+                break;
X+            }
X+
X+            if (rb->buf->last < rb->buf->end) {
X+                break;
X+            }
X+        }
X+
X+        ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
X+                       "http client request body rest %O", rb->rest);
X+                      if (rb->rest == 0) {
X+            break;
X+        }
X+
X+        if (!c->read->ready) {
X+            clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
X+            ngx_add_timer(c->read, clcf->client_body_timeout);
X+
X+            if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
X+                return NGX_HTTP_INTERNAL_SERVER_ERROR;
X+            }
X+
X+            return NGX_AGAIN;
X+        }
X+    }
X+
X+    if (c->read->timer_set) {
X+        ngx_del_timer(c->read);
X+    }
X+
X+    if (rb->temp_file || r->request_body_in_file_only) {
X+
X+        /* save the last part */
X+
X+        if (ngx_http_write_request_body(r) != NGX_OK) {
X+            return NGX_HTTP_INTERNAL_SERVER_ERROR;
X+        }
X+
X+        cl = ngx_chain_get_free_buf(r->pool, &rb->free);
X+        if (cl == NULL) {
X+            return NGX_HTTP_INTERNAL_SERVER_ERROR;
X+        }
X+
X+        b = cl->buf;
X+
X+        ngx_memzero(b, sizeof(ngx_buf_t));
X+
X+        b->in_file = 1;
X+        b->file_last = rb->temp_file->file.offset;
X+        b->file = &rb->temp_file->file;
X+
X+        rb->bufs = cl;
X+    }
X+
X+    r->read_event_handler = ngx_http_block_reading;
X+
X+    rb->post_handler(r);
X+
X+    return NGX_OK;
X+}
X+
X+
X+static void
X+ngx_http_read_client_request_body_handler(ngx_http_request_t *r)
X+{
X+    ngx_int_t  rc;
X+
X+    if (r->connection->read->timedout) {
X+        r->connection->timedout = 1;
X+        ngx_http_finalize_request(r, NGX_HTTP_REQUEST_TIME_OUT);
X+        return;
X+    }
X+
X+    rc = ngx_http_do_read_client_request_body(r);
X+
X+    if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {
X+        ngx_http_finalize_request(r, rc);
X+    }
X+}
X+
X+
X ngx_int_t /* {{{ ngx_http_read_upload_client_request_body */
X ngx_http_read_upload_client_request_body(ngx_http_request_t *r) {
X     ssize_t                    size, preread;
X@@ -2625,9 +3725,9 @@
X 
X             /* the whole request body may be placed in r->header_in */
X 
X-            rb->to_write = rb->bufs;
X-
X-            r->read_event_handler = ngx_http_read_upload_client_request_body_handler;
X+            rb->buf = r->header_in;
X+            r->read_event_handler = ngx_http_read_client_request_body_handler;
X+            r->write_event_handler = ngx_http_request_empty_handler;
X 
X             return ngx_http_do_read_upload_client_request_body(r);
X         }
X@@ -2684,7 +3784,9 @@
X 
X     *next = cl;
X 
X-    rb->to_write = rb->bufs;
X+    /*
X+     * rb->to_write = rb->bufs;
X+     */
X 
X     r->read_event_handler = ngx_http_read_upload_client_request_body_handler;
X 
X@@ -2766,7 +3868,7 @@
X         for ( ;; ) {
X             if (rb->buf->last == rb->buf->end) {
X 
X-                rc = ngx_http_process_request_body(r, rb->to_write);
X+                 rc = ngx_http_process_request_body(r, rb->bufs);
X 
X                 switch(rc) {
X                     case NGX_OK:
X@@ -2781,8 +3883,7 @@
X                     default:
X                         return NGX_HTTP_INTERNAL_SERVER_ERROR;
X                 }
X-
X-                rb->to_write = rb->bufs->next ? rb->bufs->next : rb->bufs;
X+                rb->bufs = rb->bufs->next ? rb->bufs->next : rb->bufs;
X                 rb->buf->last = rb->buf->start;
X             }
X 
X@@ -2874,7 +3975,7 @@
X         ngx_del_timer(c->read);
X     }
X 
X-    rc = ngx_http_process_request_body(r, rb->to_write);
X+    rc = ngx_http_process_request_body(r, rb->bufs);
X 
X     switch(rc) {
X         case NGX_OK:
X@@ -3299,6 +4400,14 @@
X                     return NGX_HTTP_REQUEST_ENTITY_TOO_LARGE;
X                 }
X 
X+                if( (upload_ctx->content_range_n.end - upload_ctx->content_range_n.start + 1)
X+                    != headers_in->content_length_n) 
X+                {
X+                    ngx_log_error(NGX_LOG_ERR, upload_ctx->log, 0,
X+                                  "range length is not equal to content length");
X+                    return NGX_HTTP_RANGE_NOT_SATISFIABLE;
X+                }
X+
X                 upload_ctx->partial_content = 1;
X             }
X         }
X@@ -3436,8 +4545,8 @@
X         return NGX_ERROR;
X     }
X 
X-    if(range_n->start >= range_n->end || range_n->start >= range_n->total
X-        || range_n->end > range_n->total)
X+    if(range_n->start > range_n->end || range_n->start >= range_n->total
X+        || range_n->end >= range_n->total)
X     {
X         return NGX_ERROR;
X     }
X@@ -3673,3 +4782,43 @@
X     }
X } /* }}} */
X 
X+static ngx_int_t /* {{{ */
X+ngx_http_upload_test_expect(ngx_http_request_t *r)
X+{
X+    ngx_int_t   n;
X+    ngx_str_t  *expect;
X+
X+    if (r->expect_tested
X+        || r->headers_in.expect == NULL
X+        || r->http_version < NGX_HTTP_VERSION_11)
X+    {
X+        return NGX_OK;
X+    }
X+
X+    r->expect_tested = 1;
X+
X+    expect = &r->headers_in.expect->value;
X+
X+    if (expect->len != sizeof("100-continue") - 1
X+        || ngx_strncasecmp(expect->data, (u_char *) "100-continue",
X+                           sizeof("100-continue") - 1)
X+           != 0)
X+    {
X+        return NGX_OK;
X+    }
X+
X+    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
X+                   "send 100 Continue");
X+
X+    n = r->connection->send(r->connection,
X+                            (u_char *) "HTTP/1.1 100 Continue" CRLF CRLF,
X+                            sizeof("HTTP/1.1 100 Continue" CRLF CRLF) - 1);
X+
X+    if (n == sizeof("HTTP/1.1 100 Continue" CRLF CRLF) - 1) {
X+        return NGX_OK;
X+    }
X+
X+    /* we assume that such small packet should be send successfully */
X+
X+    return NGX_ERROR;
X+} /* }}} */
X
c27d3f0b6463a1682564dc8082406685
echo x - tengine-devel/files/patch-man-nginx
sed 's/^X//' >tengine-devel/files/patch-man-nginx << 'f473587abcda6f4df0e7f17099680e06'
X--- man/nginx.8.orig 2013-11-22 08:47:33.000000000 +0100
X+++ man/nginx.8	2014-01-17 04:06:57.811820154 +0100
X@@ -1,6 +1,8 @@
X .\"
X .\" Copyright (C) 2010 Sergey A. Osokin
X+.\" Copyright (C) 2014 Jim Ohlstein
X .\" Copyright (C) Nginx, Inc.
X+.\" Copyright (C) Taobao, Inc.
X .\" All rights reserved.
X .\"
X .\" Redistribution and use in source and binary forms, with or without
X@@ -25,7 +27,7 @@
X .\" SUCH DAMAGE.
X .\"
X .\"
X-.Dd March 6, 2012
X+.Dd January 16, 2014
X .Dt NGINX 8
X .Os
X .Sh NAME
X@@ -35,7 +35,7 @@
X .Nd "HTTP and reverse proxy server, mail proxy server"
X .Sh SYNOPSIS
X .Nm
X-.Op Fl ?hqtVv
X+.Op Fl ?dhlmqtVv
X .Op Fl c Ar file
X .Op Fl g Ar directives
X .Op Fl p Ar prefix
X@@ -46,6 +48,13 @@
X It is known for its high performance, stability, rich feature set, simple
X configuration, and low resource consumption.
X .Pp
X+Tengine (pronounced
X+.Dq T engine )
X+is a fork of 
X+.Nm
X+by Taobao in 2011. It supports dynamic shared objects (DSO's) 
X+and has other enhanced features.
X+.Pp
X The options are as follows:
X .Bl -tag -width ".Fl d Ar directives"
X .It Fl ?\& , h
X@@ -53,11 +62,22 @@
X .It Fl c Ar file
X Use an alternative configuration
X .Ar file .
X+.It Fl d
X+Dump the contents of the configuration file, including the 
X+contents of 'included' files.
X .It Fl g Ar directives
X Set global configuration directives.
X See
X .Sx EXAMPLES
X for details.
X+.It Fl l
X+Show all supported directives then exit.
X+.It Fl m
X+Show all compiled-in modules then exit. 
X+Tengine supports DSO modules since 1.4.0.
X+The tag 'static' means static module.
X+The tag 'shared' means dynamic shared module which is also 
X+attached with major and minor version of this modules.
X .It Fl p Ar prefix
X Set the prefix path.
X The default value is
X@@ -113,10 +133,6 @@
X Shut down gracefully.
X .It Dv SIGUSR1
X Reopen log files.
X-.It Dv SIGUSR2
X-Upgrade the
X-.Nm
X-executable on the fly.
X .It Dv SIGWINCH
X Shut down worker processes gracefully.
X .El
X@@ -183,14 +199,20 @@
X .\"Xr nginx.conf 5
X .\"Pp
X Documentation at
X-.Pa http://nginx.org/en/docs/ .
X+.Pa http://nginx.org/en/docs/ 
X+and 
X+.Pa http://tengine.taobao.org/documentation.html .
X .Pp
X For questions and technical support, please refer to
X-.Pa http://nginx.org/en/support.html .
X+.Pa http://nginx.org/en/support.html 
X+and 
X+.Pa http://tengine.taobao.org/ .
X .Sh HISTORY
X Development of
X .Nm
X started in 2002, with the first public release on October 4, 2004.
X+.Pp
X+Tengine was open sourced in 2011.
X .Sh AUTHORS
X .An -nosplit
X .An Igor Sysoev Aq igor at sysoev.ru .
X@@ -199,4 +221,6 @@
X .An Sergey A. Osokin Aq osa at FreeBSD.org.ru
X as a result of compiling many
X .Nm
X-documents from all over the world.
X+documents from all over the world. Tengine specific
X+portions added by 
X+.An Jim Ohlstein Aq jim at ohlste.in
f473587abcda6f4df0e7f17099680e06
echo x - tengine-devel/files/extra-patch-ngx_http_sflow_config.h
sed 's/^X//' >tengine-devel/files/extra-patch-ngx_http_sflow_config.h << '1c4e0fc75c507752e1fb97c6a4dc342f'
X--- ../nginx-sflow-module-0.9.7/ngx_http_sflow_config.h.orig	2012-07-31 21:36:49.000000000 +0400
X+++ ../nginx-sflow-module-0.9.7/ngx_http_sflow_config.h	2012-07-31 21:37:20.000000000 +0400
X@@ -17,7 +17,7 @@
X   -----------------___________________________------------------
X */
X 
X-#define SFWB_DEFAULT_CONFIGFILE "/etc/hsflowd.auto"
X+#define SFWB_DEFAULT_CONFIGFILE "%%PREFIX%%/etc/hsflowd.auto"
X #define SFWB_SEPARATORS " \t\r\n="
X #define SFWB_QUOTES "'\" \t\r\n"
X /* SFWB_MAX LINE LEN must be enough to hold the whole list of targets */
1c4e0fc75c507752e1fb97c6a4dc342f
echo x - tengine-devel/files/extra-patch-agentzh-set-misc-nginx-module-config
sed 's/^X//' >tengine-devel/files/extra-patch-agentzh-set-misc-nginx-module-config << '7d8a7a08318f93cec034bbe25274e3ad'
X--- ../agentzh-set-misc-nginx-module-6ce586e/config.orig       2011-12-09 10:27:53.861265188 +0300
X+++ ../agentzh-set-misc-nginx-module-6ce586e/config    2011-12-09 10:28:07.107259301 +0300
X@@ -1,10 +1,3 @@
X-if echo $HTTP_MODULES | grep " ndk_http_module" > /dev/null; then
X-    echo "found ngx_devel_kit for ngx_set_misc; looks good."
X-else
X-    echo "error: ngx_devel_kit is required to build ngx_set_misc; please put it before ngx_set_misc." 1>&2
X-    exit 1
X-fi
X-
X ngx_addon_name=ngx_http_set_misc_module
X HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_set_misc_module"
X NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_set_base32.c $ngx_addon_dir/src/ngx_http_set_default_value.c $ngx_addon_dir/src/ngx_http_set_hashed_upstream.c $ngx_addon_dir/src/ngx_http_set_quote_sql.c $ngx_addon_dir/src/ngx_http_set_quote_json.c $ngx_addon_dir/src/ngx_http_set_unescape_uri.c $ngx_addon_dir/src/ngx_http_set_misc_module.c $ngx_addon_dir/src/ngx_http_set_escape_uri.c $ngx_addon_dir/src/ngx_http_set_hash.c $ngx_addon_dir/src/ngx_http_set_local_today.c $ngx_addon_dir/src/ngx_http_set_hex.c $ngx_addon_dir/src/ngx_http_set_base64.c $ngx_addon_dir/src/ngx_http_set_random.c"
7d8a7a08318f93cec034bbe25274e3ad
echo x - tengine-devel/files/patch-conf-nginx.conf
sed 's/^X//' >tengine-devel/files/patch-conf-nginx.conf << '3f58dcc9fe791ac02f494ec4d5d22364'
X--- conf/nginx.conf.orig	2014-01-08 13:24:46.000000000 +0100
X+++ conf/nginx.conf	2014-01-11 18:04:48.015083445 +0100
X@@ -13,12 +13,45 @@
X     worker_connections  1024;
X }
X 
X-# load modules compiled as Dynamic Shared Object (DSO)
X+# Load modules compiled as Dynamic Shared Object (DSO)
X+# Comment out modules you do not wish to load
X #
X-#dso {
X-#    load ngx_http_fastcgi_module.so;
X-#    load ngx_http_rewrite_module.so;
X-#}
X+dso {
X+	load ngx_http_access_module.so;
X+	load ngx_http_addition_filter_module.so;
X+	load ngx_http_autoindex_module.so;
X+	load ngx_http_browser_module.so;
X+	load ngx_http_charset_filter_module.so;
X+	load ngx_http_concat_module.so;
X+	load ngx_http_empty_gif_module.so;
X+	load ngx_http_fastcgi_module.so;
X+	load ngx_http_flv_module.so;
X+	load ngx_http_footer_filter_module.so;
X+	load ngx_http_geoip_module.so;
X+	load ngx_http_image_filter_module.so;
X+	load ngx_http_limit_conn_module.so;
X+	load ngx_http_limit_req_module.so;
X+	load ngx_http_lua_module.so;
X+	load ngx_http_map_module.so;
X+	load ngx_http_memcached_module.so;
X+	load ngx_http_mp4_module.so;
X+	load ngx_http_random_index_module.so;
X+	load ngx_http_referer_module.so;
X+	load ngx_http_scgi_module.so;
X+	load ngx_http_secure_link_module.so;
X+	load ngx_http_slice_module.so;
X+	load ngx_http_split_clients_module.so;
X+	load ngx_http_sub_filter_module.so;
X+	load ngx_http_sysguard_module.so;
X+	load ngx_http_trim_filter_module.so;
X+	load ngx_http_upstream_ip_hash_module.so;
X+	load ngx_http_upstream_least_conn_module.so;
X+	load ngx_http_upstream_session_sticky_module.so;
X+	load ngx_http_user_agent_module.so;
X+	load ngx_http_userid_filter_module.so;
X+	load ngx_http_uwsgi_module.so;
X+	load ngx_http_xslt_filter_module.so;
X+}
X 
X http {
X     include       mime.types;
X@@ -39,7 +72,7 @@
X     #gzip  on;
X 
X     server {
X-        listen       80;
X+        listen       %%HTTP_PORT%%;
X         server_name  localhost;
X 
X         #charset koi8-r;
X@@ -47,7 +80,7 @@
X         #access_log  logs/host.access.log  main;
X 
X         location / {
X-            root   html;
X+            root   %%PREFIX%%/www/nginx;
X             index  index.html index.htm;
X         }
X 
X@@ -57,7 +90,7 @@
X         #
X         error_page   500 502 503 504  /50x.html;
X         location = /50x.html {
X-            root   html;
X+            root   %%PREFIX%%/www/nginx-dist;
X         }
X 
X         # proxy the PHP scripts to Apache listening on 127.0.0.1:80
X@@ -102,16 +135,16 @@
X     # HTTPS server
X     #
X     #server {
X-    #    listen       443;
X+    #    listen       443 ssl;
X     #    server_name  localhost;
X 
X-    #    ssl                  on;
X     #    ssl_certificate      cert.pem;
X     #    ssl_certificate_key  cert.key;
X 
X+    #    ssl_session_cache    shared:SSL:1m;
X     #    ssl_session_timeout  5m;
X 
X-    #    ssl_protocols  SSLv2 SSLv3 TLSv1;
X+    #    ssl_protocols  SSLv3 TLSv1 TLSv1.1 TLSv1.2;
X     #    ssl_ciphers  HIGH:!aNULL:!MD5;
X     #    ssl_prefer_server_ciphers   on;
X 
3f58dcc9fe791ac02f494ec4d5d22364
echo x - tengine-devel/files/extra-patch-ngx_http_sflow_config.c
sed 's/^X//' >tengine-devel/files/extra-patch-ngx_http_sflow_config.c << 'f591fa6249f50d71f1e303a15b316331'
X--- ../nginx-sflow-module-0.9.7/ngx_http_sflow_config.c.orig	2012-06-07 04:52:57.000000000 +0400
X+++ ../nginx-sflow-module-0.9.7/ngx_http_sflow_config.c	2012-06-07 04:59:18.000000000 +0400
X@@ -26,7 +26,6 @@
X         ngx_log_error(NGX_LOG_ERR, log, 0, "getaddrinfo() failed: %s", gai_strerror(err));
X         switch(err) {
X         case EAI_NONAME: break;
X-        case EAI_NODATA: break;
X         case EAI_AGAIN: break; // loop and try again?
X         default: ngx_log_error(NGX_LOG_ERR, log, 0, "getaddrinfo() error: %s", gai_strerror(err)); break;
X         }
f591fa6249f50d71f1e303a15b316331
echo x - tengine-devel/files/extra-patch-chaoslawful-drizzle-nginx-module-config
sed 's/^X//' >tengine-devel/files/extra-patch-chaoslawful-drizzle-nginx-module-config << '67a8733e33c6259d7cdb1ef69ea5cf4f'
X--- ../chaoslawful-drizzle-nginx-module-e6937ba/config.orig	2011-12-30 10:26:53.000000000 +0400
X+++ ../chaoslawful-drizzle-nginx-module-e6937ba/config	2011-12-30 10:28:20.000000000 +0400
X@@ -22,12 +22,12 @@
X 
X     if [ $ngx_found = no ]; then
X         # FreeBSD, OpenBSD
X-        ngx_feature="libdrizzle library in /usr/local/"
X-        ngx_feature_path="/usr/local/include/libdrizzle-1.0"
X+        ngx_feature="libdrizzle library in %%PREFIX%%"
X+        ngx_feature_path="%%PREFIX%%/include/libdrizzle"
X         if [ $NGX_RPATH = YES ]; then
X-            ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -ldrizzle"
X+            ngx_feature_libs="-R%%PREFIX%%/lib -L%%PREFIX%%/lib -ldrizzle"
X         else
X-            ngx_feature_libs="-L/usr/local/lib -ldrizzle"
X+            ngx_feature_libs="-L%%PREFIX%%/lib -ldrizzle"
X         fi
X         . auto/feature
X     fi
67a8733e33c6259d7cdb1ef69ea5cf4f
echo x - tengine-devel/files/nginx.in
sed 's/^X//' >tengine-devel/files/nginx.in << 'b16cee1eac5ca646d537f2203280c2ae'
X#!/bin/sh
X# $FreeBSD $
X
X# PROVIDE: nginx
X# REQUIRE: LOGIN cleanvar
X# KEYWORD: shutdown
X
X#
X# Add the following lines to /etc/rc.conf to enable nginx:
X# nginx_enable (bool):		Set to "NO" by default.
X#				Set it to "YES" to enable nginx
X# nginx_profiles (str):		Set to "" by default.
X#				Define your profiles here.
X# nginx_pid_prefix (str):	Set to "" by default.
X#				When using profiles manually assign value to "nginx_"
X#				for prevent collision with other PIDs names.
X# nginxlimits_enable (bool):	Set to "NO" by default.
X#				Set it to yes to run `limits $limits_args`
X#				just before nginx starts.
X# nginx_flags (str):		Set to "" by default.
X#				Extra flags passed to start command.
X# nginxlimits_args (str):	Default to "-e -U %%WWWOWN%%"
X#				Arguments of pre-start limits run.
X
X. /etc/rc.subr
X
Xname="nginx"
Xrcvar=nginx_enable
X
Xstart_precmd="nginx_precmd"
Xrestart_precmd="nginx_checkconfig"
Xreload_precmd="nginx_checkconfig"
Xconfigtest_cmd="nginx_checkconfig"
Xgracefulstop_cmd="nginx_gracefulstop"
Xcommand="%%PREFIX%%/sbin/nginx"
X_pidprefix="%%NGINX_RUNDIR%%"
Xpidfile="${_pidprefix}/${name}.pid"
X_tmpprefix="%%NGINX_TMPDIR%%"
Xrequired_files=%%PREFIX%%/etc/tengine/nginx.conf
Xextra_commands="reload configtest gracefulstop"
X
X[ -z "$nginx_enable" ]		&& nginx_enable="NO"
X[ -z "$nginxlimits_enable" ]	&& nginxlimits_enable="NO"
X[ -z "$nginxlimits_args" ]	&& nginxlimits_args="-e -U %%WWWOWN%%"
X
Xload_rc_config $name
X
Xif [ -n "$2" ]; then
X	profile="$2"
X	if [ "x${nginx_profiles}" != "x" ]; then
X		pidfile="${_pidprefix}/${nginx_pid_prefix}${profile}.pid"
X		eval nginx_configfile="\${nginx_${profile}_configfile:-}"
X		if [ "x${nginx_configfile}" = "x" ]; then
X			echo "You must define a configuration file (nginx_${profile}_configfile)"
X			exit 1
X		fi
X		required_files="${nginx_configfile}"
X		eval nginx_enable="\${nginx_${profile}_enable:-${nginx_enable}}"
X		eval nginx_flags="\${nginx_${profile}_flags:-${nginx_flags}}"
X		eval nginxlimits_enable="\${nginxlimits_${profile}_enable:-${nginxlimits_enable}}"
X		eval nginxlimits_args="\${nginxlimits_${profile}_args:-${nginxlimits_args}}"
X		nginx_flags="-c ${nginx_configfile} -g \"pid ${pidfile};\" ${nginx_flags}"
X	else
X		echo "$0: extra argument ignored"
X	fi
Xelse
X	if [ "x${nginx_profiles}" != "x" -a "x$1" != "x" ]; then
X		for profile in ${nginx_profiles}; do
X			echo "===> nginx profile: ${profile}"
X			%%PREFIX%%/etc/rc.d/nginx $1 ${profile}
X			retcode="$?"
X			if [ "0${retcode}" -ne 0 ]; then
X				failed="${profile} (${retcode}) ${failed:-}"
X			else
X				success="${profile} ${success:-}"
X			fi
X		done
X		exit 0
X	fi
Xfi
X
X# tmpfs(5)
Xnginx_checktmpdir()
X{
X	if [ ! -d ${_tmpprefix} ] ; then
X		install -d -o %%WWWOWN%% -g %%WWWGRP%% -m 755 ${_tmpprefix}
X	fi
X}
X
Xnginx_checkconfig()
X{
X	nginx_checktmpdir
X
X	echo "Performing sanity check on nginx configuration:"
X	eval ${command} ${nginx_flags} -t
X}
X
Xnginx_gracefulstop()
X{
X	echo "Performing a graceful stop:"
X	sig_stop="QUIT"
X	run_rc_command ${rc_prefix}stop $rc_extra_args || return 1
X}
X
Xnginx_precmd() 
X{
X	nginx_checkconfig
X
X	if checkyesno nginxlimits_enable
X	then
X		eval `/usr/bin/limits ${nginxlimits_args}` 2>/dev/null
X	else
X		return 0
X	fi
X}
X
Xrun_rc_command "$1"
b16cee1eac5ca646d537f2203280c2ae
echo x - tengine-devel/files/extra-patch-ngx_postgres-config
sed 's/^X//' >tengine-devel/files/extra-patch-ngx_postgres-config << '30f00adb4a649a24d0ef6fc588759e3f'
X--- ../ngx_postgres-0.9/config.orig	2011-12-29 11:17:24.000000000 +0400
X+++ ../ngx_postgres-0.9/config	2011-12-29 11:18:47.000000000 +0400
X@@ -48,12 +48,12 @@
X 
X     if [ $ngx_found = no ]; then
X         # FreeBSD
X-        ngx_feature="libpq library in /usr/local/"
X-        ngx_feature_path="/usr/local/include"
X+        ngx_feature="libpq library in %%PREFIX%%/"
X+        ngx_feature_path="%%PREFIX%%/include"
X         if [ $NGX_RPATH = YES ]; then
X-            ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lpq"
X+            ngx_feature_libs="-R%%PREFIX%%/lib -L%%PREFIX%%/lib -lpq"
X         else
X-            ngx_feature_libs="-L/usr/local/lib -lpq"
X+            ngx_feature_libs="-L%%PREFIX%%/lib -lpq"
X         fi
X         . auto/feature
X     fi
30f00adb4a649a24d0ef6fc588759e3f
echo x - tengine-devel/pkg-plist
sed 's/^X//' >tengine-devel/pkg-plist << 'a437b1f9393ea33fc5631278b7fb5194'
X at comment $FreeBSD$
X at unexec if cmp -s %D/%%ETCDIR%%/fastcgi_params-dist %D/%%ETCDIR%%/fastcgi_params; then rm -f %D/%%ETCDIR%%/fastcgi_params; fi
X%%ETCDIR%%/fastcgi_params-dist
X at exec if [ ! -f %D/%%ETCDIR%%/fastcgi_params ] ; then cp -p %D/%F %B/fastcgi_params && chmod u+w %B/fastcgi_params; fi
X%%ETCDIR%%/koi-utf
X%%ETCDIR%%/koi-win
X at unexec if cmp -s %D/%%ETCDIR%%/scgi_params-dist %D/%%ETCDIR%%/scgi_params; then rm -f %D/%%ETCDIR%%/scgi_params; fi
X%%ETCDIR%%/scgi_params-dist
X at exec if [ ! -f %D/%%ETCDIR%%/scgi_params ] ; then cp -p %D/%F %B/scgi_params && chmod u+w %B/scgi_params; fi
X at unexec if cmp -s %D/%%ETCDIR%%/uwsgi_params-dist %D/%%ETCDIR%%/uwsgi_params; then rm -f %D/%%ETCDIR%%/uwsgi_params; fi
X%%ETCDIR%%/uwsgi_params-dist
X at exec if [ ! -f %D/%%ETCDIR%%/uwsgi_params ] ; then cp -p %D/%F %B/uwsgi_params  && chmod u+w %B/uwsgi_params; fi
X%%ETCDIR%%/win-utf
X at unexec if cmp -s %D/%%ETCDIR%%/mime.types-dist %D/%%ETCDIR%%/mime.types; then rm -f %D/%%ETCDIR%%/mime.types; fi
X%%ETCDIR%%/mime.types-dist
X at exec if [ ! -f %D/%%ETCDIR%%/mime.types ] ; then cp -p %D/%F %B/mime.types  && chmod u+w %B/mime.types; fi
X at unexec if cmp -s %D/%%ETCDIR%%/nginx.conf-dist %D/%%ETCDIR%%/nginx.conf; then rm -f %D/%%ETCDIR%%/nginx.conf; fi
X at dirrmtry %%ETCDIR%%
X%%ETCDIR%%/nginx.conf-dist
X at exec if [ ! -f %D/%%ETCDIR%%/nginx.conf ] ; then cp -p %D/%F %B/nginx.conf && chmod u+w %B/nginx.conf; fi
X at exec if [ ! -d %%NGINX_TMPDIR%% ] ; then mkdir  %%NGINX_TMPDIR%%; fi
X%%WWWDATA%%@exec mkdir -p -m 755 %D/www/nginx-dist
X%%WWWDATA%%@exec if [ ! -d %D/www/nginx/ ] ; then ln -fs %D/www/nginx-dist %D/www/nginx; fi
X%%WWWDATA%%www/nginx-dist/EXAMPLE_DIRECTORY-DONT_ADD_OR_TOUCH_ANYTHING
X%%WWWDATA%%www/nginx-dist/index.html
X%%WWWDATA%%www/nginx-dist/50x.html
X%%WWWDATA%%@exec chmod a-w %D/www/nginx-dist
X%%WWWDATA%%@unexec if [ -L %D/www/nginx ]; then rm -f %D/www/nginx; fi
X%%WWWDATA%%@dirrmtry www/nginx-dist
Xetc/tengine/include/ddebug.h
Xetc/tengine/include/nginx.h
Xetc/tengine/include/ngx_alloc.h
Xetc/tengine/include/ngx_array.h
Xetc/tengine/include/ngx_atomic.h
Xetc/tengine/include/ngx_auto_config.h
Xetc/tengine/include/ngx_auto_headers.h
Xetc/tengine/include/ngx_buf.h
Xetc/tengine/include/ngx_channel.h
Xetc/tengine/include/ngx_conf_file.h
Xetc/tengine/include/ngx_config.h
Xetc/tengine/include/ngx_connection.h
Xetc/tengine/include/ngx_core.h
Xetc/tengine/include/ngx_crc.h
Xetc/tengine/include/ngx_crc32.h
Xetc/tengine/include/ngx_crypt.h
Xetc/tengine/include/ngx_cycle.h
Xetc/tengine/include/ngx_darwin.h
Xetc/tengine/include/ngx_darwin_config.h
Xetc/tengine/include/ngx_errno.h
Xetc/tengine/include/ngx_event.h
Xetc/tengine/include/ngx_event_busy_lock.h
Xetc/tengine/include/ngx_event_connect.h
Xetc/tengine/include/ngx_event_openssl.h
Xetc/tengine/include/ngx_event_pipe.h
Xetc/tengine/include/ngx_event_posted.h
Xetc/tengine/include/ngx_event_timer.h
Xetc/tengine/include/ngx_file.h
Xetc/tengine/include/ngx_files.h
Xetc/tengine/include/ngx_freebsd.h
Xetc/tengine/include/ngx_freebsd_config.h
Xetc/tengine/include/ngx_freebsd_rfork_thread.h
Xetc/tengine/include/ngx_gcc_atomic_amd64.h
Xetc/tengine/include/ngx_gcc_atomic_ppc.h
Xetc/tengine/include/ngx_gcc_atomic_sparc64.h
Xetc/tengine/include/ngx_gcc_atomic_x86.h
Xetc/tengine/include/ngx_hash.h
Xetc/tengine/include/ngx_http.h
Xetc/tengine/include/ngx_http_busy_lock.h
Xetc/tengine/include/ngx_http_cache.h
Xetc/tengine/include/ngx_http_config.h
Xetc/tengine/include/ngx_http_core_module.h
Xetc/tengine/include/ngx_http_lua_accessby.h
Xetc/tengine/include/ngx_http_lua_args.h
Xetc/tengine/include/ngx_http_lua_bodyfilterby.h
Xetc/tengine/include/ngx_http_lua_cache.h
Xetc/tengine/include/ngx_http_lua_capturefilter.h
Xetc/tengine/include/ngx_http_lua_clfactory.h
Xetc/tengine/include/ngx_http_lua_common.h
Xetc/tengine/include/ngx_http_lua_conf.h
Xetc/tengine/include/ngx_http_lua_consts.h
Xetc/tengine/include/ngx_http_lua_contentby.h
Xetc/tengine/include/ngx_http_lua_control.h
Xetc/tengine/include/ngx_http_lua_coroutine.h
Xetc/tengine/include/ngx_http_lua_ctx.h
Xetc/tengine/include/ngx_http_lua_directive.h
Xetc/tengine/include/ngx_http_lua_exception.h
Xetc/tengine/include/ngx_http_lua_headerfilterby.h
Xetc/tengine/include/ngx_http_lua_headers.h
Xetc/tengine/include/ngx_http_lua_headers_in.h
Xetc/tengine/include/ngx_http_lua_headers_out.h
Xetc/tengine/include/ngx_http_lua_initby.h
Xetc/tengine/include/ngx_http_lua_log.h
Xetc/tengine/include/ngx_http_lua_logby.h
Xetc/tengine/include/ngx_http_lua_misc.h
Xetc/tengine/include/ngx_http_lua_ndk.h
Xetc/tengine/include/ngx_http_lua_output.h
Xetc/tengine/include/ngx_http_lua_pcrefix.h
Xetc/tengine/include/ngx_http_lua_phase.h
Xetc/tengine/include/ngx_http_lua_probe.h
Xetc/tengine/include/ngx_http_lua_regex.h
Xetc/tengine/include/ngx_http_lua_req_body.h
Xetc/tengine/include/ngx_http_lua_req_method.h
Xetc/tengine/include/ngx_http_lua_rewriteby.h
Xetc/tengine/include/ngx_http_lua_script.h
Xetc/tengine/include/ngx_http_lua_setby.h
Xetc/tengine/include/ngx_http_lua_shdict.h
Xetc/tengine/include/ngx_http_lua_sleep.h
Xetc/tengine/include/ngx_http_lua_socket_tcp.h
Xetc/tengine/include/ngx_http_lua_socket_udp.h
Xetc/tengine/include/ngx_http_lua_string.h
Xetc/tengine/include/ngx_http_lua_subrequest.h
Xetc/tengine/include/ngx_http_lua_time.h
Xetc/tengine/include/ngx_http_lua_uri.h
Xetc/tengine/include/ngx_http_lua_uthread.h
Xetc/tengine/include/ngx_http_lua_util.h
Xetc/tengine/include/ngx_http_lua_variable.h
Xetc/tengine/include/ngx_http_request.h
Xetc/tengine/include/ngx_http_script.h
Xetc/tengine/include/ngx_http_spdy.h
Xetc/tengine/include/ngx_http_spdy_module.h
Xetc/tengine/include/ngx_http_ssi_filter_module.h
Xetc/tengine/include/ngx_http_ssl_module.h
Xetc/tengine/include/ngx_http_upstream.h
Xetc/tengine/include/ngx_http_upstream_round_robin.h
Xetc/tengine/include/ngx_http_variables.h
Xetc/tengine/include/ngx_inet.h
Xetc/tengine/include/ngx_linux.h
Xetc/tengine/include/ngx_linux_config.h
Xetc/tengine/include/ngx_list.h
Xetc/tengine/include/ngx_log.h
Xetc/tengine/include/ngx_md5.h
Xetc/tengine/include/ngx_murmurhash.h
Xetc/tengine/include/ngx_open_file_cache.h
Xetc/tengine/include/ngx_os.h
Xetc/tengine/include/ngx_palloc.h
Xetc/tengine/include/ngx_parse.h
Xetc/tengine/include/ngx_pipe.h
Xetc/tengine/include/ngx_posix_config.h
Xetc/tengine/include/ngx_process.h
Xetc/tengine/include/ngx_process_cycle.h
Xetc/tengine/include/ngx_queue.h
Xetc/tengine/include/ngx_radix_tree.h
Xetc/tengine/include/ngx_rbtree.h
Xetc/tengine/include/ngx_regex.h
Xetc/tengine/include/ngx_resolver.h
Xetc/tengine/include/ngx_segment_tree.h
Xetc/tengine/include/ngx_setaffinity.h
Xetc/tengine/include/ngx_setproctitle.h
Xetc/tengine/include/ngx_sha1.h
Xetc/tengine/include/ngx_shmem.h
Xetc/tengine/include/ngx_shmtx.h
Xetc/tengine/include/ngx_slab.h
Xetc/tengine/include/ngx_socket.h
Xetc/tengine/include/ngx_solaris.h
Xetc/tengine/include/ngx_solaris_config.h
Xetc/tengine/include/ngx_string.h
Xetc/tengine/include/ngx_sunpro_atomic_sparc64.h
Xetc/tengine/include/ngx_sysinfo.h
Xetc/tengine/include/ngx_syslog.h
Xetc/tengine/include/ngx_thread.h
Xetc/tengine/include/ngx_time.h
Xetc/tengine/include/ngx_times.h
Xetc/tengine/include/ngx_trie.h
Xetc/tengine/include/ngx_user.h
Xetc/tengine/modules/ngx_http_access_module.so
Xetc/tengine/modules/ngx_http_addition_filter_module.so
Xetc/tengine/modules/ngx_http_autoindex_module.so
Xetc/tengine/modules/ngx_http_browser_module.so
Xetc/tengine/modules/ngx_http_charset_filter_module.so
Xetc/tengine/modules/ngx_http_concat_module.so
Xetc/tengine/modules/ngx_http_empty_gif_module.so
Xetc/tengine/modules/ngx_http_fastcgi_module.so
Xetc/tengine/modules/ngx_http_flv_module.so
Xetc/tengine/modules/ngx_http_footer_filter_module.so
Xetc/tengine/modules/ngx_http_geoip_module.so
Xetc/tengine/modules/ngx_http_image_filter_module.so
Xetc/tengine/modules/ngx_http_limit_conn_module.so
Xetc/tengine/modules/ngx_http_limit_req_module.so
Xetc/tengine/modules/ngx_http_lua_module.so
Xetc/tengine/modules/ngx_http_map_module.so
Xetc/tengine/modules/ngx_http_memcached_module.so
Xetc/tengine/modules/ngx_http_mp4_module.so
Xetc/tengine/modules/ngx_http_random_index_module.so
Xetc/tengine/modules/ngx_http_referer_module.so
Xetc/tengine/modules/ngx_http_scgi_module.so
Xetc/tengine/modules/ngx_http_secure_link_module.so
Xetc/tengine/modules/ngx_http_slice_module.so
Xetc/tengine/modules/ngx_http_split_clients_module.so
Xetc/tengine/modules/ngx_http_sub_filter_module.so
Xetc/tengine/modules/ngx_http_sysguard_module.so
Xetc/tengine/modules/ngx_http_trim_filter_module.so
Xetc/tengine/modules/ngx_http_upstream_ip_hash_module.so
Xetc/tengine/modules/ngx_http_upstream_least_conn_module.so
Xetc/tengine/modules/ngx_http_upstream_session_sticky_module.so
Xetc/tengine/modules/ngx_http_user_agent_module.so
Xetc/tengine/modules/ngx_http_userid_filter_module.so
Xetc/tengine/modules/ngx_http_uwsgi_module.so
Xetc/tengine/modules/ngx_http_xslt_filter_module.so
Xsbin/nginx
Xsbin/dso_tool
X at unexec if [ -z ${UPGRADE_PORT} ] ; then rm -fr %%NGINX_TMPDIR%%; fi
Xman/man8/nginx.8.gz
X at dirrmtry etc/tengine/modules
X at dirrmtry etc/tengine/include
a437b1f9393ea33fc5631278b7fb5194
echo x - tengine-devel/distinfo
sed 's/^X//' >tengine-devel/distinfo << '923cf5d1944f9bc27b87a19fa3e3331d'
XSHA256 (tengine-2.0.0.tar.gz) = d179ee26d8a794867bc83f9c55cefc15ee99f914395309b8d325b45bba121c3f
XSIZE (tengine-2.0.0.tar.gz) = 1506369
XSHA256 (giom-nginx_accept_language_module-2f69842.tar.gz) = fbcdf792160a1eff7b9549aeb5209d6e76716ff8e86b05e42c90b2d2f858e011
XSIZE (giom-nginx_accept_language_module-2f69842.tar.gz) = 3399
XSHA256 (nginx-accesskey-2.0.3.tar.gz) = d9e94321e78a02de16c57f3e048fd31059fd8116ed03d6de7180f435c52502b1
XSIZE (nginx-accesskey-2.0.3.tar.gz) = 2632
XSHA256 (samizdatco-nginx-http-auth-digest-bd1c86a.tar.gz) = e223f55fd97e56425e232d8698e024707d1b2ed3714eff7d91a4d1ca76b4cbee
XSIZE (samizdatco-nginx-http-auth-digest-bd1c86a.tar.gz) = 14454
XSHA256 (http_auth_ldap-c4dc7c9153.tar.gz) = ac082a36afdbcfd883303bc2b1aaea5f2b4d2a772ad8eec9ecf3328e81300e1a
XSIZE (http_auth_ldap-c4dc7c9153.tar.gz) = 5323
XSHA256 (ngx_http_auth_pam_module-1.2.tar.gz) = 5a85970ba61a99f55a26d2536a11d512b39bbd622f5737d25a9a8c10db81efa9
XSIZE (ngx_http_auth_pam_module-1.2.tar.gz) = 5424
XSHA256 (ngx_http_auth_request_module-0.2.tar.gz) = eea5d0ec02bba93d0b204a034230cc61462b60497cbac6f581d7e008a9262ba4
XSIZE (ngx_http_auth_request_module-0.2.tar.gz) = 6736
XSHA256 (ngx_cache_purge-2.1.tar.gz) = 424005af0c04e59ffa65a65e446081d4f95ee76a801a7555e001c67810bcb3b9
XSIZE (ngx_cache_purge-2.1.tar.gz) = 10535
XSHA256 (agentzh-echo-nginx-module-v0.50-0-gf827a4f.tar.gz) = 0121dd5a8053d6960c9acc364f7552db1bcc64aa4340d0bf7f6d09d3125cfbe9
XSIZE (agentzh-echo-nginx-module-v0.50-0-gf827a4f.tar.gz) = 62907
XSHA256 (agentzh-headers-more-nginx-module-v0.24-0-g7a6fd11.tar.gz) = 1bc8e48da5c6b9968620114776be2751ab600c7953a04c08e16901de3ef2aec2
XSIZE (agentzh-headers-more-nginx-module-v0.24-0-g7a6fd11.tar.gz) = 27666
XSHA256 (arut-nginx-dav-ext-module-v0.0.2-0-g0e07a3e.tar.gz) = a0d6fa256e354ce48c06e1f689d26ebb2f7b75f71ce682e34ae6c29331a7fbff
XSIZE (arut-nginx-dav-ext-module-v0.0.2-0-g0e07a3e.tar.gz) = 6065
XSHA256 (vkholodkov-nginx-eval-module-1.0.3-0-g125fa2e.tar.gz) = 945046c42d973be9293e03ab41e3a0e04677524b2cd813cfc5146cf1d2f0ab8f
XSIZE (vkholodkov-nginx-eval-module-1.0.3-0-g125fa2e.tar.gz) = 5727
XSHA256 (ngx-fancyindex-0.3.1.tar.gz) = 877e383c6bc06be92abb88f5ac251a165b63feb5f4828d52a554efc19a3f7c7d
XSIZE (ngx-fancyindex-0.3.1.tar.gz) = 13071
XSHA256 (nginx_mogilefs_module-1.0.4.tar.gz) = 7ac230d30907f013dff8d435a118619ea6168aa3714dba62c6962d350c6295ae
XSIZE (nginx_mogilefs_module-1.0.4.tar.gz) = 11208
XSHA256 (kr-nginx-notice-0-g3c95966.tar.gz) = bb0b8c603b2df206aeb13100fb60c1328aa6a69d0ac7f411e5dabe8fdb2affce
XSIZE (kr-nginx-notice-0-g3c95966.tar.gz) = 3348
XSHA256 (nginx_http_push_module-0.692.tar.gz) = 64868708071aa21dbc4c7a07d149dd6ec9108fb7eaf2aad5ad069406151f17fe
XSIZE (nginx_http_push_module-0.692.tar.gz) = 29119
XSHA256 (wandenberg-nginx-push-stream-module-0.3.5-0-gb6a8c46.tar.gz) = f2c5b2cc3430f023442381b734a1e547dd2ba75a05cd34f2cdcf2431acc4f77e
XSIZE (wandenberg-nginx-push-stream-module-0.3.5-0-gb6a8c46.tar.gz) = 153187
XSHA256 (ngx_http_redis-0.3.7.tar.gz) = 9dfc14db81f431fdf3d69f3661a37daf110aef5f9479aa7c88cf362bb5d62604
XSIZE (ngx_http_redis-0.3.7.tar.gz) = 12165
XSHA256 (ngx_http_response-0.3.tar.gz) = 0835584029f053051c624adbe33a826ab0205c9d85a02af6019e6b57607e9045
XSIZE (ngx_http_response-0.3.tar.gz) = 2244
XSHA256 (nginx_upload_module-2.2.0.tar.gz) = b1c26abe0427180602e257627b4ed21848c93cc20cefc33af084983767d65805
XSIZE (nginx_upload_module-2.2.0.tar.gz) = 25796
XSHA256 (masterzen-nginx-upload-progress-module-v0.9.0-0-ga788dea.tar.gz) = 3fb903dab595cf6656fa0fc5743a48daffbba2f6b5c554836be630800eaad4e2
XSIZE (masterzen-nginx-upload-progress-module-v0.9.0-0-ga788dea.tar.gz) = 17020
XSHA256 (nginx_upstream_fair-20090923.tar.gz) = ec9ed7f856263e17faadee3dc7209932364ded4e546b829841c2454aa432450b
XSIZE (nginx_upstream_fair-20090923.tar.gz) = 10024
XSHA256 (wandenberg-nginx-video-thumbextractor-module-0.2.0-0-g9406457.tar.gz) = 8c39593b7a16003cad5d071df96dcf451fe41d64ba5dbf658e26e7b4684528ff
XSIZE (wandenberg-nginx-video-thumbextractor-module-0.2.0-0-g9406457.tar.gz) = 8812
XSHA256 (mod_zip-1.1.6.tar.gz) = d30546b4be8308c721df0240ebc38c474c6b577381a110321eded6dbed5104b1
XSIZE (mod_zip-1.1.6.tar.gz) = 21991
XSHA256 (chaoslawful-drizzle-nginx-module-v0.1.6-0-ge6937ba.tar.gz) = ec04631c6a1fe75329a831511c5693520bb2bfdedfb3ccc9de4b6a390bc2ba9c
XSIZE (chaoslawful-drizzle-nginx-module-v0.1.6-0-ge6937ba.tar.gz) = 61351
XSHA256 (simpl-ngx_devel_kit-v0.2.19-0-g8dd0df5.tar.gz) = 9a8c372f8e750d33018d9587d288c17f755e8da38592bca8ef9bf9ea4bab59a7
XSIZE (simpl-ngx_devel_kit-v0.2.19-0-g8dd0df5.tar.gz) = 65033
XSHA256 (agentzh-encrypted-session-nginx-module-v0.03-0-g49d741b.tar.gz) = 4485214756dc935a959efd3a2fcd750263df1719956a4ac73f96b0cee0763395
XSIZE (agentzh-encrypted-session-nginx-module-v0.03-0-g49d741b.tar.gz) = 8947
XSHA256 (mdirolf-nginx-gridfs-v0.8-0-gb5f8113.tar.gz) = f55617873c9b123d610d59e4da52703c07be0bae5c719ef0cc3d45a53480d29c
XSIZE (mdirolf-nginx-gridfs-v0.8-0-gb5f8113.tar.gz) = 18882
XSHA256 (mongodb-mongo-c-driver-v0.3.1-0-g9b4b232.tar.gz) = bfcdd60c6b53bd499e2bf22fefc96848de37e7d57dfaf7303bb00376dcb812f0
XSIZE (mongodb-mongo-c-driver-v0.3.1-0-g9b4b232.tar.gz) = 53033
XSHA256 (arut-nginx-let-module-v0.0.4-0-ga5e1dc5.tar.gz) = 9253581f11966329f64b4b4a49a2a60798665812f9007222592586e64bcd66da
XSIZE (arut-nginx-let-module-v0.0.4-0-ga5e1dc5.tar.gz) = 20543
XSHA256 (agentzh-memc-nginx-module-v0.14-0-gde4cf86.tar.gz) = 5e8cacd7af42685794bbe121264173de4141e5746031e23f8e363ab14ccb1534
XSIZE (agentzh-memc-nginx-module-v0.14-0-gde4cf86.tar.gz) = 37755
XSHA256 (modsecurity-apache_2.7.5.tar.gz) = 9e907536278d8da80d3dbb29aeffe9c4ec37ce9b641035b2da64e993135647a2
XSIZE (modsecurity-apache_2.7.5.tar.gz) = 1045387
XSHA256 (ngx_postgres-0.9.tar.gz) = aac0141e73b5c440927b7e040072f120b36e49deb2ff36ad00ff96a80622fbec
XSIZE (ngx_postgres-0.9.tar.gz) = 41022
XSHA256 (agentzh-rds-csv-nginx-module-v0.05-0-g607e26b.tar.gz) = 3fa9cb3960a97f505c9ad0cc8683c8fe17ba98aa98d003e255bf214e5144751c
XSIZE (agentzh-rds-csv-nginx-module-v0.05-0-g607e26b.tar.gz) = 18423
XSHA256 (agentzh-rds-json-nginx-module-v0.13-0-g8292070.tar.gz) = 9e59b90d84f9bc814eba85bfcf126e3fd6406ddc771702c096a657c17354c302
XSIZE (agentzh-rds-json-nginx-module-v0.13-0-g8292070.tar.gz) = 32965
XSHA256 (agentzh-redis2-nginx-module-v0.10-0-g78a7622.tar.gz) = c2a164df07759d2a45beacc1f72316be84e9348b7ae5509723eabd2d61cb4897
XSIZE (agentzh-redis2-nginx-module-v0.10-0-g78a7622.tar.gz) = 29850
XSHA256 (rtmp-nginx-module-v1.0.8.tar.gz) = e905e40d1a1b81c720f1e799bee6a3525efaa6f2519212130d39eed3b8877c74
XSIZE (rtmp-nginx-module-v1.0.8.tar.gz) = 513086
XSHA256 (agentzh-set-misc-nginx-module-v0.23-0-g6ce586e.tar.gz) = a5dea4570efa138e15bb97babb02e76f16319b4b660763492ef02615dc1def1f
XSIZE (agentzh-set-misc-nginx-module-v0.23-0-g6ce586e.tar.gz) = 40355
XSHA256 (nginx-sflow-module-0.9.7.tar.gz) = 508d15a43059abab08281bfa66d2dd520e2e7635d0b17043549bb331c8755b76
XSIZE (nginx-sflow-module-0.9.7.tar.gz) = 27614
XSHA256 (ngx_slowfs_cache-1.10.tar.gz) = 1e81453942e5b0877de1f1f06c56ae82918ea9818255cb935bcb673c95a758a1
XSIZE (ngx_slowfs_cache-1.10.tar.gz) = 11809
XSHA256 (agentzh-srcache-nginx-module-v0.24-0-g33f0f29.tar.gz) = 5e3f59821f73c205e1df0c40fd02d987b21b19e3c267866659f883bddd5674c9
XSIZE (agentzh-srcache-nginx-module-v0.24-0-g33f0f29.tar.gz) = 67239
XSHA256 (ngx_supervisord-1.4.tar.gz) = 0954a4efb1b955692acf523e169221146d6aa93ad1643c9f2482f75a1fbf9e3b
XSIZE (ngx_supervisord-1.4.tar.gz) = 19351
XSHA256 (yaoweibin-nginx_tcp_proxy_module-v0.26-0-gb83e5a6.tar.gz) = 4d843b8d0511b269382938ba5546f902ec24dbfa76c12f6bd6961d7aaaf3866a
XSIZE (yaoweibin-nginx_tcp_proxy_module-v0.26-0-gb83e5a6.tar.gz) = 127346
XSHA256 (gabor-nginx-x-rid-header-0daa3cc.tar.gz) = 136239b8f9ab2fbefb2aabc6897d3f12cc8063ce817901f9b8a624e12fbc6035
XSIZE (gabor-nginx-x-rid-header-0daa3cc.tar.gz) = 2714
XSHA256 (agentzh-xss-nginx-module-v0.04-0-g7e37038.tar.gz) = 3e5b1eba411e1e51bbb197d2adb2d5304cd4050dca95f506cae635e4af5e9b35
XSIZE (agentzh-xss-nginx-module-v0.04-0-g7e37038.tar.gz) = 10535
XSHA256 (agentzh-array-var-nginx-module-v0.03-0-g4676747.tar.gz) = 9670207b5a74ddbdf510b973ddbcf3e4ecd4c5fe50829b17c560ba4a30aa73f4
XSIZE (agentzh-array-var-nginx-module-v0.03-0-g4676747.tar.gz) = 9518
XSHA256 (calio-form-input-nginx-module-v0.07-0-g78de845.tar.gz) = d5b2c42a3b9fd2970107eb74c2226cbbfbad48c89807303db903932d21ff76aa
XSIZE (calio-form-input-nginx-module-v0.07-0-g78de845.tar.gz) = 10580
XSHA256 (calio-iconv-nginx-module-v0.10-0-gb37efb5.tar.gz) = e90a406a14d5f419bd500e19082da81390e8ba6040926857926f1a899a53379d
XSIZE (calio-iconv-nginx-module-v0.10-0-gb37efb5.tar.gz) = 12510
923cf5d1944f9bc27b87a19fa3e3331d
exit
--- tengine-devel.shar ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-ports-bugs mailing list