Initialize ngx_buf_t in ngx_create_temp_buf()

crespin nginx-forum at nginx.us
Fri Aug 8 06:56:12 UTC 2014


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 at 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;

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,252404,252404#msg-252404



More information about the nginx mailing list