Lines Matching defs:dir

33 	struct director *dir;
61 if (request->dir->ring_last_sync_time == 0)
64 secs = ioloop_time - request->dir->ring_last_sync_time;
65 if (request->dir->ring_synced)
84 static void director_request_timeout(struct director *dir)
91 while (array_count(&dir->pending_requests) > 0) {
92 requestp = array_idx_modifiable(&dir->pending_requests, 0);
101 struct mail_tag *tag = mail_tag_find(dir->mail_hosts, tag_name);
115 i_assert(dir->requests_delayed_count > 0);
116 dir->requests_delayed_count--;
118 array_delete(&dir->pending_requests, 0, 1);
125 if (array_count(&dir->pending_requests) == 0 && dir->to_request != NULL)
126 timeout_remove(&dir->to_request);
129 void director_request(struct director *dir, const char *username,
136 if (!director_get_username_hash(dir, username,
142 dir->num_requests++;
145 request->dir = dir;
156 if (dir->to_request == NULL) {
157 dir->to_request =
159 director_request_timeout, dir);
161 array_append(&dir->pending_requests, &request, 1);
164 static void ring_noconn_warning(struct director *dir)
166 if (!dir->ring_handshaked) {
172 dir->ring_handshake_warning_sent = TRUE;
173 timeout_remove(&dir->to_handshake_warning);
176 static void ring_log_delayed_warning(struct director *dir)
178 if (dir->ring_handshake_warning_sent ||
179 dir->to_handshake_warning != NULL)
182 dir->to_handshake_warning = timeout_add(RING_NOCONN_WARNING_DELAY_MSECS,
183 ring_noconn_warning, dir);
189 struct director *dir = request->dir;
200 if (dir->right == NULL && dir->ring_synced) {
221 host = mail_host_get_by_hash(dir->mail_hosts, user->username_hash,
223 if (!dir->ring_synced) {
266 if (dir->ring_min_version < DIRECTOR_VERSION_WEAK_USERS) {
271 director_update_user_weak(dir, dir->self_host, NULL, NULL, user);
280 struct director *dir = request->dir;
286 if (!dir->ring_handshaked) {
290 ring_log_delayed_warning(dir);
296 mail_tag = mail_tag_find(dir->mail_hosts, tag);
308 if (!dir->ring_synced) {
310 ring_log_delayed_warning(dir);
316 host = mail_host_get_by_hash(dir->mail_hosts,
330 mail_hosts_hash(dir->mail_hosts));
334 director_update_user(dir, dir->self_host, user);
346 i_assert(request->dir->requests_delayed_count > 0);
347 request->dir->requests_delayed_count--;
351 request->dir->requests_delayed_count++;