nxt_perl_psgi.c (673:9fa79c719a17) nxt_perl_psgi.c (703:2d536dde84d2)
1
2/*
3 * Copyright (C) Alexander Borisov
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <perl/nxt_perl_psgi_layer.h>
8

--- 144 unchanged lines hidden (view full) ---

153 do { \
154 rc = nxt_perl_psgi_write(task, wmsg, DATA, \
155 DATALEN, FLUSH, 0); \
156 if (nxt_slow_path(rc != NXT_OK)) \
157 return rc; \
158 \
159 } while (0)
160
1
2/*
3 * Copyright (C) Alexander Borisov
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <perl/nxt_perl_psgi_layer.h>
8

--- 144 unchanged lines hidden (view full) ---

153 do { \
154 rc = nxt_perl_psgi_write(task, wmsg, DATA, \
155 DATALEN, FLUSH, 0); \
156 if (nxt_slow_path(rc != NXT_OK)) \
157 return rc; \
158 \
159 } while (0)
160
161 RC_WRT((const u_char *) "Status: ", (sizeof("Status: ") - 1), 0);
161 RC_WRT((const u_char *) "Status: ", nxt_length("Status: "), 0);
162 RC_WRT(http_status->start, http_status->length, 0);
162 RC_WRT(http_status->start, http_status->length, 0);
163 RC_WRT((u_char *) "\r\n", (sizeof("\r\n") - 1), 0);
163 RC_WRT((u_char *) "\r\n", nxt_length("\r\n"), 0);
164
165#undef RC_WRT
166
167 return rc;
168}
169
170
171static long

--- 622 unchanged lines hidden (view full) ---

794 nxt_log_error(NXT_LOG_ERR, task->log,
795 "PSGI: Failed to write head "
796 "from Perl Application");
797 return rc;
798 }
799
800 if ((i % 2) == 0) {
801 rc = nxt_app_msg_write_raw(task, wmsg,
164
165#undef RC_WRT
166
167 return rc;
168}
169
170
171static long

--- 622 unchanged lines hidden (view full) ---

794 nxt_log_error(NXT_LOG_ERR, task->log,
795 "PSGI: Failed to write head "
796 "from Perl Application");
797 return rc;
798 }
799
800 if ((i % 2) == 0) {
801 rc = nxt_app_msg_write_raw(task, wmsg,
802 (u_char *) ": ",
803 (sizeof(": ") - 1));
802 (u_char *) ": ", nxt_length(": "));
804 } else {
805 rc = nxt_app_msg_write_raw(task, wmsg,
803 } else {
804 rc = nxt_app_msg_write_raw(task, wmsg,
806 (u_char *) "\r\n",
807 (sizeof("\r\n") - 1));
805 (u_char *) "\r\n", nxt_length("\r\n"));
808 }
809
810 if (nxt_slow_path(rc != NXT_OK)) {
811 nxt_log_error(NXT_LOG_ERR, task->log,
812 "PSGI: Failed to write head from "
813 "Perl Application");
814 return rc;
815 }

--- 152 unchanged lines hidden (view full) ---

968 if (nxt_slow_path(rc != NXT_OK)) {
969 nxt_log_error(NXT_LOG_ERR, task->log,
970 "PSGI: Failed to write HTTP Status");
971
972 return rc;
973 }
974
975 if (array_len < 1) {
806 }
807
808 if (nxt_slow_path(rc != NXT_OK)) {
809 nxt_log_error(NXT_LOG_ERR, task->log,
810 "PSGI: Failed to write head from "
811 "Perl Application");
812 return rc;
813 }

--- 152 unchanged lines hidden (view full) ---

966 if (nxt_slow_path(rc != NXT_OK)) {
967 nxt_log_error(NXT_LOG_ERR, task->log,
968 "PSGI: Failed to write HTTP Status");
969
970 return rc;
971 }
972
973 if (array_len < 1) {
976 rc = nxt_app_msg_write_raw(task, wmsg, (u_char *) "\r\n",
977 (sizeof("\r\n") - 1));
974 rc = nxt_app_msg_write_raw(task, wmsg,
975 (u_char *) "\r\n", nxt_length("\r\n"));
978
979 if (nxt_slow_path(rc != NXT_OK)) {
980 nxt_log_error(NXT_LOG_ERR, task->log,
981 "PSGI: Failed to write HTTP Headers");
982
983 return rc;
984 }
985

--- 10 unchanged lines hidden (view full) ---

996 }
997
998 rc = nxt_perl_psgi_result_head(nxt_perl_psgi, *sv_temp, task, wmsg);
999
1000 if (nxt_slow_path(rc != NXT_OK)) {
1001 return rc;
1002 }
1003
976
977 if (nxt_slow_path(rc != NXT_OK)) {
978 nxt_log_error(NXT_LOG_ERR, task->log,
979 "PSGI: Failed to write HTTP Headers");
980
981 return rc;
982 }
983

--- 10 unchanged lines hidden (view full) ---

994 }
995
996 rc = nxt_perl_psgi_result_head(nxt_perl_psgi, *sv_temp, task, wmsg);
997
998 if (nxt_slow_path(rc != NXT_OK)) {
999 return rc;
1000 }
1001
1004 rc = nxt_app_msg_write_raw(task, wmsg, (u_char *) "\r\n",
1005 (sizeof("\r\n") - 1));
1002 rc = nxt_app_msg_write_raw(task, wmsg,
1003 (u_char *) "\r\n", nxt_length("\r\n"));
1006
1007 if (nxt_slow_path(rc != NXT_OK)) {
1008 nxt_log_error(NXT_LOG_ERR, task->log,
1009 "PSGI: Failed to write HTTP Headers");
1010
1011 return rc;
1012 }
1013

--- 137 unchanged lines hidden ---
1004
1005 if (nxt_slow_path(rc != NXT_OK)) {
1006 nxt_log_error(NXT_LOG_ERR, task->log,
1007 "PSGI: Failed to write HTTP Headers");
1008
1009 return rc;
1010 }
1011

--- 137 unchanged lines hidden ---