return APR_SUCCESS;
}
-apr_status_t h2_conn_io_write(h2_conn_io *io,
- const char *buf, size_t length)
-{
- apr_status_t status = APR_SUCCESS;
- pass_out_ctx ctx;
-
- ctx.c = io->connection;
- ctx.io = io;
- io->unflushed = 1;
- if (io->bufsize > 0) {
- ap_log_cerror(APLOG_MARK, APLOG_TRACE4, 0, io->connection,
- "h2_conn_io: buffering %ld bytes", (long)length);
-
- if (!APR_BRIGADE_EMPTY(io->output)) {
- status = h2_conn_io_pass(io);
- io->unflushed = 1;
- }
-
- while (length > 0 && (status == APR_SUCCESS)) {
- apr_size_t avail = io->bufsize - io->buflen;
- if (avail <= 0) {
-
- bucketeer_buffer(io);
- status = pass_out(io->output, &ctx);
- io->buflen = 0;
- }
- else if (length > avail) {
- memcpy(io->buffer + io->buflen, buf, avail);
- io->buflen += avail;
- length -= avail;
- buf += avail;
- }
- else {
- memcpy(io->buffer + io->buflen, buf, length);
- io->buflen += length;
- length = 0;
- break;
- }
- }
-
- }
- else {
- ap_log_cerror(APLOG_MARK, APLOG_TRACE4, status, io->connection,
- "h2_conn_io: writing %ld bytes to brigade", (long)length);
- status = apr_brigade_write(io->output, pass_out, &ctx, buf, length);
- }
-
- return status;
-}
-
apr_status_t h2_conn_io_writeb(h2_conn_io *io, apr_bucket *b)
{
APR_BRIGADE_INSERT_TAIL(io->output, b);
return h2_conn_io_flush_int(io, 0, 0);
}
+apr_status_t h2_conn_io_write(h2_conn_io *io,
+ const char *buf, size_t length)
+{
+ apr_status_t status = APR_SUCCESS;
+ pass_out_ctx ctx;
+
+ ctx.c = io->connection;
+ ctx.io = io;
+ io->unflushed = 1;
+ if (io->bufsize > 0) {
+ ap_log_cerror(APLOG_MARK, APLOG_TRACE4, 0, io->connection,
+ "h2_conn_io: buffering %ld bytes", (long)length);
+
+ if (!APR_BRIGADE_EMPTY(io->output)) {
+ status = h2_conn_io_pass(io);
+ io->unflushed = 1;
+ }
+
+ while (length > 0 && (status == APR_SUCCESS)) {
+ apr_size_t avail = io->bufsize - io->buflen;
+ if (avail <= 0) {
+ h2_conn_io_flush_int(io, 1, 0);
+ }
+ else if (length > avail) {
+ memcpy(io->buffer + io->buflen, buf, avail);
+ io->buflen += avail;
+ length -= avail;
+ buf += avail;
+ }
+ else {
+ memcpy(io->buffer + io->buflen, buf, length);
+ io->buflen += length;
+ length = 0;
+ break;
+ }
+ }
+
+ }
+ else {
+ ap_log_cerror(APLOG_MARK, APLOG_TRACE4, status, io->connection,
+ "h2_conn_io: writing %ld bytes to brigade", (long)length);
+ status = apr_brigade_write(io->output, pass_out, &ctx, buf, length);
+ }
+
+ return status;
+}
+
{
/* Remove io from ready set, we will never submit it */
h2_io_set_remove(m->ready_ios, io);
- if (!io->worker_started || io->worker_done) {
+ if (!io->processing_started || io->processing_done) {
/* already finished or not even started yet */
h2_tq_remove(m->q, io->id);
io_destroy(m, io, 1);
h2_io *io = h2_io_set_get(m->stream_ios, sid);
if (io) {
req = io->request;
- io->worker_started = 1;
+ io->processing_started = 1;
if (sid > m->max_stream_started) {
m->max_stream_started = sid;
}
ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c,
"h2_mplx(%ld): request(%d) done", m->id, stream_id);
if (io) {
- io->worker_done = 1;
+ io->processing_done = 1;
if (io->orphaned) {
io_destroy(m, io, 0);
if (m->join_wait) {
"resetting io to close request processing",
m->id, io->id);
h2_io_make_orphaned(io, H2_ERR_STREAM_CLOSED);
- if (!io->worker_started || io->worker_done) {
+ if (!io->processing_started || io->processing_done) {
io_destroy(m, io, 1);
}
else {