comparison src/http/ngx_http_core_module.c @ 2541:e73f70b4ca5c

fix case when the first try is shorter then URI
author Igor Sysoev <igor@sysoev.ru>
date Sun, 01 Mar 2009 19:10:36 +0000
parents a6d6d762c554
children 163114282d2c
comparison
equal deleted inserted replaced
2540:042dcbaead66 2541:e73f70b4ca5c
1084 1084
1085 } else { 1085 } else {
1086 len = tf->name.len; 1086 len = tf->name.len;
1087 } 1087 }
1088 1088
1089 reserve = len - r->uri.len;
1090
1091 /* 16 bytes are preallocation */ 1089 /* 16 bytes are preallocation */
1092 reserve = reserve < 16 ? 16 : reserve + 16; 1090 reserve = ngx_abs((ssize_t) (len - r->uri.len)) + alias + 16;
1093
1094 reserve += alias;
1095 1091
1096 if (reserve > allocated) { 1092 if (reserve > allocated) {
1097 1093
1098 /* we just need to allocate path and to copy a root */ 1094 /* we just need to allocate path and to copy a root */
1099 1095