Welcome! Log In Create A New Profile

Advanced

Initialize ngx_buf_t in ngx_create_temp_buf()

August 08, 2014 02:56AM
Hello,

I don't understand why b->last is used to initialize b->end.
Why it's not :
b->end = b->start + size;

Regards,

yves

# HG changeset patch
# User Yves Crespin<yves.crespin@e-quartz.fr>
# Date 1407480933 -7200
# Node ID 74265a0edba677c967f532de789a4589436aa5fb
# Parent a62fffc16af816612a4acf34c7a4781f454fa5d1
ngx_buf: initialize b->end with b->start

diff -r a62fffc16af8 -r 74265a0edba6 src/core/ngx_buf.c
--- a/src/core/ngx_buf.c Fri Aug 08 08:45:23 2014 +0200
+++ b/src/core/ngx_buf.c Fri Aug 08 08:55:33 2014 +0200
@@ -37,7 +37,7 @@

b->pos = b->start;
b->last = b->start;
- b->end = b->last + size;
+ b->end = b->start + size;
b->temporary = 1;

return b;
Subject Author Posted

Initialize ngx_buf_t in ngx_create_temp_buf()

crespin August 08, 2014 02:56AM

Re: Initialize ngx_buf_t in ngx_create_temp_buf()

Maxim Dounin August 08, 2014 09:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 138
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready