nxt_sendbuf.h (42:def41906e4a5) nxt_sendbuf.h (62:5e1efcc7b740)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#ifndef _NXT_SENDBUF_H_INCLUDED_
8#define _NXT_SENDBUF_H_INCLUDED_

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

61
62 size_t size;
63 size_t limit;
64} nxt_sendbuf_coalesce_t;
65
66
67#if (NXT_HAVE_LINUX_SENDFILE)
68#define NXT_HAVE_SENDFILE 1
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#ifndef _NXT_SENDBUF_H_INCLUDED_
8#define _NXT_SENDBUF_H_INCLUDED_

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

61
62 size_t size;
63 size_t limit;
64} nxt_sendbuf_coalesce_t;
65
66
67#if (NXT_HAVE_LINUX_SENDFILE)
68#define NXT_HAVE_SENDFILE 1
69ssize_t nxt_linux_event_conn_io_sendfile(nxt_event_conn_t *c, nxt_buf_t *b,
69ssize_t nxt_linux_event_conn_io_sendfile(nxt_conn_t *c, nxt_buf_t *b,
70 size_t limit);
71#endif
72
73#if (NXT_HAVE_FREEBSD_SENDFILE)
74#define NXT_HAVE_SENDFILE 1
70 size_t limit);
71#endif
72
73#if (NXT_HAVE_FREEBSD_SENDFILE)
74#define NXT_HAVE_SENDFILE 1
75ssize_t nxt_freebsd_event_conn_io_sendfile(nxt_event_conn_t *c, nxt_buf_t *b,
75ssize_t nxt_freebsd_event_conn_io_sendfile(nxt_conn_t *c, nxt_buf_t *b,
76 size_t limit);
77#endif
78
79#if (NXT_HAVE_SOLARIS_SENDFILEV)
80#define NXT_HAVE_SENDFILE 1
76 size_t limit);
77#endif
78
79#if (NXT_HAVE_SOLARIS_SENDFILEV)
80#define NXT_HAVE_SENDFILE 1
81ssize_t nxt_solaris_event_conn_io_sendfilev(nxt_event_conn_t *c, nxt_buf_t *b,
81ssize_t nxt_solaris_event_conn_io_sendfilev(nxt_conn_t *c, nxt_buf_t *b,
82 size_t limit);
83#endif
84
85#if (NXT_HAVE_MACOSX_SENDFILE)
86#define NXT_HAVE_SENDFILE 1
82 size_t limit);
83#endif
84
85#if (NXT_HAVE_MACOSX_SENDFILE)
86#define NXT_HAVE_SENDFILE 1
87ssize_t nxt_macosx_event_conn_io_sendfile(nxt_event_conn_t *c, nxt_buf_t *b,
87ssize_t nxt_macosx_event_conn_io_sendfile(nxt_conn_t *c, nxt_buf_t *b,
88 size_t limit);
89#endif
90
91#if (NXT_HAVE_AIX_SEND_FILE)
92#define NXT_HAVE_SENDFILE 1
88 size_t limit);
89#endif
90
91#if (NXT_HAVE_AIX_SEND_FILE)
92#define NXT_HAVE_SENDFILE 1
93ssize_t nxt_aix_event_conn_io_send_file(nxt_event_conn_t *c, nxt_buf_t *b,
93ssize_t nxt_aix_event_conn_io_send_file(nxt_conn_t *c, nxt_buf_t *b,
94 size_t limit);
95#endif
96
97#if (NXT_HAVE_HPUX_SENDFILE)
98#define NXT_HAVE_SENDFILE 1
94 size_t limit);
95#endif
96
97#if (NXT_HAVE_HPUX_SENDFILE)
98#define NXT_HAVE_SENDFILE 1
99ssize_t nxt_hpux_event_conn_io_sendfile(nxt_event_conn_t *c, nxt_buf_t *b,
99ssize_t nxt_hpux_event_conn_io_sendfile(nxt_conn_t *c, nxt_buf_t *b,
100 size_t limit);
101#endif
102
100 size_t limit);
101#endif
102
103ssize_t nxt_event_conn_io_sendbuf(nxt_event_conn_t *c, nxt_buf_t *b,
103ssize_t nxt_event_conn_io_sendbuf(nxt_conn_t *c, nxt_buf_t *b,
104 size_t limit);
105
106
107nxt_uint_t nxt_sendbuf_mem_coalesce0(nxt_task_t *task, nxt_sendbuf_t *sb,
108 struct iovec *iov, nxt_uint_t niov_max);
109nxt_uint_t nxt_sendbuf_mem_coalesce(nxt_task_t *task,
110 nxt_sendbuf_coalesce_t *sb);
111size_t nxt_sendbuf_file_coalesce(nxt_sendbuf_coalesce_t *sb);
112
113/*
114 * Auxiliary nxt_sendbuf_copy_coalesce() interface copies small memory
115 * buffers into internal buffer before output. It is intended for
116 * SSL/TLS libraries which lack vector I/O interface yet add noticeable
117 * overhead to each SSL/TLS record.
118 */
104 size_t limit);
105
106
107nxt_uint_t nxt_sendbuf_mem_coalesce0(nxt_task_t *task, nxt_sendbuf_t *sb,
108 struct iovec *iov, nxt_uint_t niov_max);
109nxt_uint_t nxt_sendbuf_mem_coalesce(nxt_task_t *task,
110 nxt_sendbuf_coalesce_t *sb);
111size_t nxt_sendbuf_file_coalesce(nxt_sendbuf_coalesce_t *sb);
112
113/*
114 * Auxiliary nxt_sendbuf_copy_coalesce() interface copies small memory
115 * buffers into internal buffer before output. It is intended for
116 * SSL/TLS libraries which lack vector I/O interface yet add noticeable
117 * overhead to each SSL/TLS record.
118 */
119ssize_t nxt_sendbuf_copy_coalesce(nxt_event_conn_t *c, nxt_buf_mem_t *bm,
119ssize_t nxt_sendbuf_copy_coalesce(nxt_conn_t *c, nxt_buf_mem_t *bm,
120 nxt_buf_t *b, size_t limit);
121
122nxt_buf_t *nxt_sendbuf_update(nxt_buf_t *b, size_t sent);
123nxt_buf_t *nxt_sendbuf_completion(nxt_task_t *task, nxt_work_queue_t *wq,
124 nxt_buf_t *b, size_t sent);
125
126
127#endif /* _NXT_SENDBUF_H_INCLUDED_ */
120 nxt_buf_t *b, size_t limit);
121
122nxt_buf_t *nxt_sendbuf_update(nxt_buf_t *b, size_t sent);
123nxt_buf_t *nxt_sendbuf_completion(nxt_task_t *task, nxt_work_queue_t *wq,
124 nxt_buf_t *b, size_t sent);
125
126
127#endif /* _NXT_SENDBUF_H_INCLUDED_ */