projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1de34ae
)
80 column screens are so 20th century
author
Art Cancro
<ajc@citadel.org>
Mon, 13 Mar 2017 15:25:53 +0000
(11:25 -0400)
committer
Art Cancro
<ajc@citadel.org>
Mon, 13 Mar 2017 15:25:53 +0000
(11:25 -0400)
citadel/domain.c
patch
|
blob
|
history
diff --git
a/citadel/domain.c
b/citadel/domain.c
index 3d055c671a55e7d53be9c9cc2e6d631d5a150607..af0af3d45eacb606d084b027fc8fcc659b8aaa92 100644
(file)
--- a/
citadel/domain.c
+++ b/
citadel/domain.c
@@
-1,7
+1,7
@@
/*
* DNS lookup for SMTP sender
*
/*
* DNS lookup for SMTP sender
*
- * Copyright (c) 1987-201
1
by the citadel.org team
+ * Copyright (c) 1987-201
7
by the citadel.org team
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 3.
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 3.
@@
-127,9
+127,7
@@
int getmx(char *mxbuf, char *dest) {
* Make a call to the resolver library.
*/
* Make a call to the resolver library.
*/
- ret = res_query(
- dest,
- C_IN, T_MX, (unsigned char *)answer.bytes, sizeof(answer) );
+ ret = res_query(dest, C_IN, T_MX, (unsigned char *)answer.bytes, sizeof(answer));
if (ret < 0) {
mxrecs = malloc(sizeof(struct mx));
if (ret < 0) {
mxrecs = malloc(sizeof(struct mx));
@@
-140,12
+138,13
@@
int getmx(char *mxbuf, char *dest) {
else {
/* If we had to truncate, shrink the number to avoid fireworks */
else {
/* If we had to truncate, shrink the number to avoid fireworks */
- if (ret > sizeof(answer))
+ if (ret > sizeof(answer))
{
ret = sizeof(answer);
ret = sizeof(answer);
+ }
- startptr = &answer.bytes[0]; /
* start and end of buffer */
+ startptr = &answer.bytes[0]; /
/ start and end of buffer
endptr = &answer.bytes[ret];
endptr = &answer.bytes[ret];
- ptr = startptr + HFIXEDSZ;
/* advance past header */
+ ptr = startptr + HFIXEDSZ;
// advance past header
for (qdcount = ntohs(answer.header.qdcount); qdcount--; ptr += ret + QFIXEDSZ) {
if ((ret = dn_skipname(ptr, endptr)) < 0) {
for (qdcount = ntohs(answer.header.qdcount); qdcount--; ptr += ret + QFIXEDSZ) {
if ((ret = dn_skipname(ptr, endptr)) < 0) {
@@
-156,12
+155,7
@@
int getmx(char *mxbuf, char *dest) {
while(1) {
memset(expanded_buf, 0, sizeof(expanded_buf));
while(1) {
memset(expanded_buf, 0, sizeof(expanded_buf));
- ret = dn_expand(startptr,
- endptr,
- ptr,
- expanded_buf,
- sizeof(expanded_buf)
- );
+ ret = dn_expand(startptr, endptr, ptr, expanded_buf, sizeof(expanded_buf));
if (ret < 0) break;
ptr += ret;
if (ret < 0) break;
ptr += ret;
@@
-175,12
+169,7
@@
int getmx(char *mxbuf, char *dest) {
else {
GETSHORT(pref, ptr);
else {
GETSHORT(pref, ptr);
- ret = dn_expand(startptr,
- endptr,
- ptr,
- expanded_buf,
- sizeof(expanded_buf)
- );
+ ret = dn_expand(startptr, endptr, ptr, expanded_buf, sizeof(expanded_buf));
ptr += ret;
++num_mxrecs;
ptr += ret;
++num_mxrecs;
@@
-188,13
+177,11
@@
int getmx(char *mxbuf, char *dest) {
mxrecs = malloc(sizeof(struct mx));
}
else {
mxrecs = malloc(sizeof(struct mx));
}
else {
- mxrecs = realloc(mxrecs,
- (sizeof(struct mx) * num_mxrecs) );
+ mxrecs = realloc(mxrecs, (sizeof(struct mx) * num_mxrecs) );
}
mxrecs[num_mxrecs - 1].pref = pref;
}
mxrecs[num_mxrecs - 1].pref = pref;
- strcpy(mxrecs[num_mxrecs - 1].host,
- expanded_buf);
+ strcpy(mxrecs[num_mxrecs - 1].host, expanded_buf);
}
}
}
}
}
}
@@
-211,7
+198,8
@@
int getmx(char *mxbuf, char *dest) {
}
free(mxrecs);
}
free(mxrecs);
- /* Append any fallback smart hosts we have configured.
+ /*
+ * Append any fallback smart hosts we have configured.
*/
num_mxrecs += get_hosts(&mxbuf[strlen(mxbuf)], "fallbackhost");
return(num_mxrecs);
*/
num_mxrecs += get_hosts(&mxbuf[strlen(mxbuf)], "fallbackhost");
return(num_mxrecs);