~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/master/service-process.c

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2005-2012 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2005-2013 Dovecot authors, see the included COPYING file */
2
2
 
3
3
#include "common.h"
4
4
#include "array.h"
84
84
                if (listeners[i]->fd != -1 &&
85
85
                    (listeners[i]->type != SERVICE_LISTENER_INET ||
86
86
                     !listeners[i]->set.inetset.set->ssl)) {
87
 
                        str_tabescape_write(listener_names, listeners[i]->name);
 
87
                        str_append_tabescaped(listener_names, listeners[i]->name);
88
88
                        str_append_c(listener_names, '\t');
89
89
                        dup2_append(&dups, listeners[i]->fd, fd++);
90
90
                        socket_listener_count++;
96
96
                if (listeners[i]->fd != -1 &&
97
97
                    listeners[i]->type == SERVICE_LISTENER_INET &&
98
98
                    listeners[i]->set.inetset.set->ssl) {
99
 
                        str_tabescape_write(listener_names, listeners[i]->name);
 
99
                        str_append_tabescaped(listener_names, listeners[i]->name);
100
100
                        str_append_c(listener_names, '\t');
101
101
                        dup2_append(&dups, listeners[i]->fd, fd++);
102
102
                        socket_listener_count++;
208
208
                env_put(t_strconcat("DEBUG_LOG_PATH=", set->debug_log_path, NULL));
209
209
                env_put(t_strconcat("LOG_TIMESTAMP=", set->log_timestamp, NULL));
210
210
                env_put(t_strconcat("SYSLOG_FACILITY=", set->syslog_facility, NULL));
 
211
                env_put("SSL=no");
211
212
                break;
212
213
        default:
213
214
                env_put(t_strconcat(MASTER_CONFIG_FILE_ENV"=",
227
228
                                service->client_limit));
228
229
        env_put(t_strdup_printf(MASTER_PROCESS_LIMIT_ENV"=%u",
229
230
                                service->process_limit));
 
231
        env_put(t_strdup_printf(MASTER_PROCESS_MIN_AVAIL_ENV"=%u",
 
232
                                service->set->process_min_avail));
230
233
        env_put(t_strdup_printf(MASTER_SERVICE_IDLE_KILL_ENV"=%u",
231
234
                                service->idle_kill));
232
235
        if (service->set->service_count != 0) {
234
237
                                        service->set->service_count));
235
238
        }
236
239
        env_put(t_strdup_printf(MASTER_UID_ENV"=%u", uid));
 
240
        env_put(t_strdup_printf(MY_HOSTNAME_ENV"=%s", my_hostname));
 
241
        env_put(t_strdup_printf(MY_HOSTDOMAIN_ENV"=%s", my_hostdomain()));
237
242
 
238
243
        if (!service->set->master_set->version_ignore)
239
244
                env_put(MASTER_DOVECOT_VERSION_ENV"="PACKAGE_VERSION);
321
326
        DLLIST_PREPEND(&service->processes, process);
322
327
 
323
328
        service_list_ref(service->list);
324
 
        hash_table_insert(service_pids, &process->pid, process);
 
329
        hash_table_insert(service_pids, POINTER_CAST(process->pid), process);
325
330
 
326
331
        if (service->type == SERVICE_TYPE_ANVIL && process_forked)
327
332
                service_anvil_process_created(process);
334
339
        struct service_list *service_list = service->list;
335
340
 
336
341
        DLLIST_REMOVE(&service->processes, process);
337
 
        hash_table_remove(service_pids, &process->pid);
 
342
        hash_table_remove(service_pids, POINTER_CAST(process->pid));
338
343
 
339
344
        if (process->available_count > 0)
340
345
                service->process_avail--;
365
370
        process->refcount++;
366
371
}
367
372
 
368
 
int service_process_unref(struct service_process *process)
 
373
void service_process_unref(struct service_process *process)
369
374
{
370
375
        i_assert(process->refcount > 0);
371
376
 
372
377
        if (--process->refcount > 0)
373
 
                return TRUE;
 
378
                return;
374
379
 
375
380
        i_assert(process->destroyed);
376
 
 
377
381
        i_free(process);
378
 
        return FALSE;
379
382
}
380
383
 
381
384
static const char *