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

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

69
70 if (!c->socket.write_ready) {
71 ret = NXT_AGAIN;
72 break;
73 }
74
75 } while (sb.limit != 0);
76
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

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

69
70 if (!c->socket.write_ready) {
71 ret = NXT_AGAIN;
72 break;
73 }
74
75 } while (sb.limit != 0);
76
77 nxt_debug(task, "event conn: %i sent:%z", ret, sb.sent);
77 nxt_debug(task, "event conn: %z sent:%O", ret, sb.sent);
78
79 if (sb.sent != 0) {
80 if (c->write_state->timer_autoreset) {
81 nxt_timer_disable(engine, &c->write_timer);
82 }
83 }
84
85 if (ret != NXT_ERROR) {

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

173 return nxt_conn_io_send(task, sb, iov[0].iov_base, iov[0].iov_len);
174 }
175
176 for ( ;; ) {
177 n = writev(sb->socket, iov, niov);
178
179 err = (n == -1) ? nxt_socket_errno : 0;
180
78
79 if (sb.sent != 0) {
80 if (c->write_state->timer_autoreset) {
81 nxt_timer_disable(engine, &c->write_timer);
82 }
83 }
84
85 if (ret != NXT_ERROR) {

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

173 return nxt_conn_io_send(task, sb, iov[0].iov_base, iov[0].iov_len);
174 }
175
176 for ( ;; ) {
177 n = writev(sb->socket, iov, niov);
178
179 err = (n == -1) ? nxt_socket_errno : 0;
180
181 nxt_debug(task, "writev(%d, %ui): %d", sb->socket, niov, n);
181 nxt_debug(task, "writev(%d, %ui): %z", sb->socket, niov, n);
182
183 if (n > 0) {
184 return n;
185 }
186
187 /* n == -1 */
188
189 switch (err) {

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

346 return nxt_event_conn_io_send(c, iob->iov_base, iob->iov_len);
347 }
348
349 for ( ;; ) {
350 n = writev(c->socket.fd, iob, niob);
351
352 err = (n == -1) ? nxt_socket_errno : 0;
353
182
183 if (n > 0) {
184 return n;
185 }
186
187 /* n == -1 */
188
189 switch (err) {

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

346 return nxt_event_conn_io_send(c, iob->iov_base, iob->iov_len);
347 }
348
349 for ( ;; ) {
350 n = writev(c->socket.fd, iob, niob);
351
352 err = (n == -1) ? nxt_socket_errno : 0;
353
354 nxt_debug(c->socket.task, "writev(%d, %ui): %d", c->socket.fd, niob, n);
354 nxt_debug(c->socket.task, "writev(%d, %ui): %z", c->socket.fd, niob, n);
355
356 if (n > 0) {
357 return n;
358 }
359
360 /* n == -1 */
361
362 switch (err) {

--- 60 unchanged lines hidden ---
355
356 if (n > 0) {
357 return n;
358 }
359
360 /* n == -1 */
361
362 switch (err) {

--- 60 unchanged lines hidden ---