Skip to content

Commit 4b7ff9b

Browse files
committed
style: fixed coding style issues found by ngx-releng.
1 parent 2041d23 commit 4b7ff9b

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

src/ngx_http_redis2_handler.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ ngx_http_redis2_handler(ngx_http_request_t *r)
4444
/* variables used in the redis2_pass directive */
4545

4646
if (ngx_http_complex_value(r, rlcf->complex_target, &target)
47-
!= NGX_OK)
47+
!= NGX_OK)
4848
{
4949
return NGX_ERROR;
5050
}
5151

5252
if (target.len == 0) {
5353
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
54-
"handler: empty \"redis2_pass\" target");
54+
"handler: empty \"redis2_pass\" target");
5555
return NGX_HTTP_INTERNAL_SERVER_ERROR;
5656
}
5757

@@ -63,7 +63,7 @@ ngx_http_redis2_handler(ngx_http_request_t *r)
6363

6464
if (rlcf->upstream.upstream == NULL) {
6565
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
66-
"redis2: upstream \"%V\" not found", &target);
66+
"redis2: upstream \"%V\" not found", &target);
6767

6868
return NGX_HTTP_INTERNAL_SERVER_ERROR;
6969
}
@@ -131,20 +131,20 @@ ngx_http_redis2_create_request(ngx_http_request_t *r)
131131
} else if (rlcf->literal_query.len == 0) {
132132
if (rlcf->complex_query == NULL) {
133133
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
134-
"no redis2 query specified or the query is empty");
134+
"no redis2 query specified or the query is empty");
135135

136136
return NGX_ERROR;
137137
}
138138

139139
if (ngx_http_complex_value(r, rlcf->complex_query, &query)
140-
!= NGX_OK)
140+
!= NGX_OK)
141141
{
142142
return NGX_ERROR;
143143
}
144144

145145
if (query.len == 0) {
146146
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
147-
"the redis query is empty");
147+
"the redis query is empty");
148148

149149
return NGX_ERROR;
150150
}
@@ -154,22 +154,24 @@ ngx_http_redis2_create_request(ngx_http_request_t *r)
154154

155155
} else {
156156
if (ngx_http_complex_value(r, rlcf->complex_query_count,
157-
&query_count) != NGX_OK)
157+
&query_count)
158+
!= NGX_OK)
158159
{
159160
return NGX_ERROR;
160161
}
161162

162163
if (query_count.len == 0) {
163164
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
164-
"the N argument to redis2_raw_queries is empty");
165+
"the N argument to redis2_raw_queries is empty");
165166

166167
return NGX_ERROR;
167168
}
168169

169170
n = ngx_atoi(query_count.data, query_count.len);
170171
if (n == NGX_ERROR || n == 0) {
171172
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
172-
"the N argument to redis2_raw_queries is invalid");
173+
"the N argument to redis2_raw_queries is "
174+
"invalid");
173175

174176
return NGX_ERROR;
175177
}

src/ngx_http_redis2_module.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,10 @@ ngx_http_redis2_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
211211
(size_t) ngx_pagesize);
212212

213213
ngx_conf_merge_bitmask_value(conf->upstream.next_upstream,
214-
prev->upstream.next_upstream,
215-
(NGX_CONF_BITMASK_SET
216-
|NGX_HTTP_UPSTREAM_FT_ERROR
217-
|NGX_HTTP_UPSTREAM_FT_TIMEOUT));
214+
prev->upstream.next_upstream,
215+
(NGX_CONF_BITMASK_SET
216+
|NGX_HTTP_UPSTREAM_FT_ERROR
217+
|NGX_HTTP_UPSTREAM_FT_TIMEOUT));
218218

219219
if (conf->upstream.next_upstream & NGX_HTTP_UPSTREAM_FT_OFF) {
220220
conf->upstream.next_upstream = NGX_CONF_BITMASK_SET
@@ -395,7 +395,7 @@ ngx_http_redis2_raw_queries(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
395395
/* compile the N argument */
396396

397397
rlcf->complex_query_count = ngx_palloc(cf->pool,
398-
sizeof(ngx_http_complex_value_t));
398+
sizeof(ngx_http_complex_value_t));
399399

400400
if (rlcf->complex_query_count == NULL) {
401401
return NGX_CONF_ERROR;
@@ -413,7 +413,7 @@ ngx_http_redis2_raw_queries(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
413413
/* compile the CMDS argument */
414414

415415
rlcf->complex_query = ngx_palloc(cf->pool,
416-
sizeof(ngx_http_complex_value_t));
416+
sizeof(ngx_http_complex_value_t));
417417

418418
if (rlcf->complex_query == NULL) {
419419
return NGX_CONF_ERROR;

src/ngx_http_redis2_util.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ ngx_http_redis2_upstream_add(ngx_http_request_t *r, ngx_url_t *url)
6565

6666
if (uscfp[i]->host.len != url->host.len
6767
|| ngx_strncasecmp(uscfp[i]->host.data, url->host.data,
68-
url->host.len) != 0)
68+
url->host.len) != 0)
6969
{
7070
dd("upstream_add: host not match");
7171
continue;
7272
}
7373

7474
if (uscfp[i]->port != url->port) {
7575
dd("upstream_add: port not match: %d != %d",
76-
(int) uscfp[i]->port, (int) url->port);
76+
(int) uscfp[i]->port, (int) url->port);
7777
continue;
7878
}
7979

@@ -203,8 +203,8 @@ ngx_http_redis2_build_query(ngx_http_request_t *r, ngx_array_t *queries,
203203

204204
if (p - (*b)->pos != (ssize_t) len) {
205205
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
206-
"redis2: redis2_query buffer error %uz != %uz",
207-
(size_t) (p - (*b)->pos), len);
206+
"redis2: redis2_query buffer error %uz != %uz",
207+
(size_t) (p - (*b)->pos), len);
208208

209209
return NGX_ERROR;
210210
}

0 commit comments

Comments
 (0)