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

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.
102 HTABLE *qmgr_transport_byname; /* transport by name */
111 QMGR_TRANSPORT *transport; /* transport context */
129 * connection per transport. With low-latency destinations, the output rates
170 void qmgr_transport_unthrottle(QMGR_TRANSPORT *transport)
176 * qmgr_transport_throttle(), or whenever a delivery transport has been
178 * the transport was blocked, otherwise the request is ignored.
180 if ((transport->flags & QMGR_TRANSPORT_STAT_DEAD) != 0) {
182 msg_info("%s: transport %s", myname, transport->name);
183 transport->flags &= ~QMGR_TRANSPORT_STAT_DEAD;
184 if (transport->dsn == 0)
185 msg_panic("%s: transport %s: null reason",
186 myname, transport->name);
187 dsn_free(transport->dsn);
188 transport->dsn = 0;
190 (char *) transport);
196 void qmgr_transport_throttle(QMGR_TRANSPORT *transport, DSN *dsn)
202 * transport. Instead of hosing the system by retrying in a tight loop,
203 * back off and disable this transport type for a while.
205 if ((transport->flags & QMGR_TRANSPORT_STAT_DEAD) == 0) {
207 msg_info("%s: transport %s: status: %s reason: %s",
208 myname, transport->name, dsn->status, dsn->reason);
209 transport->flags |= QMGR_TRANSPORT_STAT_DEAD;
210 if (transport->dsn)
211 msg_panic("%s: transport %s: spurious reason: %s",
212 myname, transport->name, transport->dsn->reason);
213 transport->dsn = DSN_COPY(dsn);
215 (char *) transport, var_transport_retry_time);
219 /* qmgr_transport_abort - transport connect watchdog */
225 msg_fatal("timeout connecting to transport: %s", alloc->transport->name);
239 msg_info("transport_event: %s", alloc->transport->name);
254 alloc->transport->pending -= 1;
259 alloc->notify(alloc->transport, alloc->stream);
263 /* qmgr_transport_select - select transport for allocation */
272 * If we find a suitable transport, rotate the list of transports to
305 void qmgr_transport_alloc(QMGR_TRANSPORT *transport, QMGR_TRANSPORT_ALLOC_NOTIFY notify)
312 if (transport->flags & QMGR_TRANSPORT_STAT_DEAD)
313 msg_panic("qmgr_transport: dead transport: %s", transport->name);
314 if (transport->pending >= QMGR_TRANSPORT_MAX_PEND)
315 msg_panic("qmgr_transport: excess allocation: %s", transport->name);
320 * of delivery process allocation attempts for this transport. In case of
328 * event handler so that it can throttle the transport and defer the todo
337 alloc->transport = transport;
339 transport->pending += 1;
340 if ((alloc->stream = mail_connect(MAIL_CLASS_PRIVATE, transport->name,
342 msg_warn("connect to transport %s/%s: %m",
343 MAIL_CLASS_PRIVATE, transport->name);
365 /* qmgr_transport_create - create transport instance */
369 QMGR_TRANSPORT *transport;
372 msg_panic("qmgr_transport_create: transport exists: %s", name);
373 transport = (QMGR_TRANSPORT *) mymalloc(sizeof(QMGR_TRANSPORT));
374 transport->flags = 0;
375 transport->pending = 0;
376 transport->name = mystrdup(name);
379 * Use global configuration settings or transport-specific settings.
381 transport->dest_concurrency_limit =
384 transport->recipient_limit =
387 transport->init_dest_concurrency =
390 transport->rate_delay = get_mail_conf_time2(name, _DEST_RATE_DELAY,
394 if (transport->rate_delay > 0)
395 transport->dest_concurrency_limit = 1;
396 if (transport->dest_concurrency_limit != 0
397 && transport->dest_concurrency_limit < transport->init_dest_concurrency)
398 transport->init_dest_concurrency = transport->dest_concurrency_limit;
400 transport->queue_byname = htable_create(0);
401 QMGR_LIST_INIT(transport->queue_list);
402 transport->dsn = 0;
403 qmgr_feedback_init(&transport->pos_feedback, name, _CONC_POS_FDBACK,
405 qmgr_feedback_init(&transport->neg_feedback, name, _CONC_NEG_FDBACK,
407 transport->fail_cohort_limit =
412 htable_enter(qmgr_transport_byname, name, (char *) transport);
413 QMGR_LIST_APPEND(qmgr_transport_list, transport);
416 transport->name, transport->dest_concurrency_limit,
417 transport->recipient_limit);
418 return (transport);
421 /* qmgr_transport_find - find transport instance */