Branch: Tag:

2013-02-05

2013-02-05 18:28:36 by Tobias S. Josefowitz <tobij@tobij.de>

Protocols.DNS: Support multiple strings per TXT record in the client,
via new txta mapping entry.
(cherry picked from commit 78b2c8a2b803cbfa603af83b4381ebb130a7b09a)

487:    //! @value T_TXT    //! @mapping    //! @member string "txt" +  //! Note: For historical reasons, when receiving decoded +  //! DNS entries from a client, this will be the first string +  //! in the TXT record only. +  //! @member string "txta" +  //! When receiving decoded DNS data from a client, txta is +  //! the array of all strings in the record. When sending +  //! multiple strings in a TXT record in a server, please +  //! supply an array as "txt" containing the strings, txta +  //! will be ignored.    //! @endmapping    //! @value T_SPF    //! @mapping
590:    m->replacement = decode_domain (s, next);    break;    case T_TXT: -  m->txt = decode_string(s, next); +  { +  int tlen; +  +  m->txta = ({ }); +  while (tlen < m->len) { +  m->txta += ({ decode_string(s, next) }); +  tlen += sizeof(m->txta[-1]) + 1; +  } +  m->txt = m->txta[0]; +  }    break;    case T_SPF:    m->spf = decode_string(s, next);