summaryrefslogtreecommitdiffhomepage
path: root/src/perl
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/perl
parentaf31012815e20f0c92ed6ea803638a16ba47b0c2 (diff)
downloadunit-1a52d876f7e10d07f58deee6faeaf70a11a6110f.tar.gz
unit-1a52d876f7e10d07f58deee6faeaf70a11a6110f.tar.bz2
Introduced nxt_length() macro.
Diffstat (limited to 'src/perl')
-rw-r--r--src/perl/nxt_perl_psgi.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/perl/nxt_perl_psgi.c b/src/perl/nxt_perl_psgi.c
index 16bcf79f..3619dcd0 100644
--- a/src/perl/nxt_perl_psgi.c
+++ b/src/perl/nxt_perl_psgi.c
@@ -158,9 +158,9 @@ nxt_perl_psgi_http_write_status_str(nxt_task_t *task, nxt_app_wmsg_t *wmsg,
\
} while (0)
- RC_WRT((const u_char *) "Status: ", (sizeof("Status: ") - 1), 0);
+ RC_WRT((const u_char *) "Status: ", nxt_length("Status: "), 0);
RC_WRT(http_status->start, http_status->length, 0);
- RC_WRT((u_char *) "\r\n", (sizeof("\r\n") - 1), 0);
+ RC_WRT((u_char *) "\r\n", nxt_length("\r\n"), 0);
#undef RC_WRT
@@ -799,12 +799,10 @@ nxt_perl_psgi_result_head(PerlInterpreter *my_perl, SV *sv_head,
if ((i % 2) == 0) {
rc = nxt_app_msg_write_raw(task, wmsg,
- (u_char *) ": ",
- (sizeof(": ") - 1));
+ (u_char *) ": ", nxt_length(": "));
} else {
rc = nxt_app_msg_write_raw(task, wmsg,
- (u_char *) "\r\n",
- (sizeof("\r\n") - 1));
+ (u_char *) "\r\n", nxt_length("\r\n"));
}
if (nxt_slow_path(rc != NXT_OK)) {
@@ -973,8 +971,8 @@ nxt_perl_psgi_result_array(PerlInterpreter *my_perl, SV *result,
}
if (array_len < 1) {
- rc = nxt_app_msg_write_raw(task, wmsg, (u_char *) "\r\n",
- (sizeof("\r\n") - 1));
+ rc = nxt_app_msg_write_raw(task, wmsg,
+ (u_char *) "\r\n", nxt_length("\r\n"));
if (nxt_slow_path(rc != NXT_OK)) {
nxt_log_error(NXT_LOG_ERR, task->log,
@@ -1001,8 +999,8 @@ nxt_perl_psgi_result_array(PerlInterpreter *my_perl, SV *result,
return rc;
}
- rc = nxt_app_msg_write_raw(task, wmsg, (u_char *) "\r\n",
- (sizeof("\r\n") - 1));
+ rc = nxt_app_msg_write_raw(task, wmsg,
+ (u_char *) "\r\n", nxt_length("\r\n"));
if (nxt_slow_path(rc != NXT_OK)) {
nxt_log_error(NXT_LOG_ERR, task->log,