Ignore:
Timestamp:
Jul 13, 2017, 9:01:05 AM (21 months ago)
Author:
Juanma
Message:

Initial release

File:
1 edited

Legend:

Unmodified
Added
Removed
  • squid-ssl/trunk/fuentes/src/esi/Esi.cc

    r5495 r5496  
    574574#endif
    575575
    576     if (!(rep != NULL || (outbound.getRaw() &&
     576    if (!(rep || (outbound.getRaw() &&
    577577                  outbound->len && (outbound_offset <= outbound->len)))) {
    578578        debugs(86, 5, "ESIContext::send: Nothing to send.");
     
    619619    debugs(86, 5, "ESIContext::send: this=" << this << " Client no longer wants data ");
    620620    /* Deal with re-entrancy */
    621     HttpReply::Pointer temprep = rep;
     621    HttpReply *temprep = rep;
    622622    rep = NULL; /* freed downstream */
    623623
    624     if (temprep != NULL && varState)
    625         varState->buildVary(temprep.getRaw());
     624    if (temprep && varState)
     625        varState->buildVary (temprep);
    626626
    627627    {
     
    630630        tempBuffer.offset = pos - len;
    631631        tempBuffer.data = next->readBuffer.data;
    632         clientStreamCallback (thisNode, http, temprep.getRaw(), tempBuffer);
     632        clientStreamCallback (thisNode, http, temprep, tempBuffer);
    633633    }
    634634
     
    967967    int specifiedattcount = attrCount * 2;
    968968    char *position;
    969     Must(ellen < sizeof(localbuf)); /* prevent unexpected overruns. */
     969    assert (ellen < sizeof (localbuf)); /* prevent unexpected overruns. */
    970970
    971971    debugs(86, 5, "ESIContext::Start: element '" << el << "' with " << specifiedattcount << " tags");
     
    981981        localbuf[0] = '<';
    982982        localbuf[1] = '\0';
    983         xstrncpy(&localbuf[1], el, sizeof(localbuf) - 2);
     983        assert (xstrncpy (&localbuf[1], el, sizeof(localbuf) - 2));
    984984        position = localbuf + strlen (localbuf);
    985985
    986986        for (i = 0; i < specifiedattcount && attr[i]; i += 2) {
    987             Must(static_cast<size_t>(position - localbuf) < sizeof(localbuf) - 1);
    988987            *position = ' ';
    989988            ++position;
    990989            /* TODO: handle thisNode gracefully */
    991             xstrncpy(position, attr[i], sizeof(localbuf) - (position - localbuf));
     990            assert (xstrncpy (position, attr[i], sizeof(localbuf) + (position - localbuf)));
    992991            position += strlen (position);
    993             Must(static_cast<size_t>(position - localbuf) < sizeof(localbuf) - 2);
    994992            *position = '=';
    995993            ++position;
     
    1000998            while ((ch = *chPtr++) != '\0') {
    1001999                if (ch == '\"') {
    1002                     Must(static_cast<size_t>(position - localbuf) < sizeof(localbuf) - 6);
    1003                     xstrncpy(position, "&quot;", sizeof(localbuf) - (position-localbuf));
     1000                    assert( xstrncpy(position, "&quot;", sizeof(localbuf) + (position-localbuf)) );
    10041001                    position += 6;
    10051002                } else {
    1006                     Must(static_cast<size_t>(position - localbuf) < sizeof(localbuf) - 1);
    10071003                    *position = ch;
    10081004                    ++position;
    10091005                }
    10101006            }
    1011             Must(static_cast<size_t>(position - localbuf) < sizeof(localbuf) - 1);
     1007            position += strlen (position);
    10121008            *position = '\"';
    10131009            ++position;
    10141010        }
    10151011
    1016         Must(static_cast<size_t>(position - localbuf) < sizeof(localbuf) - 2);
    10171012        *position = '>';
    10181013        ++position;
     
    11001095
    11011096    case ESIElement::ESI_ELEMENT_NONE:
    1102         Must(ellen < sizeof(localbuf) - 3); /* prevent unexpected overruns. */
     1097        assert (ellen < sizeof (localbuf)); /* prevent unexpected overruns. */
    11031098        /* Add elements we aren't interested in */
    11041099        localbuf[0] = '<';
    11051100        localbuf[1] = '/';
    1106         xstrncpy(&localbuf[2], el, sizeof(localbuf) - 3);
     1101        assert (xstrncpy (&localbuf[2], el, sizeof(localbuf) - 3));
    11071102        position = localbuf + strlen (localbuf);
    11081103        *position = '>';
     
    12601255    }
    12611256
    1262     if (rep != NULL && !parserState.inited())
     1257    if (rep && !parserState.inited())
    12631258        parserState.init(this);
    12641259
     
    13991394    debugs(86, 5, HERE << "Freeing for this=" << this);
    14001395
    1401     rep = NULL; // refcounted
     1396    HTTPMSGUNLOCK(rep);
    14021397
    14031398    finishChildren ();
Note: See TracChangeset for help on using the changeset viewer.