[dnsdist] reqresp.cpp:265:13: warning: duplicated 'if' condition [-Wduplicated-cond]

David Binderman dcb314 at hotmail.com
Wed Jan 30 08:52:15 UTC 2019


Hello there,

Source code is

    if (kind == YAHTTP_TYPE_REQUEST) {
        bool first = true;
        os << "Cookie: ";
        for(strcookie_map_t::const_iterator i = jar.cookies.begin(); i != jar.cookies.end(); i++) {
          if (first)
            first = false;
          else
            os << "; ";
          os << Utility::encodeURL(i->second.name) << "=" << Utility::encodeURL(i->second.value);
        }
     } else if (kind == YAHTTP_TYPE_REQUEST) {
        for(strcookie_map_t::const_iterator i = jar.cookies.begin(); i != jar.cookies.end(); i++) {
          os << "Set-Cookie: ";
          os << i->second.str() << "\r\n";
        }
      }

Suggest code rework.

Regards

David Binderman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/dnsdist/attachments/20190130/971f60d2/attachment.html>


More information about the dnsdist mailing list