• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/postfix-255/postfix/src/qmgr/

Lines Matching defs:transport

5 /*	per-transport data structures
17 /* void qmgr_transport_alloc(transport, notify)
18 /* QMGR_TRANSPORT *transport;
19 /* void (*notify)(QMGR_TRANSPORT *transport, VSTREAM *fp);
21 /* void qmgr_transport_throttle(transport, dsn)
22 /* QMGR_TRANSPORT *transport;
25 /* void qmgr_transport_unthrottle(transport)
26 /* QMGR_TRANSPORT *transport;
28 /* This module organizes the world by message transport type.
29 /* Each transport can have zero or more destination queues
33 /* named transport type.
35 /* qmgr_transport_find() looks up an existing message transport
38 /* qmgr_transport_select() attempts to find a transport that
43 /* specified transport type. Allocation is performed asynchronously.
45 /* is invoked with as arguments the transport and a stream that
48 /* the same transport is in progress.
51 /* processes for the named transport. Attempts to throttle a
52 /* throttled transport are ignored.
55 /* Attempts to unthrottle a non-throttled transport are ignored.
107 HTABLE *qmgr_transport_byname; /* transport by name */
116 QMGR_TRANSPORT *transport; /* transport context */
134 * connection per transport. With low-latency destinations, the output rates
175 void qmgr_transport_unthrottle(QMGR_TRANSPORT *transport)
181 * qmgr_transport_throttle(), or whenever a delivery transport has been
183 * the transport was blocked, otherwise the request is ignored.
185 if ((transport->flags & QMGR_TRANSPORT_STAT_DEAD) != 0) {
187 msg_info("%s: transport %s", myname, transport->name);
188 transport->flags &= ~QMGR_TRANSPORT_STAT_DEAD;
189 if (transport->dsn == 0)
190 msg_panic("%s: transport %s: null reason",
191 myname, transport->name);
192 dsn_free(transport->dsn);
193 transport->dsn = 0;
195 (char *) transport);
201 void qmgr_transport_throttle(QMGR_TRANSPORT *transport, DSN *dsn)
207 * transport. Instead of hosing the system by retrying in a tight loop,
208 * back off and disable this transport type for a while.
210 if ((transport->flags & QMGR_TRANSPORT_STAT_DEAD) == 0) {
212 msg_info("%s: transport %s: status: %s reason: %s",
213 myname, transport->name, dsn->status, dsn->reason);
214 transport->flags |= QMGR_TRANSPORT_STAT_DEAD;
215 if (transport->dsn)
216 msg_panic("%s: transport %s: spurious reason: %s",
217 myname, transport->name, transport->dsn->reason);
218 transport->dsn = DSN_COPY(dsn);
220 (char *) transport, var_transport_retry_time);
224 /* qmgr_transport_abort - transport connect watchdog */
230 msg_fatal("timeout connecting to transport: %s", alloc->transport->name);
244 msg_info("transport_event: %s", alloc->transport->name);
259 alloc->transport->pending -= 1;
264 alloc->notify(alloc->transport, alloc->stream);
268 /* qmgr_transport_select - select transport for allocation */
277 * If we find a suitable transport, rotate the list of transports to
310 void qmgr_transport_alloc(QMGR_TRANSPORT *transport, QMGR_TRANSPORT_ALLOC_NOTIFY notify)
317 if (transport->flags & QMGR_TRANSPORT_STAT_DEAD)
318 msg_panic("qmgr_transport: dead transport: %s", transport->name);
319 if (transport->pending >= QMGR_TRANSPORT_MAX_PEND)
320 msg_panic("qmgr_transport: excess allocation: %s", transport->name);
325 * of delivery process allocation attempts for this transport. In case of
333 * event handler so that it can throttle the transport and defer the todo
342 alloc->transport = transport;
344 transport->pending += 1;
345 if ((alloc->stream = mail_connect(MAIL_CLASS_PRIVATE, transport->name,
347 msg_warn("connect to transport %s/%s: %m",
348 MAIL_CLASS_PRIVATE, transport->name);
370 /* qmgr_transport_create - create transport instance */
374 QMGR_TRANSPORT *transport;
377 msg_panic("qmgr_transport_create: transport exists: %s", name);
378 transport = (QMGR_TRANSPORT *) mymalloc(sizeof(QMGR_TRANSPORT));
379 transport->flags = 0;
380 transport->pending = 0;
381 transport->name = mystrdup(name);
384 * Use global configuration settings or transport-specific settings.
386 transport->dest_concurrency_limit =
389 transport->recipient_limit =
392 transport->init_dest_concurrency =
395 transport->rate_delay = get_mail_conf_time2(name, _DEST_RATE_DELAY,
399 if (transport->rate_delay > 0)
400 transport->dest_concurrency_limit = 1;
401 if (transport->dest_concurrency_limit != 0
402 && transport->dest_concurrency_limit < transport->init_dest_concurrency)
403 transport->init_dest_concurrency = transport->dest_concurrency_limit;
405 transport->slot_cost = get_mail_conf_int2(name, _DELIVERY_SLOT_COST,
407 transport->slot_loan = get_mail_conf_int2(name, _DELIVERY_SLOT_LOAN,
409 transport->slot_loan_factor =
412 transport->min_slots = get_mail_conf_int2(name, _MIN_DELIVERY_SLOTS,
414 transport->rcpt_unused = get_mail_conf_int2(name, _XPORT_RCPT_LIMIT,
416 transport->rcpt_per_stack = get_mail_conf_int2(name, _STACK_RCPT_LIMIT,
418 transport->refill_limit = get_mail_conf_int2(name, _XPORT_REFILL_LIMIT,
420 transport->refill_delay = get_mail_conf_time2(name, _XPORT_REFILL_DELAY,
423 transport->queue_byname = htable_create(0);
424 QMGR_LIST_INIT(transport->queue_list);
425 transport->job_byname = htable_create(0);
426 QMGR_LIST_INIT(transport->job_list);
427 QMGR_LIST_INIT(transport->job_bytime);
428 transport->job_current = 0;
429 transport->job_next_unread = 0;
430 transport->candidate_cache = 0;
431 transport->candidate_cache_current = 0;
432 transport->candidate_cache_time = (time_t) 0;
433 transport->blocker_tag = 1;
434 transport->dsn = 0;
435 qmgr_feedback_init(&transport->pos_feedback, name, _CONC_POS_FDBACK,
437 qmgr_feedback_init(&transport->neg_feedback, name, _CONC_NEG_FDBACK,
439 transport->fail_cohort_limit =
444 htable_enter(qmgr_transport_byname, name, (char *) transport);
445 QMGR_LIST_PREPEND(qmgr_transport_list, transport, peers);
448 transport->name, transport->dest_concurrency_limit,
449 transport->recipient_limit);
450 return (transport);
453 /* qmgr_transport_find - find transport instance */