# HG changeset patch # User Igor Sysoev # Date 1176909688 0 # Node ID bde5e413475918c1f870f09ffee2e218bbcfe1f1 # Parent efb7d84db340c0e5ac474430479d5dfdf91234a8 style fix: remove tabs diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -767,7 +767,7 @@ ngx_http_upstream_send_request(ngx_http_ "http upstream send request"); if (!u->request_sent && ngx_http_upstream_test_connect(c) != NGX_OK) { - ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_ERROR); + ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_ERROR); return; } @@ -914,7 +914,7 @@ ngx_http_upstream_process_header(ngx_eve } if (!u->request_sent && ngx_http_upstream_test_connect(c) != NGX_OK) { - ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_ERROR); + ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_ERROR); return; } @@ -1259,33 +1259,33 @@ ngx_http_upstream_test_connect(ngx_conne #if (NGX_HAVE_KQUEUE) if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) { - if (c->write->pending_eof) { - (void) ngx_connection_error(c, c->write->kq_errno, - "kevent() reported that connect() failed"); - return NGX_ERROR; - } + if (c->write->pending_eof) { + (void) ngx_connection_error(c, c->write->kq_errno, + "kevent() reported that connect() failed"); + return NGX_ERROR; + } } else #endif { - err = 0; - len = sizeof(int); - - /* - * BSDs and Linux return 0 and set a pending error in err - * Solaris returns -1 and sets errno - */ - - if (getsockopt(c->fd, SOL_SOCKET, SO_ERROR, (void *) &err, &len) - == -1) - { - err = ngx_errno; - } - - if (err) { - (void) ngx_connection_error(c, err, "connect() failed"); - return NGX_ERROR; - } + err = 0; + len = sizeof(int); + + /* + * BSDs and Linux return 0 and set a pending error in err + * Solaris returns -1 and sets errno + */ + + if (getsockopt(c->fd, SOL_SOCKET, SO_ERROR, (void *) &err, &len) + == -1) + { + err = ngx_errno; + } + + if (err) { + (void) ngx_connection_error(c, err, "connect() failed"); + return NGX_ERROR; + } } return NGX_OK; diff --git a/src/mail/ngx_mail_auth_http_module.c b/src/mail/ngx_mail_auth_http_module.c --- a/src/mail/ngx_mail_auth_http_module.c +++ b/src/mail/ngx_mail_auth_http_module.c @@ -686,19 +686,19 @@ ngx_mail_auth_http_process_headers(ngx_m ctx->err.len = ctx->errcode.len + ctx->errmsg.len + sizeof(" " CRLF) - 1; - p = ngx_palloc(s->connection->pool, ctx->err.len); - if (p == NULL) { - ngx_close_connection(ctx->peer.connection); - ngx_destroy_pool(ctx->pool); - ngx_mail_session_internal_server_error(s); - return; - } + p = ngx_palloc(s->connection->pool, ctx->err.len); + if (p == NULL) { + ngx_close_connection(ctx->peer.connection); + ngx_destroy_pool(ctx->pool); + ngx_mail_session_internal_server_error(s); + return; + } - ctx->err.data = p; + ctx->err.data = p; - p = ngx_cpymem(p, ctx->errcode.data, ctx->errcode.len); + p = ngx_cpymem(p, ctx->errcode.data, ctx->errcode.len); *p++ = ' '; - p = ngx_cpymem(p, ctx->errmsg.data, ctx->errmsg.len); + p = ngx_cpymem(p, ctx->errmsg.data, ctx->errmsg.len); *p++ = CR; *p = LF; } diff --git a/src/mail/ngx_mail_handler.c b/src/mail/ngx_mail_handler.c --- a/src/mail/ngx_mail_handler.c +++ b/src/mail/ngx_mail_handler.c @@ -297,19 +297,19 @@ ngx_mail_init_session(ngx_connection_t * - s->salt.data; if (s->protocol == NGX_MAIL_POP3_PROTOCOL) { - s->out.data = ngx_palloc(c->pool, + s->out.data = ngx_palloc(c->pool, greetings[0].len + 1 + s->salt.len); - if (s->out.data == NULL) { - ngx_mail_session_internal_server_error(s); - return; - } + if (s->out.data == NULL) { + ngx_mail_session_internal_server_error(s); + return; + } - p = ngx_cpymem(s->out.data, + p = ngx_cpymem(s->out.data, greetings[0].data, greetings[0].len - 2); - *p++ = ' '; - p = ngx_cpymem(p, s->salt.data, s->salt.len); + *p++ = ' '; + p = ngx_cpymem(p, s->salt.data, s->salt.len); - s->out.len = p - s->out.data; + s->out.len = p - s->out.data; } } @@ -1408,31 +1408,31 @@ ngx_smtp_auth_state(ngx_event_t *rev) case NGX_SMTP_MAIL: if (s->connection->log->log_level >= NGX_LOG_INFO) { - l.len = s->buffer->last - s->buffer->start; - l.data = s->buffer->start; + l.len = s->buffer->last - s->buffer->start; + l.data = s->buffer->start; - for (i = 0; i < l.len; i++) { - ch = l.data[i]; + for (i = 0; i < l.len; i++) { + ch = l.data[i]; - if (ch != CR && ch != LF) { - continue; - } + if (ch != CR && ch != LF) { + continue; + } - l.data[i] = ' '; - } + l.data[i] = ' '; + } - while (i) { - if (l.data[i - 1] != ' ') { - break; - } + while (i) { + if (l.data[i - 1] != ' ') { + break; + } - i--; - } + i--; + } - l.len = i; + l.len = i; - ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, - "client was rejected: \"%V\"", &l); + ngx_log_error(NGX_LOG_INFO, s->connection->log, 0, + "client was rejected: \"%V\"", &l); } text = smtp_auth_required; diff --git a/src/mail/ngx_mail_proxy_module.c b/src/mail/ngx_mail_proxy_module.c --- a/src/mail/ngx_mail_proxy_module.c +++ b/src/mail/ngx_mail_proxy_module.c @@ -702,20 +702,20 @@ ngx_mail_proxy_read_response(ngx_mail_se case ngx_smtp_helo: case ngx_smtp_noxclient: - if (p[0] == '2' && p[1] == '5' && p[2] == '0') { - return NGX_OK; - } - break; + if (p[0] == '2' && p[1] == '5' && p[2] == '0') { + return NGX_OK; + } + break; case ngx_smtp_start: case ngx_smtp_xclient: - if (p[0] == '2' && p[1] == '2' && p[2] == '0') { - return NGX_OK; - } - break; + if (p[0] == '2' && p[1] == '2' && p[2] == '0') { + return NGX_OK; + } + break; } - break; + break; } pcf = ngx_mail_get_module_srv_conf(s, ngx_mail_proxy_module);