comparison src/imap/ngx_imap_auth_http_module.c @ 883:eac23634d614

Auth-Status: WAIT
author Igor Sysoev <igor@sysoev.ru>
date Sun, 03 Dec 2006 13:48:49 +0000
parents 6044cea025fa
children 4d68c486fcb0
comparison
equal deleted inserted replaced
882:26c3e48b9996 883:eac23634d614
486 && ctx->header_start[1] == 'K') 486 && ctx->header_start[1] == 'K')
487 { 487 {
488 continue; 488 continue;
489 } 489 }
490 490
491 if (len == 4
492 && ctx->header_start[0] == 'W'
493 && ctx->header_start[1] == 'A'
494 && ctx->header_start[2] == 'I'
495 && ctx->header_start[3] == 'T')
496 {
497 s->auth_wait = 1;
498 continue;
499 }
500
491 ctx->errmsg.len = len; 501 ctx->errmsg.len = len;
492 ctx->errmsg.data = ctx->header_start; 502 ctx->errmsg.data = ctx->header_start;
493 503
494 if (s->protocol == NGX_IMAP_POP3_PROTOCOL) { 504 if (s->protocol == NGX_IMAP_POP3_PROTOCOL) {
495 size = sizeof("-ERR ") - 1 + len + sizeof(CRLF) - 1; 505 size = sizeof("-ERR ") - 1 + len + sizeof(CRLF) - 1;
620 ngx_destroy_pool(ctx->pool); 630 ngx_destroy_pool(ctx->pool);
621 631
622 if (timer == 0) { 632 if (timer == 0) {
623 s->quit = 1; 633 s->quit = 1;
624 ngx_imap_send(s->connection->write); 634 ngx_imap_send(s->connection->write);
635 return;
636 }
637
638 ngx_add_timer(s->connection->read, timer * 1000);
639
640 s->connection->read->handler = ngx_imap_auth_sleep_handler;
641
642 return;
643 }
644
645 if (s->auth_wait) {
646 timer = ctx->sleep;
647
648 ngx_destroy_pool(ctx->pool);
649
650 if (timer == 0) {
651 ngx_imap_auth_http_init(s);
625 return; 652 return;
626 } 653 }
627 654
628 ngx_add_timer(s->connection->read, timer * 1000); 655 ngx_add_timer(s->connection->read, timer * 1000);
629 656
755 s = c->data; 782 s = c->data;
756 783
757 if (rev->timedout) { 784 if (rev->timedout) {
758 785
759 rev->timedout = 0; 786 rev->timedout = 0;
787
788 if (s->auth_wait) {
789 s->auth_wait = 0;
790 ngx_imap_auth_http_init(s);
791 return;
792 }
760 793
761 if (s->protocol == NGX_IMAP_POP3_PROTOCOL) { 794 if (s->protocol == NGX_IMAP_POP3_PROTOCOL) {
762 s->imap_state = ngx_pop3_start; 795 s->imap_state = ngx_pop3_start;
763 s->connection->read->handler = ngx_pop3_auth_state; 796 s->connection->read->handler = ngx_pop3_auth_state;
764 797