[oe] [meta-webserver] [PATCH] fix nginx with large files support

Khem Raj raj.khem at gmail.com
Wed Oct 25 02:55:26 UTC 2017


On Tue, Oct 24, 2017 at 6:47 PM, Wangchong Zhou <fffonion at gmail.com> wrote:
> Thanks! This should work.
>
> Signed-off-by: Wangchong Zhou <fffonion at gmail.com>
> ---
>  meta-webserver/recipes-httpd/nginx/nginx.inc | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/meta-webserver/recipes-httpd/nginx/nginx.inc
> b/meta-webserver/recipes-httpd/nginx/nginx.inc
> index 4a97e2670..00ce132b3 100644
> --- a/meta-webserver/recipes-httpd/nginx/nginx.inc
> +++ b/meta-webserver/recipes-httpd/nginx/nginx.inc
> @@ -41,6 +41,12 @@ do_configure () {
>      else
>          PTRSIZE=4
>      fi
> +    if ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'true',
> 'false', d)}; then
> +        OFFTSIZE=8
> +    else
> +        OFFTSIZE=${PTRSIZE}
> +    fi
> +

I was looking for something like

 --with-off-t=${@bb.utils.contains('DISTRO_FEATURES','largefile','8','${PTRSIZE}',d)};

>
>      echo $CFLAGS
>      echo $LDFLAGS
> @@ -57,7 +63,7 @@ do_configure () {
>      --with-ptr-size=${PTRSIZE} \
>      --with-sig-atomic-t=${PTRSIZE} \
>      --with-size-t=${PTRSIZE} \
> -    --with-off-t=${PTRSIZE} \
> +    --with-off-t=${OFFTSIZE} \
>      --with-time-t=${PTRSIZE} \
>      --with-sys-nerr=132 \
>      --conf-path=${sysconfdir}/nginx/nginx.conf \
> --
> 2.13.5
>
> On Tue, Oct 24, 2017 at 8:31 PM, Khem Raj <raj.khem at gmail.com> wrote:
>>
>> On Tue, Oct 24, 2017 at 3:27 PM, Wangchong Zhou <fffonion at gmail.com>
>> wrote:
>> > Resend a patch using largefile DISTRO_FEATURES.
>> >
>> >
>> > Signed-off-by: Wangchong Zhou <fffonion at gmail.com>
>> > ---
>> >  meta-webserver/recipes-httpd/nginx/nginx.inc | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/meta-webserver/recipes-httpd/nginx/nginx.inc
>> > b/meta-webserver/recipes-httpd/nginx/nginx.inc
>> > index 4a97e2670..84ce0fb4d 100644
>> > --- a/meta-webserver/recipes-httpd/nginx/nginx.inc
>> > +++ b/meta-webserver/recipes-httpd/nginx/nginx.inc
>> > @@ -57,7 +57,7 @@ do_configure () {
>> >      --with-ptr-size=${PTRSIZE} \
>> >      --with-sig-atomic-t=${PTRSIZE} \
>> >      --with-size-t=${PTRSIZE} \
>> > -    --with-off-t=${PTRSIZE} \
>> > +
>> >
>> > --with-off-t=${@bb.utils.contains('DISTRO_FEATURES','largefile','8','4',d)};
>> > \
>>
>> Could you still keep using PTRSIZE in else case above ?
>>
>> >      --with-time-t=${PTRSIZE} \
>> >      --with-sys-nerr=132 \
>> >      --conf-path=${sysconfdir}/nginx/nginx.conf \
>> > --
>> > 2.13.5
>> >
>> > On Tue, Oct 24, 2017 at 2:28 PM, Wangchong Zhou <fffonion at gmail.com>
>> > wrote:
>> >>
>> >> Hi,
>> >> The nginx receipt hardcoded size of off_t to be same as ptrsize, which
>> > can break large files support on 32bit machines. The http range header
>> > will
>> > fail with a code 416 on files bigger than 2G. Changing it to 8 will fix
>> > the
>> > problem.
>> >>
>> >> I don't think hardcode off_t to 8 is a neat way of fixing this. Is
>> >> there
>> > a better way to detect large files support?
>> >>
>> >>
>> >> Author: Wangchong Zhou <fffonion at gmail.com>
>> >> Date:   Tue Oct 24 14:21:35 2017 -0400
>> >>
>> >>     fix large files support in nginx by setting off_t to 8 bytes
>> >>
>> >>     Signed-off-by: Wangchong Zhou <fffonion at gmail.com>
>> >>
>> >> diff --git a/meta-webserver/recipes-httpd/nginx/nginx.inc
>> > b/meta-webserver/recipes-httpd/nginx/nginx.inc
>> >> index 4a97e2670..4cdf892c7 100644
>> >> --- a/meta-webserver/recipes-httpd/nginx/nginx.inc
>> >> +++ b/meta-webserver/recipes-httpd/nginx/nginx.inc
>> >> @@ -57,7 +57,7 @@ do_configure () {
>> >>      --with-ptr-size=${PTRSIZE} \
>> >>      --with-sig-atomic-t=${PTRSIZE} \
>> >>      --with-size-t=${PTRSIZE} \
>> >> -    --with-off-t=${PTRSIZE} \
>> >> +    --with-off-t=8 \
>> >>      --with-time-t=${PTRSIZE} \
>> >>      --with-sys-nerr=132 \
>> >>      --conf-path=${sysconfdir}/nginx/nginx.conf \
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > Regards
>> > fffonion (B607 2745 84E8 D5E5)
>> > --
>> > _______________________________________________
>> > Openembedded-devel mailing list
>> > Openembedded-devel at lists.openembedded.org
>> > http://lists.openembedded.org/mailman/listinfo/openembedded-devel
>
>
>
>
> --
> Regards
> fffonion (B607 2745 84E8 D5E5)



More information about the Openembedded-devel mailing list