Permalink
Browse files

fixed code lines longer than 80 cols; also updated the build script f…

…or developers.
  • Loading branch information...
agentzh committed Jun 12, 2011
1 parent aa92c54 commit 376db1ffa2f28f0524e35513fb68b613cbe113c8
View
@@ -67,3 +67,4 @@ misc/
t/servroot/
all
build10
+buildroot/
@@ -338,7 +338,8 @@ ngx_http_rds_json_merge_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_str_value(conf->content_type, prev->content_type,
ngx_http_rds_json_content_type);
- ngx_conf_merge_size_value(conf->buf_size, prev->buf_size, (size_t) ngx_pagesize);
+ ngx_conf_merge_size_value(conf->buf_size, prev->buf_size,
+ (size_t) ngx_pagesize);
return NGX_CONF_OK;
}
@@ -99,7 +99,8 @@ ngx_http_rds_json_output_bufs(ngx_http_request_t *r,
return rc;
}
- ngx_chain_update_chains(&ctx->free_bufs, &ctx->busy_bufs, &ctx->out, ctx->tag);
+ ngx_chain_update_chains(&ctx->free_bufs, &ctx->busy_bufs, &ctx->out,
+ ctx->tag);
ctx->last_out = &ctx->out;
}
@@ -347,7 +348,8 @@ ngx_http_rds_json_output_field(ngx_http_request_t *r,
if (len == 0 && ctx->field_data_rest > 0) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "rds_json: at least one octet should go with the field size in one buf");
+ "rds_json: at least one octet should go with the field size "
+ "in one buf");
return NGX_ERROR;
}
@@ -668,7 +670,8 @@ ngx_http_rds_json_output_more_field_data(ngx_http_request_t *r,
last = ngx_copy(last, data, len);
} else {
- dd("more field data: string value escape non-zero: %d", (int) escape);
+ dd("more field data: string value escape non-zero: %d",
+ (int) escape);
#if DDEBUG
p = last;
@@ -62,7 +62,9 @@ ngx_http_rds_json_process_header(ngx_http_request_t *r,
if (b->pos != b->last) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "rds_json: header: there's unexpected remaining data in the buf");
+ "rds_json: header: there's unexpected remaining data "
+ "in the buf");
+
goto invalid;
}
@@ -271,7 +273,8 @@ ngx_http_rds_json_process_row(ngx_http_request_t *r,
if (b->pos != b->last) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "rds_json: row: there's unexpected remaining data in the buf");
+ "rds_json: row: there's unexpected remaining data "
+ "in the buf");
return NGX_ERROR;
}
@@ -337,8 +340,8 @@ ngx_http_rds_json_process_field(ngx_http_request_t *r,
if (b->last - b->pos < (ssize_t) sizeof(uint32_t)) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "rds_json: field size is incomplete in the buf: %*s (len: %d)",
- b->last - b->pos, b->pos,
+ "rds_json: field size is incomplete in the buf: %*s "
+ "(len: %d)", b->last - b->pos, b->pos,
(int) (b->last - b->pos));
return NGX_ERROR;
@@ -356,7 +359,9 @@ ngx_http_rds_json_process_field(ngx_http_request_t *r,
len = 0;
ctx->field_data_rest = 0;
- rc = ngx_http_rds_json_output_field(r, ctx, b->pos, len, 1 /* is null */);
+ rc = ngx_http_rds_json_output_field(r, ctx, b->pos, len,
+ 1 /* is null */);
+
} else {
len = (uint32_t) (b->last - b->pos);
@@ -366,7 +371,8 @@ ngx_http_rds_json_process_field(ngx_http_request_t *r,
ctx->field_data_rest = total - len;
- rc = ngx_http_rds_json_output_field(r, ctx, b->pos, len, 0 /* not null */);
+ rc = ngx_http_rds_json_output_field(r, ctx, b->pos, len,
+ 0 /* not null */);
}
if (rc == NGX_ERROR || rc >= NGX_HTTP_SPECIAL_RESPONSE) {
@@ -18,7 +18,8 @@
-uintptr_t ngx_http_rds_json_escape_json_str(u_char *dst, u_char *src, size_t size);
+uintptr_t ngx_http_rds_json_escape_json_str(u_char *dst, u_char *src,
+ size_t size);
ngx_int_t ngx_http_rds_json_test_content_type(ngx_http_request_t *r);
View
@@ -190,7 +190,8 @@ ngx_http_rds_parse_col(ngx_http_request_t *r, ngx_buf_t *b,
ngx_memcpy(col->name.data, b->pos, col->name.len);
b->pos += col->name.len;
- dd("saved column name \"%.*s\" (len %d, offset %d)", (int) col->name.len, col->name.data,
+ dd("saved column name \"%.*s\" (len %d, offset %d)",
+ (int) col->name.len, col->name.data,
(int) col->name.len, (int) (b->pos - b->start));
return NGX_OK;
View
@@ -3,7 +3,7 @@
use lib 'lib';
use Test::Nginx::Socket;
-repeat_each(100);
+repeat_each(3);
plan tests => repeat_each() * 3 * blocks();
View
@@ -6,30 +6,34 @@ root=`pwd`
version=$1
home=~
#opts=$2
+target=$root/work/nginx
-cd ~/work
+if [ ! -d ./buildroot ]; then
+ mkdir ./buildroot || exit 1
+fi
+
+cd buildroot || exit 1
if [ ! -s "nginx-$version.tar.gz" ]; then
- wget "http://sysoev.ru/nginx/nginx-$version.tar.gz" -O nginx-$version.tar.gz || exit 1
- tar -xzvf nginx-$version.tar.gz || exit 1
- if [ "$version" = "0.8.41" ]; then
- cp $root/../no-pool-nginx/nginx-$version-no_pool.patch ./
- patch -p0 < nginx-$version-no_pool.patch || exit 1
+ if [ -f ~/work/nginx-$version.tar.gz ]; then
+ cp ~/work/nginx-$version.tar.gz ./ || exit 1
+ else
+ wget "http://sysoev.ru/nginx/nginx-$version.tar.gz" -O nginx-$version.tar.gz || exit 1
fi
+
+ tar -xzvf nginx-$version.tar.gz || exit 1
+ cp $root/../no-pool-nginx/nginx-$version-no_pool.patch ./ || exit 1
+ patch -p0 < nginx-$version-no_pool.patch || exit 1
fi
#tar -xzvf nginx-$version.tar.gz || exit 1
-#cp $root/../no-pool-nginx/nginx-0.8.41-no_pool.patch ./
-#patch -p0 < nginx-0.8.41-no_pool.patch
+#cp $root/../no-pool-nginx/nginx-$version-no_pool.patch ./ || exit 1
+#patch -p0 < nginx-$version-no_pool.patch || exit 1
-if [ -n "$2" ]; then
- cd nginx-$version-$2/
-else
- cd nginx-$version/
-fi
+cd nginx-$version/ || exit 1
if [[ "$BUILD_CLEAN" -eq 1 || ! -f Makefile || "$root/config" -nt Makefile || "$root/util/build.sh" -nt Makefile ]]; then
- ./configure --prefix=/opt/nginx \
+ ./configure --prefix=$target \
--with-cc-opt="-O1" \
--without-mail_pop3_module \
--without-mail_imap_module \
@@ -65,11 +69,11 @@ if [[ "$BUILD_CLEAN" -eq 1 || ! -f Makefile || "$root/config" -nt Makefile || "$
fi
fi
-if [ -f /opt/nginx/sbin/nginx ]; then
- rm -f /opt/nginx/sbin/nginx
+if [ -f $target/sbin/nginx ]; then
+ rm -f $target/sbin/nginx
fi
-if [ -f /opt/nginx/logs/nginx.pid ]; then
- kill `cat /opt/nginx/logs/nginx.pid`
+if [ -f $target/logs/nginx.pid ]; then
+ kill `cat $target/logs/nginx.pid`
fi
make -j3
make install

0 comments on commit 376db1f

Please sign in to comment.