• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/postfix-252/postfix/src/qmgr/

Lines Matching refs:peer

21 /*	void qmgr_peer_free(peer)
22 /* QMGR_PEER *peer;
29 /* Each peer corresponds to a specific job and destination.
33 /* qmgr_peer_create() creates an empty peer structure for the named
35 /* if a peer for given combination already exists.
37 /* qmgr_peer_find() looks up the peer for the named destination
38 /* for the named job. A null result means that the peer
41 /* qmgr_peer_obtain() looks up the peer for the named destination
44 /* qmgr_peer_free() disposes of a per-job peer after all
46 /* of a peer still in use.
48 /* qmgr_peer_select() attempts to find a peer of named job that
76 /* qmgr_peer_create - create and initialize message peer structure */
80 QMGR_PEER *peer;
82 peer = (QMGR_PEER *) mymalloc(sizeof(QMGR_PEER));
83 peer->queue = queue;
84 peer->job = job;
85 QMGR_LIST_APPEND(job->peer_list, peer, peers);
86 htable_enter(job->peer_byname, queue->name, (char *) peer);
87 peer->refcount = 0;
88 QMGR_LIST_INIT(peer->entry_list);
89 return (peer);
92 /* qmgr_peer_free - release peer structure */
94 void qmgr_peer_free(QMGR_PEER *peer)
97 QMGR_JOB *job = peer->job;
98 QMGR_QUEUE *queue = peer->queue;
101 * Sanity checks. It is an error to delete a referenced peer structure.
103 if (peer->refcount != 0)
104 msg_panic("%s: refcount: %d", myname, peer->refcount);
105 if (peer->entry_list.next != 0)
108 QMGR_LIST_UNLINK(job->peer_list, QMGR_PEER *, peer, peers);
110 myfree((char *) peer);
113 /* qmgr_peer_find - lookup peer associated with given job and queue */
120 /* qmgr_peer_obtain - find/create peer associated with given job and queue */
124 QMGR_PEER *peer;
126 if ((peer = qmgr_peer_find(job, queue)) == 0)
127 peer = qmgr_peer_create(job, queue);
128 return (peer);
131 /* qmgr_peer_select - select next peer suitable for delivery within given job */
135 QMGR_PEER *peer;
142 for (peer = job->peer_list.next; peer; peer = peer->peers.next) {
143 queue = peer->queue;
144 if (queue->window > queue->busy_refcount && peer->entry_list.next != 0) {
145 QMGR_LIST_ROTATE(job->peer_list, peer, peers);
150 return (peer);