Deleted Added
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

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

41
42 sb.buf = b;
43 sb.iobuf = hd;
44 sb.nmax = NXT_IOBUF_MAX;
45 sb.sync = 0;
46 sb.size = 0;
47 sb.limit = limit;
48
49 nhd = nxt_sendbuf_mem_coalesce(c->socket.task, &sb);
50
51 if (nhd == 0 && sb.sync) {
52 return 0;
53 }
54
55 if (sb.buf == NULL || !nxt_buf_is_file(sb.buf)) {
56 return nxt_event_conn_io_writev(c, hd, nhd);
57 }

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

62 file_size = nxt_sendbuf_file_coalesce(&sb);
63
64 if (file_size == 0) {
65 return nxt_event_conn_io_writev(c, hd, nhd);
66 }
67
68 sb.iobuf = tr;
69
70 ntr = nxt_sendbuf_mem_coalesce(c->socket.task, &sb);
71
72 /*
73 * Disposal of surplus kernel operations if there are no headers
74 * and trailers. Besides sendfile() returns EINVAL if a sf_hdtr's
75 * count is 0, but corresponding pointer is not NULL.
76 */
77
78 nxt_memzero(&hdtr, sizeof(struct sf_hdtr));

--- 315 unchanged lines hidden ---