Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 171 of file adnslogres.c.
Referenced by main().
{ int eof, err, len; adns_state adns; adns_answer *answer; logline *head, *tail, *line; adns_initflags initflags; initflags= (opts & OPT_DEBUG) ? adns_if_debug : 0; if (config_text) { errno= adns_init_strcfg(&adns, initflags, stderr, config_text); } else { errno= adns_init(&adns, initflags, 0); } if (errno) aargh("adns_init"); head= tail= readline(inf, adns, opts); len= 1; eof= 0; while (head) { while (head) { if (opts & OPT_DEBUG) msg("%d in queue; checking %.*s", len, head->rest-head->addr, guard_null(head->addr)); if (eof || len >= maxpending) { #ifdef HAVE_POLL if (opts & OPT_POLL) err= adns_wait_poll(adns, &head->query, &answer, NULL); else #endif err= adns_wait(adns, &head->query, &answer, NULL); } else { err= adns_check(adns, &head->query, &answer, NULL); } if ((err == EAGAIN) || (EWOULDBLOCK == err)) break; if (err) { fprintf(stderr, "%s: adns_wait/check: %s", progname, strerror(err)); exit(1); } printline(outf, head->start, head->addr, head->rest, answer->status == adns_s_ok ? *answer->rrs.str : NULL); line= head; head= head->next; free(line); free(answer); len--; } if (!eof) { line= readline(inf, adns, opts); if (line) { if (!head) head= line; else tail->next= line; tail= line; len++; } else { eof= 1; } } } adns_finish(adns); }