Lines Matching defs:db

47 dialup_send_pulse(dialup_baton_t *db)
53 while (!APR_BRIGADE_EMPTY(db->bb) && bytes_sent < db->bytes_per_second) {
56 if (db->r->connection->aborted) {
60 status = apr_brigade_partition(db->bb, db->bytes_per_second, &e);
67 if (e != APR_BRIGADE_SENTINEL(db->bb)) {
70 f = APR_RING_FIRST(&db->bb->list);
72 APR_RING_SPLICE_HEAD(&db->tmpbb->list, f, b, apr_bucket, link);
75 APR_BRIGADE_CONCAT(db->tmpbb, db->bb);
78 e = apr_bucket_flush_create(db->r->connection->bucket_alloc);
80 APR_BRIGADE_INSERT_TAIL(db->tmpbb, e);
82 apr_brigade_length(db->tmpbb, 1, &len);
84 status = ap_pass_brigade(db->r->output_filters, db->tmpbb);
86 apr_brigade_cleanup(db->tmpbb);
89 ap_log_rerror(APLOG_MARK, APLOG_ERR, status, db->r, APLOGNO(01867)
95 if (APR_BRIGADE_EMPTY(db->bb)) {
107 dialup_baton_t *db = (dialup_baton_t *)baton;
108 conn_rec *c = db->r->connection;
110 apr_thread_mutex_lock(db->r->invoke_mtx);
112 status = dialup_send_pulse(db);
118 apr_thread_mutex_unlock(db->r->invoke_mtx);
119 ap_finalize_request_protocol(db->r);
120 ap_process_request_after_handler(db->r);
124 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, db->r, APLOGNO(01868)
126 db->r->status = HTTP_OK;
127 ap_die(status, db->r);
130 apr_thread_mutex_unlock(db->r->invoke_mtx);
143 dialup_baton_t *db;
195 db = apr_palloc(r->pool, sizeof(dialup_baton_t));
197 db->bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
198 db->tmpbb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
200 e = apr_brigade_insert_file(db->bb, fd, 0, r->finfo.size, r->pool);
209 db->bytes_per_second = dcfg->bytes_per_second;
210 db->r = r;
211 db->fd = fd;
215 APR_BRIGADE_INSERT_TAIL(db->bb, e);
217 status = dialup_send_pulse(db);
224 ap_mpm_register_timed_callback(apr_time_from_sec(1), dialup_callback, db);