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

Lines Matching refs:score

28 /*	psc_dnsbl_request() requests a blocklist score for the
40 /* psc_dnsbl_retrieve() retrieves the result score requested with
42 /* is an error to retrieve a score without requesting it first.
124 * blocklist score requests when the pre-handshake delays of the connections
127 * We combine requests for the same score under the client IP address in a
129 * request for a score, and it goes down with each score retrieval. Each
130 * score has one or more requestors that need to be notified when the result
143 int total; /* combined blocklist score */
144 int refcount; /* score reference count */
306 /* psc_dnsbl_retrieve - retrieve blocklist score, decrement reference count */
312 PSC_DNSBL_SCORE *score;
318 if ((score = (PSC_DNSBL_SCORE *)
320 msg_panic("%s: no blocklist score for %s", myname, client_addr);
325 PSC_CALL_BACK_CANCEL(score, dnsbl_index);
330 result_score = score->total;
331 *dnsbl_name = score->dnsbl;
332 score->refcount -= 1;
333 if (score->refcount < 1) {
335 msg_info("%s: delete blocklist score for %s", myname, client_addr);
341 /* psc_dnsbl_receive - receive DNSBL reply, update blocklist score */
347 PSC_DNSBL_SCORE *score;
362 * Don't bother looking up the blocklist score when the client IP address is
365 * Don't panic when the blocklist score no longer exists. It may be deleted
378 && (score = (PSC_DNSBL_SCORE *)
380 && score->request_id == request_id) {
384 * blocklist score for this client IP address.
390 msg_info("%s: client=\"%s\" score=%d domain=\"%s\" reply=\"%s\"",
391 myname, STR(reply_client), score->total,
401 if (score->dnsbl == 0)
402 score->dnsbl = head->safe_dnsbl;
403 score->total += site->weight;
405 msg_info("%s: filter=\"%s\" weight=%d score=%d",
407 site->weight, score->total);
419 score->pending_lookups -= 1;
420 if (score->pending_lookups == 0)
421 PSC_CALL_BACK_NOTIFY(score, PSC_NULL_EVENT);
423 /* Here, score may be a null pointer. */
437 PSC_DNSBL_SCORE *score;
446 * We store a reference-counted DNSBL score under its client IP address. We
447 * increment the reference count with each score request, and decrement
448 * the reference count with each score retrieval.
457 * the DNSBL score is already available, but that would complicate the
464 score = (PSC_DNSBL_SCORE *) hash_node->value;
465 score->refcount += 1;
466 PSC_CALL_BACK_EXTEND(hash_node, score);
467 PSC_CALL_BACK_ENTER(score, callback, context);
469 msg_info("%s: reuse blocklist score for %s refcount=%d pending=%d",
470 myname, client_addr, score->refcount,
471 score->pending_lookups);
472 if (score->pending_lookups == 0)
474 return (PSC_CALL_BACK_INDEX_OF_LAST(score));
477 msg_info("%s: create blocklist score for %s", myname, client_addr);
478 score = (PSC_DNSBL_SCORE *) mymalloc(sizeof(*score));
479 score->request_id = request_count++;
480 score->dnsbl = 0;
481 score->total = 0;
482 score->refcount = 1;
483 score->pending_lookups = 0;
484 PSC_CALL_BACK_INIT(score);
485 PSC_CALL_BACK_ENTER(score, callback, context);
486 (void) htable_enter(dnsbl_score_cache, client_addr, (char *) score);
504 ATTR_TYPE_INT, MAIL_ATTR_LABEL, score->request_id,
514 score->pending_lookups += 1;
516 return (PSC_CALL_BACK_INDEX_OF_LAST(score));
551 * The per-client blocklist score.