• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/postfix-255/postfix/src/global/

Lines Matching refs:sp

86 #define SCACHE_SINGLE_ENDP_BUSY(sp)	(VSTRING_LEN(sp->endp.endp_label) > 0)
87 #define SCACHE_SINGLE_DEST_BUSY(sp) (VSTRING_LEN(sp->dest.dest_label) > 0)
93 static void scache_single_free_endp(SCACHE_SINGLE *sp)
98 msg_info("%s: %s", myname, STR(sp->endp.endp_label));
100 event_cancel_timer(scache_single_expire_endp, (char *) sp);
101 if (sp->endp.fd >= 0 && close(sp->endp.fd) < 0)
102 msg_warn("close session endpoint %s: %m", STR(sp->endp.endp_label));
103 VSTRING_RESET(sp->endp.endp_label);
104 VSTRING_TERMINATE(sp->endp.endp_label);
105 VSTRING_RESET(sp->endp.endp_prop);
106 VSTRING_TERMINATE(sp->endp.endp_prop);
107 sp->endp.fd = -1;
114 SCACHE_SINGLE *sp = (SCACHE_SINGLE *) context;
116 scache_single_free_endp(sp);
125 SCACHE_SINGLE *sp = (SCACHE_SINGLE *) scache;
131 if (SCACHE_SINGLE_ENDP_BUSY(sp))
132 scache_single_free_endp(sp); /* dump the cached fd */
134 vstring_strcpy(sp->endp.endp_label, endp_label);
135 vstring_strcpy(sp->endp.endp_prop, endp_prop);
136 sp->endp.fd = fd;
137 event_request_timer(scache_single_expire_endp, (char *) sp, endp_ttl);
148 SCACHE_SINGLE *sp = (SCACHE_SINGLE *) scache;
152 if (!SCACHE_SINGLE_ENDP_BUSY(sp)) {
157 if (strcmp(STR(sp->endp.endp_label), endp_label) == 0) {
158 vstring_strcpy(endp_prop, STR(sp->endp.endp_prop));
159 fd = sp->endp.fd;
160 sp->endp.fd = -1;
161 scache_single_free_endp(sp);
173 static void scache_single_free_dest(SCACHE_SINGLE *sp)
178 msg_info("%s: %s -> %s", myname, STR(sp->dest.dest_label),
179 STR(sp->dest.endp_label));
181 event_cancel_timer(scache_single_expire_dest, (char *) sp);
182 VSTRING_RESET(sp->dest.dest_label);
183 VSTRING_TERMINATE(sp->dest.dest_label);
184 VSTRING_RESET(sp->dest.dest_prop);
185 VSTRING_TERMINATE(sp->dest.dest_prop);
186 VSTRING_RESET(sp->dest.endp_label);
187 VSTRING_TERMINATE(sp->dest.endp_label);
194 SCACHE_SINGLE *sp = (SCACHE_SINGLE *) context;
196 scache_single_free_dest(sp);
206 SCACHE_SINGLE *sp = (SCACHE_SINGLE *) scache;
217 (SCACHE_SINGLE_DEST_BUSY(sp)
218 && strcmp(STR(sp->dest.dest_label), dest_label) == 0
219 && strcmp(STR(sp->dest.dest_prop), dest_prop) == 0
220 && strcmp(STR(sp->dest.endp_label), endp_label) == 0);
223 vstring_strcpy(sp->dest.dest_label, dest_label);
224 vstring_strcpy(sp->dest.dest_prop, dest_prop);
225 vstring_strcpy(sp->dest.endp_label, endp_label);
227 event_request_timer(scache_single_expire_dest, (char *) sp, dest_ttl);
239 SCACHE_SINGLE *sp = (SCACHE_SINGLE *) scache;
243 if (!SCACHE_SINGLE_DEST_BUSY(sp)) {
248 if (strcmp(STR(sp->dest.dest_label), dest_label) == 0) {
251 if ((fd = scache_single_find_endp(scache, STR(sp->dest.endp_label), endp_prop)) >= 0) {
252 vstring_strcpy(dest_prop, STR(sp->dest.dest_prop));
265 SCACHE_SINGLE *sp = (SCACHE_SINGLE *) scache;
267 size->dest_count = (!SCACHE_SINGLE_DEST_BUSY(sp) ? 0 : 1);
268 size->endp_count = (!SCACHE_SINGLE_ENDP_BUSY(sp) ? 0 : 1);
269 size->sess_count = (sp->endp.fd < 0 ? 0 : 1);
276 SCACHE_SINGLE *sp = (SCACHE_SINGLE *) scache;
278 vstring_free(sp->endp.endp_label);
279 vstring_free(sp->endp.endp_prop);
280 if (sp->endp.fd >= 0)
281 close(sp->endp.fd);
283 vstring_free(sp->dest.dest_label);
284 vstring_free(sp->dest.dest_prop);
285 vstring_free(sp->dest.endp_label);
287 myfree((char *) sp);
294 SCACHE_SINGLE *sp = (SCACHE_SINGLE *) mymalloc(sizeof(*sp));
296 sp->scache->save_endp = scache_single_save_endp;
297 sp->scache->find_endp = scache_single_find_endp;
298 sp->scache->save_dest = scache_single_save_dest;
299 sp->scache->find_dest = scache_single_find_dest;
300 sp->scache->size = scache_single_size;
301 sp->scache->free = scache_single_free;
303 sp->endp.endp_label = vstring_alloc(10);
304 sp->endp.endp_prop = vstring_alloc(10);
305 sp->endp.fd = -1;
307 sp->dest.dest_label = vstring_alloc(10);
308 sp->dest.dest_prop = vstring_alloc(10);
309 sp->dest.endp_label = vstring_alloc(10);
311 return (sp->scache);