summaryrefslogtreecommitdiffhomepage
path: root/src/ruby/nxt_ruby.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2018-06-25 16:51:47 +0300
committerValentin Bartenev <vbart@nginx.com>2018-06-25 16:51:47 +0300
commit1a52d876f7e10d07f58deee6faeaf70a11a6110f (patch)
treef69ba903180b3deac3bba2ee7acda9d34f18d73c /src/ruby/nxt_ruby.c
parentaf31012815e20f0c92ed6ea803638a16ba47b0c2 (diff)
downloadunit-1a52d876f7e10d07f58deee6faeaf70a11a6110f.tar.gz
unit-1a52d876f7e10d07f58deee6faeaf70a11a6110f.tar.bz2
Introduced nxt_length() macro.
Diffstat (limited to 'src/ruby/nxt_ruby.c')
-rw-r--r--src/ruby/nxt_ruby.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ruby/nxt_ruby.c b/src/ruby/nxt_ruby.c
index 230c5b98..e9fa01c8 100644
--- a/src/ruby/nxt_ruby.c
+++ b/src/ruby/nxt_ruby.c
@@ -581,7 +581,7 @@ nxt_ruby_rack_result_status(VALUE result)
}
rc = nxt_ruby_write(nxt_ruby_run_ctx.task, nxt_ruby_run_ctx.wmsg,
- (u_char *) "Status: ", (sizeof("Status: ") - 1), 0, 0);
+ (u_char *) "Status: ", nxt_length("Status: "), 0, 0);
if (nxt_slow_path(rc != NXT_OK)) {
return NXT_ERROR;
}
@@ -593,7 +593,7 @@ nxt_ruby_rack_result_status(VALUE result)
}
rc = nxt_ruby_write(nxt_ruby_run_ctx.task, nxt_ruby_run_ctx.wmsg,
- (u_char *) "\r\n", (sizeof("\r\n") - 1), 0, 0);
+ (u_char *) "\r\n", nxt_length("\r\n"), 0, 0);
if (nxt_slow_path(rc != NXT_OK)) {
return NXT_ERROR;
}
@@ -643,7 +643,7 @@ nxt_ruby_rack_result_headers(VALUE result)
}
rc = nxt_ruby_write(nxt_ruby_run_ctx.task, nxt_ruby_run_ctx.wmsg,
- (u_char *) "\r\n", (sizeof("\r\n") - 1), 0, 0);
+ (u_char *) "\r\n", nxt_length("\r\n"), 0, 0);
if (nxt_slow_path(rc != NXT_OK)) {
return NXT_ERROR;
}
@@ -729,7 +729,7 @@ nxt_ruby_head_send_part(const char *key, size_t key_size,
}
rc = nxt_app_msg_write_raw(nxt_ruby_run_ctx.task, nxt_ruby_run_ctx.wmsg,
- (u_char *) ": ", (sizeof(": ") - 1));
+ (u_char *) ": ", nxt_length(": "));
if (nxt_slow_path(rc != NXT_OK)) {
return rc;
}
@@ -741,7 +741,7 @@ nxt_ruby_head_send_part(const char *key, size_t key_size,
}
return nxt_app_msg_write_raw(nxt_ruby_run_ctx.task, nxt_ruby_run_ctx.wmsg,
- (u_char *) "\r\n", (sizeof("\r\n") - 1));
+ (u_char *) "\r\n", nxt_length("\r\n"));
}