nxt_linux_sendfile.c (13:3a52b2c3d3f1) nxt_linux_sendfile.c (494:7c83ddcc1c42)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

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

99 c->socket.fd, fb->file->fd, fb->file_pos, size);
100
101 offset = fb->file_pos;
102
103 n = nxt_sys_sendfile(c->socket.fd, fb->file->fd, &offset, size);
104
105 err = (n == -1) ? nxt_errno : 0;
106
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

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

99 c->socket.fd, fb->file->fd, fb->file_pos, size);
100
101 offset = fb->file_pos;
102
103 n = nxt_sys_sendfile(c->socket.fd, fb->file->fd, &offset, size);
104
105 err = (n == -1) ? nxt_errno : 0;
106
107 nxt_debug(c->socket.task, "sendfile(): %d", n);
107 nxt_debug(c->socket.task, "sendfile(): %z", n);
108
109 if (n == -1) {
110 switch (err) {
111
112 case NXT_EAGAIN:
113 c->socket.write_ready = 0;
114 break;
115

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

199 msg.msg_control = NULL;
200 msg.msg_controllen = 0;
201 msg.msg_flags = 0;
202
203 n = sendmsg(c->socket.fd, &msg, flags);
204
205 err = (n == -1) ? nxt_errno : 0;
206
108
109 if (n == -1) {
110 switch (err) {
111
112 case NXT_EAGAIN:
113 c->socket.write_ready = 0;
114 break;
115

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

199 msg.msg_control = NULL;
200 msg.msg_controllen = 0;
201 msg.msg_flags = 0;
202
203 n = sendmsg(c->socket.fd, &msg, flags);
204
205 err = (n == -1) ? nxt_errno : 0;
206
207 nxt_debug(c->socket.task, "sendmsg(%d, %ui, 0x%uXi): %d",
207 nxt_debug(c->socket.task, "sendmsg(%d, %ui, 0x%uXi): %z",
208 c->socket.fd, niov, flags, n);
209
210 if (n == -1) {
211 switch (err) {
212
213 case NXT_EAGAIN:
214 c->socket.write_ready = 0;
215 break;

--- 24 unchanged lines hidden ---
208 c->socket.fd, niov, flags, n);
209
210 if (n == -1) {
211 switch (err) {
212
213 case NXT_EAGAIN:
214 c->socket.write_ready = 0;
215 break;

--- 24 unchanged lines hidden ---