if (ctx->iter != NULL)
(void)userdb_blocking_iter_deinit(&ctx->iter);
+ o_stream_uncork(ctx->conn->output);
o_stream_unset_flush_callback(ctx->conn->output);
auth_request_unref(&ctx->auth_request);
auth_master_connection_unref(&ctx->conn);
str_tabescape(user));
ret = o_stream_send_str(ctx->conn->output, str);
} T_END;
+ if (o_stream_get_buffer_used_size(ctx->conn->output) >= MAX_OUTBUF_SIZE)
+ ret = o_stream_flush(ctx->conn->output);
if (ret < 0) {
/* disconnected, don't bother finishing */
master_input_list_finish(ctx);
return;
}
- if (o_stream_get_buffer_used_size(ctx->conn->output) == 0)
+ if (o_stream_get_buffer_used_size(ctx->conn->output) < MAX_OUTBUF_SIZE)
userdb_blocking_iter_next(ctx->iter);
}
ctx->auth_request->userdb = userdb;
io_remove(&conn->io);
+ o_stream_cork(conn->output);
o_stream_set_flush_callback(conn->output, master_output_list, ctx);
ctx->iter = userdb_blocking_iter_init(auth_request,
master_input_list_callback, ctx);
auth_worker_send_reply(client, str);
client->io = io_add(client->fd, IO_READ, auth_worker_input, client);
+ o_stream_uncork(ctx->client->output);
o_stream_set_flush_callback(client->output, auth_worker_output, client);
auth_request_unref(&ctx->auth_request);
auth_worker_client_unref(&client);
ctx->auth_request->userdb->userdb->iface->
iterate_next(ctx->iter);
} T_END;
+ if (o_stream_get_buffer_used_size(ctx->client->output) > OUTBUF_THROTTLE_SIZE) {
+ if (o_stream_flush(ctx->client->output) < 0) {
+ ctx->done = TRUE;
+ break;
+ }
+ }
} while (ctx->sent &&
- o_stream_get_buffer_used_size(ctx->client->output) == 0);
+ o_stream_get_buffer_used_size(ctx->client->output) <= OUTBUF_THROTTLE_SIZE);
ctx->sending = FALSE;
if (ctx->done)
list_iter_deinit(ctx);
}
io_remove(&ctx->client->io);
+ o_stream_cork(ctx->client->output);
o_stream_set_flush_callback(ctx->client->output,
auth_worker_list_output, ctx);
ctx->iter = ctx->auth_request->userdb->userdb->iface->