Mercurial > hg > nginx-quic
comparison src/mail/ngx_mail_imap_handler.c @ 2049:2a92804f4109
*) back out r2040
*) refactor ngx_palloc()
*) introduce ngx_pnalloc()
*) additional pool blocks have smaller header
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 17 Jun 2008 15:00:30 +0000 |
parents | e584e946e198 |
children | 722b5aff05ae |
comparison
equal
deleted
inserted
replaced
2048:824615f3b4ec | 2049:2a92804f4109 |
---|---|
257 s->tag.data = (u_char *) imap_star; | 257 s->tag.data = (u_char *) imap_star; |
258 } | 258 } |
259 | 259 |
260 if (s->tagged_line.len < s->tag.len + s->text.len + s->out.len) { | 260 if (s->tagged_line.len < s->tag.len + s->text.len + s->out.len) { |
261 s->tagged_line.len = s->tag.len + s->text.len + s->out.len; | 261 s->tagged_line.len = s->tag.len + s->text.len + s->out.len; |
262 s->tagged_line.data = ngx_palloc(c->pool, s->tagged_line.len); | 262 s->tagged_line.data = ngx_pnalloc(c->pool, s->tagged_line.len); |
263 if (s->tagged_line.data == NULL) { | 263 if (s->tagged_line.data == NULL) { |
264 ngx_mail_close_connection(c); | 264 ngx_mail_close_connection(c); |
265 return; | 265 return; |
266 } | 266 } |
267 } | 267 } |
315 if (s->args.nelts != 2 || arg[0].len == 0) { | 315 if (s->args.nelts != 2 || arg[0].len == 0) { |
316 return NGX_MAIL_PARSE_INVALID_COMMAND; | 316 return NGX_MAIL_PARSE_INVALID_COMMAND; |
317 } | 317 } |
318 | 318 |
319 s->login.len = arg[0].len; | 319 s->login.len = arg[0].len; |
320 s->login.data = ngx_palloc(c->pool, s->login.len); | 320 s->login.data = ngx_pnalloc(c->pool, s->login.len); |
321 if (s->login.data == NULL) { | 321 if (s->login.data == NULL) { |
322 return NGX_ERROR; | 322 return NGX_ERROR; |
323 } | 323 } |
324 | 324 |
325 ngx_memcpy(s->login.data, arg[0].data, s->login.len); | 325 ngx_memcpy(s->login.data, arg[0].data, s->login.len); |
326 | 326 |
327 s->passwd.len = arg[1].len; | 327 s->passwd.len = arg[1].len; |
328 s->passwd.data = ngx_palloc(c->pool, s->passwd.len); | 328 s->passwd.data = ngx_pnalloc(c->pool, s->passwd.len); |
329 if (s->passwd.data == NULL) { | 329 if (s->passwd.data == NULL) { |
330 return NGX_ERROR; | 330 return NGX_ERROR; |
331 } | 331 } |
332 | 332 |
333 ngx_memcpy(s->passwd.data, arg[1].data, s->passwd.len); | 333 ngx_memcpy(s->passwd.data, arg[1].data, s->passwd.len); |