comparison src/context.cpp @ 390:bcef093b1ba6

start parsing spf txt records
author Carl Byington <carl@five-ten-sg.com>
date Mon, 06 Mar 2017 17:14:41 -0800
parents 2354a1944e49
children 88ef2b4e6f1e
comparison
equal deleted inserted replaced
389:aa9795b407e8 390:bcef093b1ba6
1130 dns_interface(*priv, from, ns_t_txt, false, NULL, buf, maxlen); 1130 dns_interface(*priv, from, ns_t_txt, false, NULL, buf, maxlen);
1131 if (*buf) { 1131 if (*buf) {
1132 log(priv->queueid, "found txt record %s", buf); 1132 log(priv->queueid, "found txt record %s", buf);
1133 char *p = buf; 1133 char *p = buf;
1134 char *e = p + strlen(p); // point to trailing null 1134 char *e = p + strlen(p); // point to trailing null
1135 while (p = strstr(p, " ip4:")) { 1135 while ((p = strstr(p, " ip4:"))) {
1136 p += 5; 1136 p += 5;
1137 char *b = strchr(p, ' '); 1137 char *b = strchr(p, ' ');
1138 if (b) *b = '\0'; 1138 if (b) *b = '\0';
1139 char *s = strchr(p, '/'); 1139 char *s = strchr(p, '/');
1140 if (s) *s = '\0'; 1140 if (s) *s = '\0';