Index: head/www/nginx/Makefile =================================================================== --- head/www/nginx/Makefile (revision 508237) +++ head/www/nginx/Makefile (revision 508238) @@ -1,368 +1,370 @@ # Created by: Sergey A. Osokin # $FreeBSD$ PORTNAME= nginx PORTVERSION= 1.16.0 PORTREVISION?= 2 PORTEPOCH= 2 CATEGORIES= www -MASTER_SITES= http://nginx.org/download/ \ +MASTER_SITES= httpis://nginx.org/download/ \ + http://nginx.org/download/ \ LOCAL/joneum DISTFILES= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER?= joneum@FreeBSD.org COMMENT?= Robust and small WWW server LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE BROKEN_mips= error ngx_spinlock() or ngx_atomic_cmp_set() are not defined BROKEN_mips64= error ngx_spinlock() or ngx_atomic_cmp_set() are not defined CONFLICTS_INSTALL= nginx-devel PORTSCOUT= limit:^1\.16\.[0-9]* USES= cpe CPE_VENDOR= nginx CPE_PRODUCT= nginx USE_GITHUB= nodefault NGINX_VARDIR?= /var NGINX_LOGDIR?= ${NGINX_VARDIR}/log/nginx NGINX_RUNDIR?= ${NGINX_VARDIR}/run NGINX_TMPDIR?= ${NGINX_VARDIR}/tmp/nginx HTTP_PORT?= 80 NGINX_ACCESSLOG?= ${NGINX_LOGDIR}/access.log NGINX_ERRORLOG?= ${NGINX_LOGDIR}/error.log CONFLICTS?= nginx-devel-1.* \ nginx-full-1.* \ nginx-lite-1.* \ nginx-naxsi-1.* USE_RC_SUBR= nginx SUB_FILES= pkg-message SUB_LIST+= WWWOWN=${WWWOWN} \ WWWGRP=${WWWGRP} \ NGINX_RUNDIR=${NGINX_RUNDIR} \ NGINX_TMPDIR=${NGINX_TMPDIR} \ PREFIX=${PREFIX} HAS_CONFIGURE= yes CONFIGURE_ARGS+=--prefix=${ETCDIR} \ --with-cc-opt="-I ${LOCALBASE}/include" \ --with-ld-opt="-L ${LOCALBASE}/lib" \ --conf-path=${ETCDIR}/nginx.conf \ --sbin-path=${PREFIX}/sbin/nginx \ --pid-path=${NGINX_RUNDIR}/nginx.pid \ --error-log-path=${NGINX_ERRORLOG} \ --user=${WWWOWN} --group=${WWWGRP} ALL_TARGET= PLIST_SUB+= NGINX_TMPDIR=${NGINX_TMPDIR} NGINX_LOGDIR=${NGINX_LOGDIR} WWWOWN=${WWWOWN} WWWGRP=${WWWGRP} USERS?= ${WWWOWN} GROUPS?=${WWWGRP} NO_OPTIONS_SORT= yes OPTIONS_GROUP= MAILGRP HTTPGRP # Modules that are part of the base nginx distribution OPTIONS_GROUP_HTTPGRP= GOOGLE_PERFTOOLS HTTP HTTP_ADDITION HTTP_AUTH_REQ \ HTTP_CACHE HTTP_DAV HTTP_FLV HTTP_GUNZIP_FILTER HTTP_GZIP_STATIC \ HTTP_IMAGE_FILTER HTTP_MP4 HTTP_PERL HTTP_RANDOM_INDEX HTTP_REALIP \ - HTTP_REWRITE HTTP_SECURE_LINK HTTP_SLICE HTTP_SSL HTTP_STATUS HTTP_SUB \ - HTTP_XSLT HTTPV2 STREAM STREAM_SSL STREAM_SSL_PREREAD + HTTP_REWRITE HTTP_SECURE_LINK HTTP_SLICE HTTP_SLICE_AHEAD \ + HTTP_SSL HTTP_STATUS HTTP_SUB HTTP_XSLT HTTPV2 STREAM STREAM_SSL \ + STREAM_SSL_PREREAD # External modules (arrayvar MUST appear after devel_kit for build-dep) OPTIONS_GROUP_HTTPGRP+= AJP AWS_AUTH BROTLI CACHE_PURGE CLOJURE CT DEVEL_KIT \ ARRAYVAR DRIZZLE DYNAMIC_UPSTREAM ECHO ENCRYPTSESSION FASTDFS FORMINPUT \ GRIDFS HEADERS_MORE HTTP_ACCEPT_LANGUAGE HTTP_AUTH_DIGEST HTTP_AUTH_KRB5 \ HTTP_AUTH_LDAP HTTP_AUTH_PAM HTTP_DAV_EXT HTTP_EVAL HTTP_FANCYINDEX \ HTTP_FOOTER HTTP_GEOIP2 HTTP_JSON_STATUS HTTP_MOGILEFS HTTP_MP4_H264 \ HTTP_NOTICE HTTP_PUSH HTTP_PUSH_STREAM HTTP_REDIS HTTP_RESPONSE \ HTTP_SUBS_FILTER HTTP_TARANTOOL HTTP_UPLOAD HTTP_UPLOAD_PROGRESS \ HTTP_UPSTREAM_CHECK HTTP_UPSTREAM_FAIR HTTP_UPSTREAM_STICKY \ HTTP_VIDEO_THUMBEXTRACTOR HTTP_ZIP ICONV LET LUA MEMC MODSECURITY \ MODSECURITY3 NAXSI NJS PASSENGER POSTGRES RDS_CSV RDS_JSON REDIS2 RTMP \ SET_MISC SFLOW SHIBBOLETH SLOWFS_CACHE SMALL_LIGHT SRCACHE VOD VTS XSS \ WEBSOCKIFY OPTIONS_GROUP_MAILGRP= MAIL MAIL_IMAP MAIL_POP3 MAIL_SMTP MAIL_SSL OPTIONS_DEFINE= DEBUG DEBUGLOG DSO FILE_AIO IPV6 THREADS WWW OPTIONS_DEFAULT?= DSO FILE_AIO HTTP HTTP_ADDITION HTTP_AUTH_REQ HTTP_CACHE \ HTTP_DAV HTTP_FLV HTTP_GZIP_STATIC HTTP_GUNZIP_FILTER \ HTTP_MP4 HTTP_RANDOM_INDEX HTTP_REALIP HTTP_SECURE_LINK \ HTTP_SLICE HTTP_REWRITE HTTP_SSL HTTP_STATUS HTTP_SUB \ HTTPV2 MAIL MAIL_SSL STREAM STREAM_SSL STREAM_SSL_PREREAD \ THREADS WWW OPTIONS_RADIO+= GSSAPI OPTIONS_RADIO_GSSAPI= GSSAPI_BASE GSSAPI_HEIMDAL GSSAPI_MIT GSSAPI_BASE_USES= gssapi GSSAPI_HEIMDAL_USES= gssapi:heimdal,flags GSSAPI_MIT_USES= gssapi:mit OPTIONS_SUB= yes .include "Makefile.options.desc" .for opt in ${OPTIONS_GROUP_MAILGRP:NMAIL} ${opt}_IMPLIES= MAIL .endfor .for opt in ${OPTIONS_GROUP_HTTPGRP:NHTTP} WWW ${opt}_IMPLIES= HTTP .endfor GSSAPI_BASE_IMPLIES= HTTP_AUTH_KRB5 GSSAPI_HEIMDAL_IMPLIES= HTTP_AUTH_KRB5 GSSAPI_MIT_IMPLIES= HTTP_AUTH_KRB5 # If the target is makesum, make sure that every distfile is fetched. .if ${.TARGETS:Mmakesum} OPTIONS_DEFAULT= ${OPTIONS_DEFINE} ${OPTIONS_GROUP_HTTP} ${OPTIONS_GROUP_MAIL} .endif # Non-module options handling DEBUG_CFLAGS= -g DEBUG_VARS= STRIP=#do not strip if nginx with debug information DEBUGLOG_CONFIGURE_ON= --with-debug DSO_CONFIGURE_ON= --modules-path=${MODULESDIR} DSO_VARS= MODULESDIR=${PREFIX}/libexec/${PORTNAME} FILE_AIO_CONFIGURE_ON= --with-file-aio IPV6_CONFIGURE_OFF= --with-cc-opt="-DNGX_HAVE_INET6=0 -I ${LOCALBASE}/include" IPV6_CATEGORIES= ipv6 THREADS_CONFIGURE_ON= --with-threads # Bundled modules GOOGLE_PERFTOOLS_LIB_DEPENDS= libprofiler.so:devel/google-perftools GOOGLE_PERFTOOLS_CONFIGURE_ON= --with-google_perftools_module HTTP_CONFIGURE_ON= --http-client-body-temp-path=${NGINX_TMPDIR}/client_body_temp \ --http-fastcgi-temp-path=${NGINX_TMPDIR}/fastcgi_temp \ --http-proxy-temp-path=${NGINX_TMPDIR}/proxy_temp \ --http-scgi-temp-path=${NGINX_TMPDIR}/scgi_temp \ --http-uwsgi-temp-path=${NGINX_TMPDIR}/uwsgi_temp \ --http-log-path=${NGINX_ACCESSLOG} HTTP_CONFIGURE_OFF= --without-http HTTP_ADDITION_CONFIGURE_ON= --with-http_addition_module HTTP_AUTH_REQ_CONFIGURE_ON= --with-http_auth_request_module HTTP_CACHE_CONFIGURE_OFF= --without-http-cache HTTP_DAV_CONFIGURE_ON= --with-http_dav_module HTTP_FLV_CONFIGURE_ON= --with-http_flv_module HTTP_GZIP_STATIC_CONFIGURE_ON= --with-http_gzip_static_module HTTP_GUNZIP_FILTER_CONFIGURE_ON=--with-http_gunzip_module HTTP_IMAGE_FILTER_LIB_DEPENDS= libgd.so:graphics/gd HTTP_IMAGE_FILTER_VARS= DSO_BASEMODS+=http_image_filter_module HTTP_MP4_CONFIGURE_ON= --with-http_mp4_module HTTP_PERL_CATEGORIES= perl5 HTTP_PERL_USES= perl5 HTTP_PERL_VARS= DSO_BASEMODS+=http_perl_module HTTP_RANDOM_INDEX_CONFIGURE_ON= --with-http_random_index_module HTTP_REALIP_CONFIGURE_ON= --with-http_realip_module HTTP_REWRITE_LIB_DEPENDS= libpcre.so:devel/pcre HTTP_REWRITE_CONFIGURE_ON= --with-pcre HTTP_REWRITE_CONFIGURE_OFF= --without-http_rewrite_module HTTP_SECURE_LINK_CONFIGURE_ON= --with-http_secure_link_module HTTP_SLICE_CONFIGURE_ON= --with-http_slice_module HTTP_SSL_CONFIGURE_ON= --with-http_ssl_module HTTP_SSL_USE= openssl_rpath HTTP_SSL_USES= ssl HTTP_STATUS_CONFIGURE_ON= --with-http_stub_status_module HTTP_SUB_CONFIGURE_ON= --with-http_sub_module HTTP_XSLT_USE= GNOME=libxml2,libxslt HTTP_XSLT_VARS= DSO_BASEMODS+=http_xslt_module HTTPV2_IMPLIES= HTTP_SSL HTTPV2_CONFIGURE_ON= --with-http_v2_module MAIL_VARS= DSO_BASEMODS+=mail MAIL_IMAP_CONFIGURE_OFF= --without-mail_imap_module MAIL_POP3_CONFIGURE_OFF= --without-mail_pop3_module MAIL_SMTP_CONFIGURE_OFF= --without-mail_smtp_module MAIL_SSL_USES= ssl MAIL_SSL_CONFIGURE_ON= --with-mail_ssl_module STREAM_VARS= DSO_BASEMODS+=stream STREAM_SSL_IMPLIES= HTTP_SSL STREAM_SSL_CONFIGURE_ON= --with-stream_ssl_module STREAM_SSL_PREREAD_CONFIGURE_ON= --with-stream_ssl_preread_module ### External modules .include "Makefile.extmod" .include .if ${PORT_OPTIONS:MDSO} _addbasemod= =dynamic _addextmod= add-dynamic-module .else _addextmod= add-module .endif .for mod in ${DSO_BASEMODS} CONFIGURE_ARGS+= --with-${mod}${_addbasemod} .endfor # Some modules depend on other being there before, for example, devel_kit needs # to be there before a few other. .for mod in ${FIRST_DSO_EXTMODS} CONFIGURE_ARGS+= --${_addextmod}=${WRKSRC_${mod}}${${mod:tu}_SUBDIR} .endfor .for mod in ${DSO_EXTMODS} CONFIGURE_ARGS+= --${_addextmod}=${WRKSRC_${mod}}${${mod:tu}_SUBDIR} .endfor # For non-GitHub hosted modules .for moddir in ${DSO_EXTDIRS} CONFIGURE_ARGS+= --${_addextmod}=${WRKDIR}/${moddir} .endfor .if empty(PORT_OPTIONS:MHTTP) && empty(PORT_OPTIONS:MMAIL) IGNORE= requires at least HTTP or MAIL to \ be defined. Please do 'make config' again .endif .if !${PORT_OPTIONS:MHTTP_REWRITE} && !defined(USE_HTTP_REWRITE) PKGNAMESUFFIX:= ${PKGNAMESUFFIX}-nopcre .endif .if ${PORT_OPTIONS:MPASSENGER} && empty(PORT_OPTIONS:MDEBUG) CONFIGURE_ENV+= OPTIMIZE="yes" CFLAGS+= -DNDEBUG .endif pre-everything:: @${ECHO_MSG} .if ${PORT_OPTIONS:MHTTP_UPSTREAM_FAIR} @${ECHO_MSG} "Enable http_ssl module to build upstream_fair with SSL support" .endif .if ${PORT_OPTIONS:MPASSENGER} @${ECHO_MSG} "This port install Passenger module only" .endif @${ECHO_MSG} post-extract-GRIDFS-on: @${RMDIR} ${WRKSRC_gridfs}/mongo-c-driver/ @${MV} ${WRKSRC_mongo_c} ${WRKSRC_gridfs}/mongo-c-driver post-patch: @${REINPLACE_CMD} 's!%%HTTP_PORT%%!${HTTP_PORT}!; \ s!%%PREFIX%%!${PREFIX}!; \ s!%%NGINX_ERRORLOG%%!${NGINX_ERRORLOG}!' \ ${WRKSRC}/conf/nginx.conf post-patch-BROTLI-on: @${REINPLACE_CMD} -E 's!^brotli=.*!brotli="${LOCALBASE}"!' ${WRKSRC_brotli}/config post-patch-DRIZZLE-on: @${REINPLACE_CMD} 's!%%PREFIX%%!${LOCALBASE}!g' ${WRKSRC_drizzle}/config post-patch-FASTDFS-on: @${REINPLACE_CMD} \ 's!%%PREFIX%%!${PREFIX}!g;s!%%LOCALBASE%%!${LOCALBASE}!g' \ ${WRKSRC_fastdfs}/src/config # Respect CFLAGS by remove needless --std=c99 flag post-patch-GRIDFS-on: @${REINPLACE_CMD} 's!--std=c99!-DMONGO_HAVE_STDINT!' ${WRKSRC_gridfs}/config post-patch-HTTP_AUTH_KRB5-on: @${REINPLACE_CMD} 's!%%GSSAPILIBS%%!${GSSAPILIBS}!' ${WRKSRC_auth_krb5}/config post-patch-HTTP_TARANTOOL-on: @${REINPLACE_CMD} 's!%%PREFIX%%!${LOCALBASE}!g' ${WRKSRC_nginx_tarantool}/config # linker error acquire if --std=c99 defined, add "static" to inline function post-patch-HTTP_ZIP-on: @${REINPLACE_CMD} \ 's!^inline!static inline!' \ ${WRKSRC_mod_zip}/ngx_http_zip_parsers.* post-patch-ICONV-on: @${REINPLACE_CMD} 's!%%PREFIX%%!${LOCALBASE}!g' ${WRKSRC_iconv}/config post-patch-MODSECURITY-on: @${REINPLACE_CMD} \ 's!%%PREFIX%%!${LOCALBASE}!g' \ ${WRKSRC_MODSECURITY}/configure post-patch-PASSENGER-on: @${REINPLACE_CMD} \ '177,179s!true!false!' \ ${WRKSRC_PASSENGER}/build/basics.rb @${REINPLACE_CMD} \ 's!-I/usr/include/libev!!; \ s!-lev!!; \ s!-Iext/libev!!; \ s!-I/usr/include/libeio!!; \ s!-leio!!; \ s!-Iext/libeio!!' \ ${WRKSRC_PASSENGER}/build/common_library.rb post-patch-POSTGRES-on: @${REINPLACE_CMD} 's!%%PREFIX%%!${LOCALBASE}!g' ${WRKSRC_postgres}/config post-patch-SFLOW-on: @${REINPLACE_CMD} \ 's!%%PREFIX%%!${LOCALBASE}!g' \ ${WRKSRC_sflow}/ngx_http_sflow_config.h post-patch-VOD-on: @${REINPLACE_CMD} \ 's!%%PREFIX%%!${LOCALBASE}!g' \ ${WRKSRC_vod}/config pre-configure-MODSECURITY-on: ( cd ${WRKSRC_MODSECURITY} && \ CC="${CC}" ${CONFIGURE_CMD} --enable-standalone-module \ --with-pcre=${LOCALBASE} --with-yajl=${LOCALBASE} \ --with-curl=${LOCALBASE} && \ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ) pre-configure-SMALL_LIGHT-on: ( cd ${WRKSRC_small_light} && ./setup ) do-install: ${MKDIR} ${STAGEDIR}${ETCDIR} ${MKDIR} ${STAGEDIR}${NGINX_TMPDIR} ${MKDIR} ${STAGEDIR}${NGINX_LOGDIR} ${INSTALL_PROGRAM} ${WRKSRC}/objs/nginx ${STAGEDIR}${PREFIX}/sbin .for i in koi-utf koi-win win-utf ${INSTALL_DATA} ${WRKSRC}/conf/${i} ${STAGEDIR}${ETCDIR} .endfor .for i in fastcgi_params mime.types scgi_params uwsgi_params ${INSTALL_DATA} ${WRKSRC}/conf/${i} ${STAGEDIR}${ETCDIR}/${i}-dist .endfor do-install-HTTP_PERL-on: ${MKDIR} ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/nginx ${INSTALL_PROGRAM} ${WRKSRC}/objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so \ ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/auto/nginx ${INSTALL_DATA} ${WRKSRC}/objs/src/http/modules/perl/blib/lib/nginx.pm \ ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL}/ # Install dynamic modules do-install-DSO-on: ${MKDIR} ${STAGEDIR}${MODULESDIR} (cd ${WRKSRC}/objs/ && ${FIND} . -name '*.so' -maxdepth 1 -type f \ -exec ${INSTALL_PROGRAM} {} ${STAGEDIR}${MODULESDIR} \;) do-install-FASTDFS-on: ${MKDIR} ${STAGEDIR}${PREFIX}/etc/fdfs ${INSTALL_DATA} ${WRKSRC_fastdfs}/src/mod_fastdfs.conf ${STAGEDIR}${PREFIX}/etc/fdfs/mod_fastdfs.conf.sample do-install-NAXSI-on: ${INSTALL_DATA} \ ${WRKDIR}/naxsi-${NAXSI_NGINX_VER}/naxsi_config/naxsi_core.rules \ ${STAGEDIR}${ETCDIR} post-install: ${MKDIR} ${STAGEDIR}${PREFIX}/share/vim/vimfiles cd ${WRKSRC}/contrib/vim && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/share/vim/vimfiles ${INSTALL_MAN} ${WRKSRC}/objs/nginx.8 ${STAGEDIR}${MAN8PREFIX}/man/man8 ${CAT} ${WRKSRC}/conf/nginx.conf >> ${STAGEDIR}${ETCDIR}/nginx.conf-dist post-install-WWW-on: ${MKDIR} ${STAGEDIR}${PREFIX}/www/nginx-dist (cd ${WRKSRC}/html && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/www/nginx-dist && \ ${TOUCH} ${STAGEDIR}${PREFIX}/www/nginx-dist/EXAMPLE_DIRECTORY-DONT_ADD_OR_TOUCH_ANYTHING) .include Index: head/www/nginx/Makefile.extmod =================================================================== --- head/www/nginx/Makefile.extmod (revision 508237) +++ head/www/nginx/Makefile.extmod (revision 508238) @@ -1,297 +1,299 @@ # $FreeBSD$ ### External modules AJP_GH_TUPLE= yaoweibin:nginx_ajp_module:bf6cd93:ajp AJP_CONFIGURE_ON= --add-module=${WRKSRC_ajp} ARRAYVAR_IMPLIES= DEVEL_KIT ARRAYVAR_GH_TUPLE= openresty:array-var-nginx-module:v0.05:arrayvar ARRAYVAR_VARS= DSO_EXTMODS+=arrayvar AWS_AUTH_GH_TUPLE= anomalizer:ngx_aws_auth:75c94e6:aws_auth AWS_AUTH_VARS= DSO_EXTMODS+=aws_auth BROTLI_LIB_DEPENDS= libbrotlicommon.so:archivers/brotli BROTLI_GH_TUPLE= eustas:ngx_brotli:8104036:brotli BROTLI_VARS= DSO_EXTMODS+=brotli CACHE_PURGE_MASTER_SITES= http://labs.frickle.com/files/:cache_purge CACHE_PURGE_DISTFILES= ngx_cache_purge-2.3.tar.gz:cache_purge CACHE_PURGE_CONFIGURE_ON= --add-module=${WRKDIR}/ngx_cache_purge-2.3 CLOJURE_CATEGORIES+= java CLOJURE_USE= JAVA=yes JAVA_OS=native JAVA_VERSION=1.8 \ JAVA_VENDOR=openjdk JAVA_BUILD=yes JAVA_RUN=yes CLOJURE_GH_TUPLE= nginx-clojure:nginx-clojure:v0.4.5:clojure CLOJURE_CONFIGURE_ENV= "JNI_INCS=-I${LOCALBASE}/openjdk8/include -I${LOCALBASE}/openjdk8/include/freebsd" CLOJURE_VARS= DSO_EXTMODS+=clojure CLOJURE_SUBDIR=/src/c CT_IMPLIES= HTTP_SSL CT_GH_TUPLE= grahamedgecombe:nginx-ct:v1.3.2:ct CT_VARS= DSO_EXTMODS+=ct CT_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-nginx-ct-LibreSSL DRIZZLE_LIB_DEPENDS= libdrizzle.so:databases/libdrizzle DRIZZLE_CONFIGURE_ENV= LIBDRIZZLE_INC=${LOCALBASE}/include \ LIBDRIZZLE_LIB=${LOCALBASE}/lib DRIZZLE_GH_TUPLE= openresty:drizzle-nginx-module:v0.1.11:drizzle DRIZZLE_CONFIGURE_ON= --add-module=${WRKSRC_drizzle} DYNAMIC_UPSTREAM_GH_TUPLE= cubicdaiya:ngx_dynamic_upstream:cc5dac3:dynamic_upstream DYNAMIC_UPSTREAM_VARS= DSO_EXTMODS+=dynamic_upstream DEVEL_KIT_GH_TUPLE= simpl:ngx_devel_kit:v0.3.0:devel_kit DEVEL_KIT_VARS= FIRST_DSO_EXTMODS+=devel_kit ECHO_GH_TUPLE= openresty:echo-nginx-module:32859fc:echo ECHO_VARS= DSO_EXTMODS+=echo ENCRYPTSESSION_IMPLIES= DEVEL_KIT ENCRYPTSESSION_GH_TUPLE= openresty:encrypted-session-nginx-module:v0.08:encryptsession ENCRYPTSESSION_VARS= DSO_EXTMODS+=encryptsession FASTDFS_GH_TUPLE= happyfish100:fastdfs-nginx-module:8796a7d:fastdfs FASTDFS_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-fastdfs-src-config \ ${PATCHDIR}/extra-patch-fastdfs-src-mod_fastdfs.conf FASTDFS_BUILD_DEPENDS= ${LOCALBASE}/include/fastcommon/logger.h:devel/libfastcommon \ ${LOCALBASE}/include/fastdfs/fdfs_client.h:ftp/fastdfs FASTDFS_LIB_DEPENDS= libfastcommon.so:devel/libfastcommon \ libfdfsclient.so:ftp/fastdfs FASTDFS_CONFIGURE_ON= --with-cc-opt="-I ${LOCALBASE}/include/fastdfs \ -I ${LOCALBASE}/include/fastcommon" FASTDFS_VARS= DSO_EXTMODS+=fastdfs FASTDFS_SUBDIR=/src FORMINPUT_IMPLIES= DEVEL_KIT FORMINPUT_GH_TUPLE= calio:form-input-nginx-module:v0.12:forminput FORMINPUT_VARS= DSO_EXTMODS+=forminput GRIDFS_GH_TUPLE= mdirolf:nginx-gridfs:v0.8:gridfs \ mongodb:mongo-c-driver:v0.3.1:mongo_c GRIDFS_CONFIGURE_ON= --add-module=${WRKSRC_gridfs} HEADERS_MORE_GH_TUPLE= openresty:headers-more-nginx-module:085fbbc:headers_more HEADERS_MORE_VARS= DSO_EXTMODS+=headers_more HTTP_ACCEPT_LANGUAGE_GH_TUPLE= giom:nginx_accept_language_module:2f69842:accept_language HTTP_ACCEPT_LANGUAGE_CONFIGURE_ON= --add-module=${WRKSRC_accept_language} HTTP_AUTH_DIGEST_GH_TUPLE= atomx:nginx-http-auth-digest:cd86418:auth_digest HTTP_AUTH_DIGEST_VARS= DSO_EXTMODS+=auth_digest HTTP_AUTH_KRB5_GH_TUPLE= stnoonan:spnego-http-auth-nginx-module:7e028a5:auth_krb5 HTTP_AUTH_KRB5_VARS= DSO_EXTMODS+=auth_krb5 HTTP_AUTH_KRB5_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-spnego-http-auth-nginx-module-config HTTP_AUTH_LDAP_GH_TUPLE= kvspb:nginx-auth-ldap:42d195d:http_auth_ldap HTTP_AUTH_LDAP_VARS= DSO_EXTMODS+=http_auth_ldap HTTP_AUTH_LDAP_USE= openldap=yes HTTP_AUTH_PAM_GH_TUPLE= sto:ngx_http_auth_pam_module:v1.5.1:auth_pam HTTP_AUTH_PAM_VARS= DSO_EXTMODS+=auth_pam HTTP_DAV_EXT_IMPLIES= HTTP_DAV HTTP_DAV_EXT_LIB_DEPENDS= libexpat.so:textproc/expat2 HTTP_DAV_EXT_GH_TUPLE= arut:nginx-dav-ext-module:v3.0.0:dav_ext HTTP_DAV_EXT_CONFIGURE_ON= --add-module=${WRKSRC_dav_ext} HTTP_EVAL_GH_TUPLE= openresty:nginx-eval-module:582bd25:eval HTTP_EVAL_VARS= DSO_EXTMODS+=eval HTTP_FANCYINDEX_GH_TUPLE= aperezdc:ngx-fancyindex:v0.4.3:fancyindex HTTP_FANCYINDEX_VARS= DSO_EXTMODS+=fancyindex HTTP_FOOTER_GH_TUPLE= alibaba:nginx-http-footer-filter:1.2.2:footer HTTP_FOOTER_CONFIGURE_ON= --add-module=${WRKSRC_footer} HTTP_GEOIP2_GH_TUPLE= leev:ngx_http_geoip2_module:3.2:geoip2 HTTP_GEOIP2_CFLAGS= -I${LOCALBASE}/include HTTP_GEOIP2_VARS= DSO_EXTMODS+=geoip2 HTTP_GEOIP2_LIB_DEPENDS= libmaxminddb.so:net/libmaxminddb HTTP_JSON_STATUS_GH_TUPLE= nginx-modules:ngx_http_json_status_module:1d2f303:json_status HTTP_JSON_STATUS_CONFIGURE_ON= --add-module=${WRKSRC_json_status} HTTP_MOGILEFS_MASTER_SITES= http://www.grid.net.ru/nginx/download/:mogilefs HTTP_MOGILEFS_DISTFILES= nginx_mogilefs_module-1.0.4.tar.gz:mogilefs HTTP_MOGILEFS_CONFIGURE_ON= --add-module=${WRKDIR}/nginx_mogilefs_module-1.0.4 HTTP_MOGILEFS_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_http_mogilefs_module.c HTTP_MP4_H264_MASTER_SITES= http://h264.code-shop.com/download/:mp4streaming HTTP_MP4_H264_DISTFILES= nginx_mod_h264_streaming-2.2.7.tar.gz:mp4streaming HTTP_MP4_H264_CONFIGURE_ON= --add-module=${WRKDIR}/nginx_mod_h264_streaming-2.2.7 HTTP_MP4_H264_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_http_streaming_module.c HTTP_NOTICE_GH_TUPLE= kr:nginx-notice:3c95966:notice HTTP_NOTICE_CONFIGURE_ON= --add-module=${WRKSRC_notice} HTTP_NOTICE_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_http_notice_module.c HTTP_PUSH_GH_TUPLE= slact:nchan:v1.1.14:push HTTP_PUSH_VARS= DSO_EXTMODS+=push HTTP_PUSH_STREAM_GH_TUPLE= wandenberg:nginx-push-stream-module:0.5.4:pushstream HTTP_PUSH_STREAM_CONFIGURE_ON= --add-module=${WRKSRC_pushstream} HTTP_REDIS_MASTER_SITES= LOCAL/osa:redis HTTP_REDIS_DISTFILES= ngx_http_redis-0.3.9.tar.gz:redis HTTP_REDIS_VARS= DSO_EXTDIRS+=ngx_http_redis-0.3.9 HTTP_RESPONSE_MASTER_SITES= http://catap.ru/downloads/nginx/:response HTTP_RESPONSE_DISTFILES= ngx_http_response-0.3.tar.gz:response HTTP_RESPONSE_CONFIGURE_ON= --add-module=${WRKDIR}/ngx_http_response-0.3 +HTTP_SLICE_AHEAD_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src_http_modules_ngx__http__slice_read_ahead.c + HTTP_SUBS_FILTER_GH_TUPLE= yaoweibin:ngx_http_substitutions_filter_module:v0.6.4:subs_filter HTTP_SUBS_FILTER_CONFIGURE_ON= --add-module=${WRKSRC_subs_filter} HTTP_TARANTOOL_LIB_DEPENDS= libmsgpuck.so:devel/msgpuck \ libyajl.so:devel/yajl HTTP_TARANTOOL_GH_TUPLE= tarantool:nginx_upstream_module:1278ee5:nginx_tarantool HTTP_TARANTOOL_VARS= DSO_EXTMODS+=nginx_tarantool HTTP_TARANTOOL_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_http_tarantool-config \ ${PATCHDIR}/extra-patch-ngx_http_tarantool-src-tp_transcode.c HTTP_UPLOAD_GH_TUPLE= Austinb:nginx-upload-module:72ec037:upload HTTP_UPLOAD_VARS= DSO_EXTMODS+=upload HTTP_UPLOAD_PROGRESS_GH_TUPLE= masterzen:nginx-upload-progress-module:afb2d31:uploadprogress HTTP_UPLOAD_PROGRESS_VARS= DSO_EXTMODS+=uploadprogress HTTP_UPSTREAM_CHECK_GH_TUPLE= yaoweibin:nginx_upstream_check_module:9aecf15:upstreamcheck HTTP_UPSTREAM_CHECK_CONFIGURE_ON= --add-module=${WRKSRC_upstreamcheck} HTTP_UPSTREAM_CHECK_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src-http-modules-ngx_http_upstream_hash_module.c \ ${PATCHDIR}/extra-patch-src-http-modules-ngx_http_upstream_ip_hash_module.c \ ${PATCHDIR}/extra-patch-src-http-modules-ngx_http_upstream_least_conn_module.c \ ${PATCHDIR}/extra-patch-src-http-ngx_http_upstream_round_robin.c \ ${PATCHDIR}/extra-patch-src-http-ngx_http_upstream_round_robin.h HTTP_UPSTREAM_FAIR_GH_TUPLE= jaygooby:nginx-upstream-fair:10ecdcf:upstreamfair HTTP_UPSTREAM_FAIR_VARS= DSO_EXTMODS+=upstreamfair HTTP_UPSTREAM_STICKY_IMPLIES= HTTP_SSL HTTP_UPSTREAM_STICKY_MASTER_SITES= https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/:upstreamsticky HTTP_UPSTREAM_STICKY_DISTFILES= 08a395c66e42.tar.gz:upstreamsticky HTTP_UPSTREAM_STICKY_CONFIGURE_ON= --add-module=${WRKDIR}/nginx-goodies-nginx-sticky-module-ng-08a395c66e42/ HTTP_UPSTREAM_STICKY_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_http_sticky_misc.c HTTP_VIDEO_THUMBEXTRACTOR_LIB_DEPENDS= libavformat.so:multimedia/ffmpeg \ libavcodec.so:multimedia/ffmpeg \ libavutil.so:multimedia/ffmpeg \ libswscale.so:multimedia/ffmpeg HTTP_VIDEO_THUMBEXTRACTOR_USES= jpeg HTTP_VIDEO_THUMBEXTRACTOR_GH_TUPLE= wandenberg:nginx-video-thumbextractor-module:0.9.0:vte HTTP_VIDEO_THUMBEXTRACTOR_CONFIGURE_ON=--add-module=${WRKSRC_vte} HTTP_ZIP_GH_TUPLE= anthonyryan1:mod_zip:74ef235:mod_zip HTTP_ZIP_CONFIGURE_ON= --add-module=${WRKSRC_mod_zip} ICONV_IMPLIES= DEVEL_KIT ICONV_USES= iconv ICONV_GH_TUPLE= calio:iconv-nginx-module:v0.14:iconv ICONV_VARS= DSO_EXTMODS+=iconv ICONV_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-calio-iconv-nginx-module-config LET_GH_TUPLE= arut:nginx-let-module:v0.0.4:let LET_CONFIGURE_ON= --add-module=${WRKSRC_let} LUA_IMPLIES= DEVEL_KIT LUA_LIB_DEPENDS= libluajit-5.1.so:lang/luajit LUA_CONFIGURE_ENV= LUAJIT_INC=${LOCALBASE}/include/luajit-2.0 \ LUAJIT_LIB=${LOCALBASE}/lib LUA_GH_TUPLE= openresty:lua-nginx-module:v0.10.14:lua LUA_VARS= DSO_EXTMODS+=lua MEMC_GH_TUPLE= openresty:memc-nginx-module:v0.18:memc MEMC_VARS= DSO_EXTMODS+=memc MODSECURITY_LIB_DEPENDS= libapr-1.so:devel/apr1 \ libcurl.so:ftp/curl \ libluajit-5.1.so:lang/luajit \ libpcre.so:devel/pcre \ libyajl.so:devel/yajl MODSECURITY_USE= GNOME=libxml2 MODSECURITY_VERSION= 2.9.3 MODSECURITY_USES= apache:2.4+ pkgconfig shebangfix MODSECURITY_MASTER_SITES= http://www.modsecurity.org/tarball/${MODSECURITY_VERSION}/:modsecurity MODSECURITY_DISTFILES= modsecurity-${MODSECURITY_VERSION}.tar.gz:modsecurity MODSECURITY_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-nginx-modsecurity-configure MODSECURITY_VARS= WRKSRC_modsecurity=${WRKDIR}/modsecurity-${MODSECURITY_VERSION} MODSECURITY3_LIB_DEPENDS= libmodsecurity.so:security/modsecurity3 MODSECURITY3_GH_TUPLE= SpiderLabs:ModSecurity-nginx:71ede63:modsec MODSECURITY3_CONFIGURE_ON= --add-module=${WRKSRC_modsec} NAXSI_NGINX_VER= 0.56 NAXSI_GH_TUPLE= nbs-system:naxsi:${NAXSI_NGINX_VER}:naxsi NAXSI_VARS= DSO_EXTMODS+=naxsi NAXSI_SUBDIR=/naxsi_src NJS_GH_TUPLE= nginx:njs:f5272a0:njs NJS_VARS= DSO_EXTMODS+=njs NJS_SUBDIR=/nginx PASSENGER_NGINX_VER= 6.0.2 PASSENGER_CATEGORIES= ruby PASSENGER_USE= ruby=yes PASSENGER_BUILD_DEPENDS=${LOCALBASE}/bin/rake:devel/rubygem-rake PASSENGER_RAKE_BIN= ${LOCALBASE}/bin/rake PASSENGER_MASTER_SITES= http://s3.amazonaws.com/phusion-passenger/releases/:passenger PASSENGER_DISTFILES= passenger-${PASSENGER_NGINX_VER}.tar.gz:passenger PASSENGER_VARS= WRKSRC_passenger=${WRKDIR}/passenger-${PASSENGER_NGINX_VER} \ DSO_EXTDIRS+=passenger-${PASSENGER_NGINX_VER}/src/nginx_module PASSENGER_EXTRA_PATCHES=${PATCHDIR}/extra-patch-passenger-build-nginx.rb \ ${PATCHDIR}/extra-patch-passenger-disable-telemetry POSTGRES_USES= pgsql POSTGRES_GH_TUPLE= FRiCKLE:ngx_postgres:1.0rc7:postgres POSTGRES_CONFIGURE_ON= --add-module=${WRKSRC_postgres} POSTGRES_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_postgres-config \ ${PATCHDIR}/extra-patch-ngx_postgres_module.c RDS_CSV_GH_TUPLE= openresty:rds-csv-nginx-module:v0.08:rdscsv RDS_CSV_CONFIGURE_ON= --add-module=${WRKSRC_rdscsv} RDS_JSON_GH_TUPLE= openresty:rds-json-nginx-module:v0.14:rdsjson RDS_JSON_CONFIGURE_ON= --add-module=${WRKSRC_rdsjson} REDIS2_GH_TUPLE= openresty:redis2-nginx-module:v0.15:redis2 REDIS2_VARS= DSO_EXTMODS+=redis2 RTMP_GH_TUPLE= arut:nginx-rtmp-module:v1.2.1:rtmp RTMP_VARS= DSO_EXTMODS+=rtmp SET_MISC_IMPLIES= DEVEL_KIT SET_MISC_GH_TUPLE= openresty:set-misc-nginx-module:cda7e50:setmisc SET_MISC_VARS= DSO_EXTMODS+=setmisc SFLOW_GH_TUPLE= sflow:nginx-sflow-module:543c72a:sflow SFLOW_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_http_sflow_config.c \ ${PATCHDIR}/extra-patch-ngx_http_sflow_config.h \ ${PATCHDIR}/extra-patch-ngx_http_sflow_module.c SHIBBOLETH_GH_TUPLE= nginx-shib:nginx-http-shibboleth:f07bf3c:shibboleth SHIBBOLETH_VARS= DSO_EXTMODS+=shibboleth SLOWFS_CACHE_MASTER_SITES= http://labs.frickle.com/files/:slowfs_cache SLOWFS_CACHE_DISTFILES= ngx_slowfs_cache-1.10.tar.gz:slowfs_cache SLOWFS_CACHE_CONFIGURE_ON= --add-module=${WRKDIR}/ngx_slowfs_cache-1.10 SMALL_LIGHT_LIB_DEPENDS= libMagickWand-6.so:graphics/ImageMagick6 \ libpcre.so:devel/pcre SMALL_LIGHT_GH_TUPLE= cubicdaiya:ngx_small_light:v0.9.2:small_light SMALL_LIGHT_VARS= DSO_EXTMODS+=small_light SRCACHE_GH_TUPLE= openresty:srcache-nginx-module:v0.31:srcache #SRCACHE_CONFIGURE_ON= --add-module=${WRKSRC_srcache} SRCACHE_VARS= DSO_EXTMODS+=srcache VOD_GH_TUPLE= kaltura:nginx-vod-module:1.23:vod VOD_USE= GNOME=libxml2 VOD_VARS= DSO_EXTMODS+=vod VOD_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-nginx-vod-module-config \ ${PATCHDIR}/extra-patch-vod-filters-audio_encoder.c VTS_GH_TUPLE= vozlt:nginx-module-vts:v0.1.18:vts VTS_CONFIGURE_ON= --add-module=${WRKSRC_vts} XSS_GH_TUPLE= openresty:xss-nginx-module:v0.05:xss XSS_CONFIGURE_ON= --add-module=${WRKSRC_xss} WEBSOCKIFY_GH_TUPLE= tg123:websockify-nginx-module:e82d254:websockify WEBSOCKIFY_CONFIGURE_ON= --add-module=${WRKSRC_websockify} Index: head/www/nginx/Makefile.options.desc =================================================================== --- head/www/nginx/Makefile.options.desc (revision 508237) +++ head/www/nginx/Makefile.options.desc (revision 508238) @@ -1,110 +1,111 @@ # $FreeBSD$ AJP_DESC= 3rd party ajp module ARRAYVAR_DESC= 3rd party array_var module AWS_AUTH_DESC= 3rd party aws auth module BROTLI_DESC= 3rd party brotli module CACHE_PURGE_DESC= 3rd party cache_purge module CLOJURE_DESC= 3rd party clojure module CT_DESC= 3rd party cert_transparency module (SSL req.) DEBUGLOG_DESC= Enable debug log (--with-debug) DEBUG_DESC= Build with debugging support DEVEL_KIT_DESC= 3rd party Nginx Development Kit module DRIZZLE_DESC= 3rd party drizzle module DSO_DESC= Enable dynamic modules support DYNAMIC_UPSTREAM_DESC= 3rd party dynamic_upstream module ECHO_DESC= 3rd party echo module ENCRYPTSESSION_DESC= 3rd party encrypted_session module FASTDFS_DESC= 3rd party fastdfs module FILE_AIO_DESC= Enable file aio FORMINPUT_DESC= 3rd party form_input module GOOGLE_PERFTOOLS_DESC= Enable google perftools module GRIDFS_DESC= 3rd party gridfs module GSSAPI_DESC= GSSAPI implementation (imply HTTP_AUTH_KRB5) HEADERS_MORE_DESC= 3rd party headers_more module HTTPGRP_DESC= Modules that require HTTP module HTTPV2_DESC= Enable HTTP/2 protocol support (SSL req.) HTTP_ACCEPT_LANGUAGE_DESC= 3rd party accept_language module HTTP_ADDITION_DESC= Enable http_addition module HTTP_AUTH_DIGEST_DESC= 3rd party http_authdigest module HTTP_AUTH_KRB5_DESC= 3rd party http_auth_gss module HTTP_AUTH_LDAP_DESC= 3rd party http_auth_ldap module HTTP_AUTH_PAM_DESC= 3rd party http_auth_pam module HTTP_AUTH_REQ_DESC= Enable http_auth_request module HTTP_CACHE_DESC= Enable http_cache module HTTP_DAV_DESC= Enable http_webdav module HTTP_DAV_EXT_DESC= 3rd party webdav_ext module HTTP_DESC= Enable HTTP module HTTP_EVAL_DESC= 3rd party eval module HTTP_FANCYINDEX_DESC= 3rd party http_fancyindex module HTTP_FLV_DESC= Enable http_flv module HTTP_FOOTER_DESC= 3rd party http_footer module HTTP_GEOIP2_DESC= 3rd party geoip2 module HTTP_GUNZIP_FILTER_DESC= Enable http_gunzip_filter module HTTP_GZIP_STATIC_DESC= Enable http_gzip_static module HTTP_IMAGE_FILTER_DESC= Enable http_image_filter module HTTP_JSON_STATUS_DESC= 3rd party http_json_status module HTTP_MOGILEFS_DESC= 3rd party mogilefs module HTTP_MP4_DESC= Enable http_mp4 module HTTP_MP4_H264_DESC= 3rd party mp4/h264 module HTTP_NOTICE_DESC= 3rd party notice module HTTP_PERL_DESC= Enable http_perl module HTTP_PUSH_DESC= 3rd party push module HTTP_PUSH_STREAM_DESC= 3rd party push stream module HTTP_RANDOM_INDEX_DESC= Enable http_random_index module HTTP_REALIP_DESC= Enable http_realip module HTTP_REDIS_DESC= 3rd party http_redis module HTTP_RESPONSE_DESC= 3rd party http_response module HTTP_REWRITE_DESC= Enable http_rewrite module HTTP_SECURE_LINK_DESC= Enable http_secure_link module HTTP_SLICE_DESC= Enable http_slice module +HTTP_SLICE_AHEAD_DESC= Enable http_slice_ahead module HTTP_SSL_DESC= Enable http_ssl module HTTP_STATUS_DESC= Enable http_stub_status module HTTP_SUBS_FILTER_DESC= 3rd party subs filter module HTTP_SUB_DESC= Enable http_sub module HTTP_TARANTOOL_DESC= 3rd party tarantool upstream module HTTP_UPLOAD_DESC= 3rd party upload module HTTP_UPLOAD_PROGRESS_DESC= 3rd party uploadprogress module HTTP_UPSTREAM_CHECK_DESC= 3rd party upstream check module HTTP_UPSTREAM_FAIR_DESC= 3rd party upstream fair module HTTP_UPSTREAM_STICKY_DESC= 3rd party upstream sticky module HTTP_VIDEO_DESC= 3rd party video module support HTTP_VIDEO_THUMBEXTRACTOR_DESC= 3rd party video_thumbextractor module HTTP_XSLT_DESC= Enable http_xslt module HTTP_ZIP_DESC= 3rd party http_zip module ICONV_DESC= 3rd party iconv module IPV6_DESC= Enable IPv6 support LET_DESC= 3rd party let module LUA_DESC= 3rd party lua module MAILGRP_DESC= Modules that require MAIL module MAIL_DESC= Enable IMAP4/POP3/SMTP proxy module MAIL_IMAP_DESC= Enable IMAP4 proxy module MAIL_POP3_DESC= Enable POP3 proxy module MAIL_SMTP_DESC= Enable SMTP proxy module MAIL_SSL_DESC= Enable mail_ssl module MEMC_DESC= 3rd party memc (memcached) module MODSECURITY3_DESC= 3rd party modsecurity3 module MODSECURITY_DESC= 3rd party mod_security module NAXSI_DESC= 3rd party naxsi module NJS_DESC= Enable http_javascript module PASSENGER_DESC= 3rd party passenger module POSTGRES_DESC= 3rd party postgres module RDS_CSV_DESC= 3rd party rds_csv module RDS_JSON_DESC= 3rd party rds_json module REDIS2_DESC= 3rd party redis2 module RTMP_DESC= 3rd party rtmp module SET_MISC_DESC= 3rd party set_misc module SFLOW_DESC= 3rd party sflow module SHIBBOLETH_DESC= 3rd party shibboleth module SLOWFS_CACHE_DESC= 3rd party slowfs_cache module SMALL_LIGHT_DESC= 3rd party small_light module SRCACHE_DESC= 3rd party srcache module STREAM_DESC= Enable stream module STREAM_SSL_DESC= Enable stream_ssl module (SSL req.) STREAM_SSL_PREREAD_DESC= Enable stream_ssl_preread module (SSL req.) THREADS_DESC= Enable threads support VOD_DESC= 3rd party vod module VTS_DESC= 3rd party vts module WWW_DESC= Enable html sample files XSS_DESC= 3rd party xss module WEBSOCKIFY_DESC= 3rd party websockify module Index: head/www/nginx/files/extra-patch-src_http_modules_ngx__http__slice_read_ahead.c =================================================================== --- head/www/nginx/files/extra-patch-src_http_modules_ngx__http__slice_read_ahead.c (nonexistent) +++ head/www/nginx/files/extra-patch-src_http_modules_ngx__http__slice_read_ahead.c (revision 508238) @@ -0,0 +1,456 @@ +--- src/http/modules/ngx_http_slice_filter_module.c.orig 2019-04-23 13:12:58 UTC ++++ src/http/modules/ngx_http_slice_filter_module.c +@@ -2,6 +2,10 @@ + /* + * Copyright (C) Roman Arutyunyan + * Copyright (C) Nginx, Inc. ++ * Copyright (C) Carey Gister ++ * Copyright (C) Metapeer, Inc. ++ * ++ * Retrieve slices with an optional look-a-head of N slices where N is a float value. + */ + + +@@ -9,13 +13,25 @@ + #include + #include + ++/* ++ * Location Configuration -- size is size of a slice, read_a_heads is number of ++ * blocks to look a head: 0, will not limit the number of blocks. Blocks will be ++ * retrieved as quickly as GETs can be issued and returned. ++ */ + + typedef struct { + size_t size; ++ float read_a_heads; + } ngx_http_slice_loc_conf_t; + + + typedef struct { ++ size_t requested_bytes; ++ size_t received_bytes; ++ size_t skipped_first_slice; ++} ngx_http_slice_read_a_head_t; ++ ++typedef struct { + off_t start; + off_t end; + ngx_str_t range; +@@ -23,6 +39,7 @@ typedef struct { + unsigned last:1; + unsigned active:1; + ngx_http_request_t *sr; ++ ngx_http_slice_read_a_head_t *read_a_head; + } ngx_http_slice_ctx_t; + + +@@ -46,6 +63,8 @@ static char *ngx_http_slice_merge_loc_conf(ngx_conf_t + void *child); + static ngx_int_t ngx_http_slice_add_variables(ngx_conf_t *cf); + static ngx_int_t ngx_http_slice_init(ngx_conf_t *cf); ++static char * ngx_conf_set_float_slot(ngx_conf_t *cf, ngx_command_t *cmd, ++ void *conf); + + + static ngx_command_t ngx_http_slice_filter_commands[] = { +@@ -57,6 +76,13 @@ static ngx_command_t ngx_http_slice_filter_commands[] + offsetof(ngx_http_slice_loc_conf_t, size), + NULL }, + ++ { ngx_string("slice_read_ahead"), ++ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, ++ ngx_conf_set_float_slot, ++ NGX_HTTP_LOC_CONF_OFFSET, ++ offsetof(ngx_http_slice_loc_conf_t, read_a_heads), ++ NULL }, ++ + ngx_null_command + }; + +@@ -102,11 +128,11 @@ static ngx_int_t + ngx_http_slice_header_filter(ngx_http_request_t *r) + { + off_t end; +- ngx_int_t rc; ++ ngx_int_t rc, rc1; + ngx_table_elt_t *h; + ngx_http_slice_ctx_t *ctx; + ngx_http_slice_loc_conf_t *slcf; +- ngx_http_slice_content_range_t cr; ++ ngx_http_slice_content_range_t cr, cr1; + + ctx = ngx_http_get_module_ctx(r, ngx_http_slice_filter_module); + if (ctx == NULL) { +@@ -187,6 +213,23 @@ ngx_http_slice_header_filter(ngx_http_request_t *r) + rc = ngx_http_next_header_filter(r); + + if (r != r->main) { ++ if (ctx->read_a_head != NULL) { ++ ngx_log_debug5(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, ++ "http slice header (subrequest) requested_bytes: %uz, size: %uz, range: %O/%O, end: %O", ++ ctx->read_a_head->requested_bytes, slcf->size, cr.start, ++ cr.end, end); ++ ++ if (end != cr.start) { ++ ctx->read_a_head->requested_bytes += ++ ngx_min(slcf->size, ++ (size_t) end - (size_t) cr.start); ++ } ++ ++ ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, ++ "http slice header (subrequest) new requested_bytes: %uz, size: %uz", ++ ctx->read_a_head->requested_bytes, slcf->size); ++ } ++ + return rc; + } + +@@ -201,8 +244,68 @@ ngx_http_slice_header_filter(ngx_http_request_t *r) + ctx->end = r->headers_out.content_offset + + r->headers_out.content_length_n; + ++ /* Update requested bytes for the new chunk. */ ++ if (ctx->read_a_head != NULL) { ++ ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, ++ "http slice header (main request, partial) requested_bytes: %uz, size: %uz, start/end (%O/%O)", ++ ctx->read_a_head->requested_bytes, slcf->size, ++ ctx->start, ctx->end); ++ ++ if (ctx->end != ctx->start) { ++ ctx->read_a_head->requested_bytes += ++ ngx_min(slcf->size, ++ (size_t) ctx->end - (size_t) ctx->start); ++ } ++ ++ ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, ++ "http slice header (main request, partial) new requested_bytes: %uz, size: %uz, start/end (%O/%O)", ++ ctx->read_a_head->requested_bytes, slcf->size, ctx->start, ctx->end); ++ ++ /* Parse the new Content-Range, which may have been set by the Range ++ filter. If the start changed, then adjust the requested_byte count ++ by the difference between the slice start and the actual start. ++ These bytes will never be received. */ ++ ++ rc1 = ngx_http_slice_parse_content_range(r, &cr1); ++ ngx_log_debug(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, ++ "http slice header (main request, partial): rc1: %d", ++ rc1); ++ ++ if (rc1 == NGX_OK) { ++ ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, ++ "http slice header (main request, partial new content range) cr1.start: %uz, cr1.end: %uz", ++ cr1.start, cr1.end); ++ ++ if (cr1.start != cr.start) { ++ ctx->read_a_head->skipped_first_slice = ++ cr1.start - (slcf->size * (cr1.start / slcf->size)); ++ ++ ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, ++ "http slice header (main request, partial) new cr.start: %uz, initial start: %uz, skipped first slice: %uz", ++ cr1.start, cr.start, ++ ctx->read_a_head->skipped_first_slice); ++ } ++ } ++ } + } else { + ctx->end = cr.complete_length; ++ ++ /* Update the requested bytes for the new chunk. */ ++ if (ctx->read_a_head != NULL) { ++ ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, ++ "http slice header (main request, full) requested_bytes: %uz, size: %uz, start/end (%O/%O)", ++ ctx->read_a_head->requested_bytes, slcf->size, ctx->start, ctx->end); ++ ++ if (ctx->end != ctx->start) { ++ ctx->read_a_head->requested_bytes += ++ ngx_min(slcf->size, ++ (size_t) ctx->end - (size_t) ctx->start); ++ } ++ ++ ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, ++ "http slice header (main request, full) new requested_bytes: %uz, size: %uz, start/end (%O/%O)", ++ ctx->read_a_head->requested_bytes, slcf->size, ctx->start, ctx->end); ++ } + } + + return rc; +@@ -216,14 +319,31 @@ ngx_http_slice_body_filter(ngx_http_request_t *r, ngx_ + ngx_chain_t *cl; + ngx_http_slice_ctx_t *ctx; + ngx_http_slice_loc_conf_t *slcf; ++ size_t received, read_a_head_window, read_a_head_size; + + ctx = ngx_http_get_module_ctx(r, ngx_http_slice_filter_module); + +- if (ctx == NULL || r != r->main) { ++ if (ctx == NULL) { + return ngx_http_next_body_filter(r, in); + } + ++ if (r != r->main) { ++ if (ctx->read_a_head != NULL) { ++ received = 0; ++ for (cl = in; cl; cl = cl->next) { ++ received = received + ngx_buf_size(cl->buf); ++ } ++ ++ ctx->read_a_head->received_bytes += received; ++ } ++ ++ return ngx_http_next_body_filter(r, in); ++ } ++ ++ /* For the main request */ ++ received = 0; + for (cl = in; cl; cl = cl->next) { ++ received = received + ngx_buf_size(cl->buf); + if (cl->buf->last_buf) { + cl->buf->last_buf = 0; + cl->buf->last_in_chain = 1; +@@ -232,6 +352,10 @@ ngx_http_slice_body_filter(ngx_http_request_t *r, ngx_ + } + } + ++ if (ctx->read_a_head != NULL) { ++ ctx->read_a_head->received_bytes += received; ++ } ++ + rc = ngx_http_next_body_filter(r, in); + + if (rc == NGX_ERROR || !ctx->last) { +@@ -258,6 +382,20 @@ ngx_http_slice_body_filter(ngx_http_request_t *r, ngx_ + return rc; + } + ++ slcf = ngx_http_get_module_loc_conf(r, ngx_http_slice_filter_module); ++ ++ if (ctx->read_a_head != NULL) { ++ read_a_head_size = (size_t) (slcf->size * slcf->read_a_heads); ++ read_a_head_window = r->connection->sent + read_a_head_size; ++ ++ if ((r->connection->sent != 0) && ++ ((read_a_head_window + ctx->read_a_head->skipped_first_slice) < ctx->read_a_head->requested_bytes)) { ++ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, ++ "http slice body filter defer subrequest: returning NGX_AGAIN"); ++ return NGX_AGAIN; ++ } ++ } ++ + if (ngx_http_subrequest(r, &r->uri, &r->args, &ctx->sr, NULL, + NGX_HTTP_SUBREQUEST_CLONE) + != NGX_OK) +@@ -267,8 +405,6 @@ ngx_http_slice_body_filter(ngx_http_request_t *r, ngx_ + + ngx_http_set_ctx(ctx->sr, ctx, ngx_http_slice_filter_module); + +- slcf = ngx_http_get_module_loc_conf(r, ngx_http_slice_filter_module); +- + ctx->range.len = ngx_sprintf(ctx->range.data, "bytes=%O-%O", ctx->start, + ctx->start + (off_t) slcf->size - 1) + - ctx->range.data; +@@ -287,6 +423,7 @@ ngx_http_slice_parse_content_range(ngx_http_request_t + ngx_http_slice_content_range_t *cr) + { + off_t start, end, complete_length, cutoff, cutlim; ++ ssize_t len; + u_char *p; + ngx_table_elt_t *h; + +@@ -300,6 +437,7 @@ ngx_http_slice_parse_content_range(ngx_http_request_t + } + + p = h->value.data + 6; ++ len = h->value.len - 6; + + cutoff = NGX_MAX_OFF_T_VALUE / 10; + cutlim = NGX_MAX_OFF_T_VALUE % 10; +@@ -308,56 +446,62 @@ ngx_http_slice_parse_content_range(ngx_http_request_t + end = 0; + complete_length = 0; + +- while (*p == ' ') { p++; } ++ while ((*p == ' ') && (len != 0)) { p++; len--; } + +- if (*p < '0' || *p > '9') { ++ if ((len == 0) || (*p < '0' || *p > '9')) { + return NGX_ERROR; + } + +- while (*p >= '0' && *p <= '9') { ++ while ((len != 0) && (*p >= '0' && *p <= '9')) { + if (start >= cutoff && (start > cutoff || *p - '0' > cutlim)) { + return NGX_ERROR; + } + + start = start * 10 + (*p++ - '0'); ++ len--; + } + +- while (*p == ' ') { p++; } ++ while ((len != 0) && (*p == ' ')) { p++; len--; } + +- if (*p++ != '-') { ++ if ((len == 0) || (*p++ != '-')) { + return NGX_ERROR; + } + +- while (*p == ' ') { p++; } ++ len--; + +- if (*p < '0' || *p > '9') { ++ while ((len != 0) && (*p == ' ')) { p++; len--; } ++ ++ if ((len == 0) || (*p < '0' || *p > '9')) { + return NGX_ERROR; + } + +- while (*p >= '0' && *p <= '9') { ++ while ((len != 0) && (*p >= '0' && *p <= '9')) { + if (end >= cutoff && (end > cutoff || *p - '0' > cutlim)) { + return NGX_ERROR; + } + + end = end * 10 + (*p++ - '0'); ++ len--; + } + + end++; + +- while (*p == ' ') { p++; } ++ while ((len != 0) && (*p == ' ')) { p++; len--; } + +- if (*p++ != '/') { ++ if ((len == 0) || (*p++ != '/')) { + return NGX_ERROR; + } + +- while (*p == ' ') { p++; } ++ len--; + +- if (*p != '*') { ++ while ((len != 0) && (*p == ' ')) { p++; len--; } ++ ++ if ((len != 0) && (*p != '*')) { + if (*p < '0' || *p > '9') { + return NGX_ERROR; + } + +- while (*p >= '0' && *p <= '9') { ++ while ((len != 0) && (*p >= '0' && *p <= '9')) { + if (complete_length >= cutoff + && (complete_length > cutoff || *p - '0' > cutlim)) + { +@@ -365,16 +509,18 @@ ngx_http_slice_parse_content_range(ngx_http_request_t + } + + complete_length = complete_length * 10 + (*p++ - '0'); ++ len--; + } + + } else { + complete_length = -1; + p++; ++ len--; + } + +- while (*p == ' ') { p++; } ++ while ((len != 0) && (*p == ' ')) { p++; len--; } + +- if (*p != '\0') { ++ if (len != 0) { + return NGX_ERROR; + } + +@@ -390,9 +536,10 @@ static ngx_int_t + ngx_http_slice_range_variable(ngx_http_request_t *r, + ngx_http_variable_value_t *v, uintptr_t data) + { +- u_char *p; +- ngx_http_slice_ctx_t *ctx; +- ngx_http_slice_loc_conf_t *slcf; ++ u_char *p; ++ ngx_http_slice_ctx_t *ctx; ++ ngx_http_slice_loc_conf_t *slcf; ++ ngx_http_slice_read_a_head_t *read_a_head; + + ctx = ngx_http_get_module_ctx(r, ngx_http_slice_filter_module); + +@@ -414,6 +561,15 @@ ngx_http_slice_range_variable(ngx_http_request_t *r, + return NGX_ERROR; + } + ++ if (slcf->read_a_heads != 0.0) { ++ read_a_head = ngx_pcalloc(r->pool, sizeof(ngx_http_slice_read_a_head_t)); ++ if (read_a_head == NULL) { ++ return NGX_ERROR; ++ } ++ ++ ctx->read_a_head = read_a_head; ++ } ++ + ngx_http_set_ctx(r, ctx, ngx_http_slice_filter_module); + + p = ngx_pnalloc(r->pool, sizeof("bytes=-") - 1 + 2 * NGX_OFF_T_LEN); +@@ -488,6 +644,39 @@ ngx_http_slice_get_start(ngx_http_request_t *r) + } + + ++static char * ++ngx_conf_set_float_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) ++{ ++ char *p = conf; ++ float *np; ++ ngx_str_t *value; ++ ngx_conf_post_t *post; ++ ngx_int_t val; ++ ++ np = (float *) (p + cmd->offset); ++ ++ if (*np != (float) NGX_CONF_UNSET) { ++ return "is duplicate"; ++ } ++ ++ value = cf->args->elts; ++ val = ngx_atofp(value[1].data, value[1].len, 3); ++ ++ *np = (float) val / 1000.0; ++ ++ if (*np == (float) NGX_ERROR) { ++ return "invalid number"; ++ } ++ ++ if (cmd->post) { ++ post = cmd->post; ++ return post->post_handler(cf, post, np); ++ } ++ ++ return NGX_CONF_OK; ++} ++ ++ + static void * + ngx_http_slice_create_loc_conf(ngx_conf_t *cf) + { +@@ -499,6 +688,7 @@ ngx_http_slice_create_loc_conf(ngx_conf_t *cf) + } + + slcf->size = NGX_CONF_UNSET_SIZE; ++ slcf->read_a_heads = (float) NGX_CONF_UNSET; + + return slcf; + } +@@ -511,6 +701,13 @@ ngx_http_slice_merge_loc_conf(ngx_conf_t *cf, void *pa + ngx_http_slice_loc_conf_t *conf = child; + + ngx_conf_merge_size_value(conf->size, prev->size, 0); ++ ngx_conf_merge_value(conf->read_a_heads, prev->read_a_heads, 0.0); ++ ++ if (conf->read_a_heads < 0.0) { ++ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "read a head must be >= 0"); ++ return NGX_CONF_ERROR; ++ } ++ + + return NGX_CONF_OK; + } Property changes on: head/www/nginx/files/extra-patch-src_http_modules_ngx__http__slice_read_ahead.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property