X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Ffilters%2Fbulkquery%2Fbulkquery.c;h=69dee62756c43b5b6777d3a1fa7086638d086cec;hp=8b8ed8860c3abb9a2f9b082dc5a91ceb6d0686ce;hb=e50f5ac2682d655013d18d97f9a2aa30b7ed9485;hpb=236494661f8c6c49cc27c34f64dbb94eb3d538da diff --git a/plugins/filters/bulkquery/bulkquery.c b/plugins/filters/bulkquery/bulkquery.c index 8b8ed886..69dee627 100644 --- a/plugins/filters/bulkquery/bulkquery.c +++ b/plugins/filters/bulkquery/bulkquery.c @@ -49,26 +49,26 @@ void do_queries () { //fprintf (stderr, "making query %s\n", tIP->IP); fflush(stderr); if (lwres_context_create(&ctx, NULL, NULL, NULL, 0) != 0) { fprintf (stderr, "Couldn't create context\n"); - return; + return; } else { lwres_conf_parse(ctx, lwres_resolv_conf); //pthread_mutex_lock(mutexoutput); - n = lwres_getrdatabyname(ctx, tIP->IP, ns_c_in, ns_t_a, 0, &response); + n = lwres_getrdatabyname(ctx, tIP->IP, ns_c_in, ns_t_a, 0, &response); //pthread_mutex_unlock(mutexoutput); - if (n == LWRES_R_SUCCESS) { - printf ("%s,%d.%d.%d.%d,%d\n", tIP->IP, - response->rdatas[0][0], response->rdatas[0][1], - response->rdatas[0][2], response->rdatas[0][3], - response->ttl); - //fprintf (stderr, "freeing response\n"); fflush(stderr); - lwres_grbnresponse_free(ctx, &response); - } else { - //fprintf (stderr, "Nothing found\n"); + if (n == LWRES_R_SUCCESS) { + printf ("%s,%d.%d.%d.%d,%d\n", tIP->IP, + response->rdatas[0][0], response->rdatas[0][1], + response->rdatas[0][2], response->rdatas[0][3], + response->ttl); + //fprintf (stderr, "freeing response\n"); fflush(stderr); + lwres_grbnresponse_free(ctx, &response); + } else { + //fprintf (stderr, "Nothing found\n"); printf ("%s, %s, %d\n", tIP->IP, tIP->IP, defttl); - } - //fprintf (stderr, "freeing context\n"); fflush(stderr); - lwres_context_destroy(&ctx); - //fprintf (stderr, "done freeing\n"); fflush(stderr); + } + //fprintf (stderr, "freeing context\n"); fflush(stderr); + lwres_context_destroy(&ctx); + //fprintf (stderr, "done freeing\n"); fflush(stderr); } pthread_mutex_lock(mutexp); @@ -91,7 +91,7 @@ void GetRBLs() { dnsrbls[numrbls] = (char *) malloc(strlen(instr)+1); if (dnsrbls[numrbls] == NULL) { fprintf (stderr, "Couldn't allocate memory for %d DNS RBLs\n", numrbls); - exit (10); + exit (10); } else { strcpy (dnsrbls[numrbls], instr); numrbls++; @@ -126,7 +126,7 @@ main () { tIP = (iplist)malloc(sizeof(struct ipnode)); tIP->IP = (char *)malloc(strlen(instr)+strlen(dnsrbls[loop1])+2); strcpy (tIP->IP, instr); - strcat (tIP->IP, dnsrbls[loop1]); + strcat (tIP->IP, dnsrbls[loop1]); tIP->next = IPs; IPs = tIP; numqueries++; @@ -151,7 +151,7 @@ main () { for (loop1 = 0; ((loop1