nxt_ruby.c (1320:4e70411b9842) nxt_ruby.c (1337:2200adad4885)
1/*
2 * Copyright (C) Alexander Borisov
3 * Copyright (C) NGINX, Inc.
4 */
5
6#include <ruby/nxt_ruby.h>
7
8#include <nxt_unit.h>

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

47nxt_inline void nxt_ruby_add_str(VALUE hash_env,
48 const char *name, uint32_t name_len, const char *str, uint32_t len);
49static nxt_int_t nxt_ruby_rack_result_status(VALUE result);
50static int nxt_ruby_rack_result_headers(VALUE result, nxt_int_t status);
51static int nxt_ruby_hash_info(VALUE r_key, VALUE r_value, VALUE arg);
52static int nxt_ruby_hash_add(VALUE r_key, VALUE r_value, VALUE arg);
53static int nxt_ruby_rack_result_body(VALUE result);
54static int nxt_ruby_rack_result_body_file_write(VALUE filepath);
1/*
2 * Copyright (C) Alexander Borisov
3 * Copyright (C) NGINX, Inc.
4 */
5
6#include <ruby/nxt_ruby.h>
7
8#include <nxt_unit.h>

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

47nxt_inline void nxt_ruby_add_str(VALUE hash_env,
48 const char *name, uint32_t name_len, const char *str, uint32_t len);
49static nxt_int_t nxt_ruby_rack_result_status(VALUE result);
50static int nxt_ruby_rack_result_headers(VALUE result, nxt_int_t status);
51static int nxt_ruby_hash_info(VALUE r_key, VALUE r_value, VALUE arg);
52static int nxt_ruby_hash_add(VALUE r_key, VALUE r_value, VALUE arg);
53static int nxt_ruby_rack_result_body(VALUE result);
54static int nxt_ruby_rack_result_body_file_write(VALUE filepath);
55static VALUE nxt_ruby_rack_result_body_each(VALUE body);
55static VALUE nxt_ruby_rack_result_body_each(VALUE body, VALUE arg,
56 int argc, const VALUE *argv, VALUE blockarg);
56
57static void nxt_ruby_exception_log(nxt_task_t *task, uint32_t level,
58 const char *desc);
59
60static void nxt_ruby_atexit(void);
61
62
63static uint32_t compat[] = {

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

808
809 close(fd);
810
811 return rc;
812}
813
814
815static VALUE
57
58static void nxt_ruby_exception_log(nxt_task_t *task, uint32_t level,
59 const char *desc);
60
61static void nxt_ruby_atexit(void);
62
63
64static uint32_t compat[] = {

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

809
810 close(fd);
811
812 return rc;
813}
814
815
816static VALUE
816nxt_ruby_rack_result_body_each(VALUE body)
817nxt_ruby_rack_result_body_each(VALUE body, VALUE arg, int argc,
818 const VALUE *argv, VALUE blockarg)
817{
818 int rc;
819
820 if (TYPE(body) != T_STRING) {
821 return Qnil;
822 }
823
824 rc = nxt_unit_response_write(nxt_ruby_run_ctx.req, RSTRING_PTR(body),

--- 71 unchanged lines hidden ---
819{
820 int rc;
821
822 if (TYPE(body) != T_STRING) {
823 return Qnil;
824 }
825
826 rc = nxt_unit_response_write(nxt_ruby_run_ctx.req, RSTRING_PTR(body),

--- 71 unchanged lines hidden ---