Changeset 5503 for squid-ssl/trunk/fuentes/src/esi/Esi.cc
- Timestamp:
- Jul 13, 2017, 11:11:39 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
squid-ssl/trunk/fuentes/src/esi/Esi.cc
r5502 r5503 574 574 #endif 575 575 576 if (!(rep != NULL|| (outbound.getRaw() &&576 if (!(rep || (outbound.getRaw() && 577 577 outbound->len && (outbound_offset <= outbound->len)))) { 578 578 debugs(86, 5, "ESIContext::send: Nothing to send."); … … 619 619 debugs(86, 5, "ESIContext::send: this=" << this << " Client no longer wants data "); 620 620 /* Deal with re-entrancy */ 621 HttpReply ::Pointertemprep = rep;621 HttpReply *temprep = rep; 622 622 rep = NULL; /* freed downstream */ 623 623 624 if (temprep != NULL&& varState)625 varState->buildVary (temprep.getRaw());624 if (temprep && varState) 625 varState->buildVary (temprep); 626 626 627 627 { … … 630 630 tempBuffer.offset = pos - len; 631 631 tempBuffer.data = next->readBuffer.data; 632 clientStreamCallback (thisNode, http, temprep .getRaw(), tempBuffer);632 clientStreamCallback (thisNode, http, temprep, tempBuffer); 633 633 } 634 634 … … 967 967 int specifiedattcount = attrCount * 2; 968 968 char *position; 969 Must(ellen < sizeof(localbuf)); /* prevent unexpected overruns. */969 assert (ellen < sizeof (localbuf)); /* prevent unexpected overruns. */ 970 970 971 971 debugs(86, 5, "ESIContext::Start: element '" << el << "' with " << specifiedattcount << " tags"); … … 981 981 localbuf[0] = '<'; 982 982 localbuf[1] = '\0'; 983 xstrncpy(&localbuf[1], el, sizeof(localbuf) - 2);983 assert (xstrncpy (&localbuf[1], el, sizeof(localbuf) - 2)); 984 984 position = localbuf + strlen (localbuf); 985 985 986 986 for (i = 0; i < specifiedattcount && attr[i]; i += 2) { 987 Must(static_cast<size_t>(position - localbuf) < sizeof(localbuf) - 1);988 987 *position = ' '; 989 988 ++position; 990 989 /* TODO: handle thisNode gracefully */ 991 xstrncpy(position, attr[i], sizeof(localbuf) - (position - localbuf));990 assert (xstrncpy (position, attr[i], sizeof(localbuf) + (position - localbuf))); 992 991 position += strlen (position); 993 Must(static_cast<size_t>(position - localbuf) < sizeof(localbuf) - 2);994 992 *position = '='; 995 993 ++position; … … 1000 998 while ((ch = *chPtr++) != '\0') { 1001 999 if (ch == '\"') { 1002 Must(static_cast<size_t>(position - localbuf) < sizeof(localbuf) - 6); 1003 xstrncpy(position, """, sizeof(localbuf) - (position-localbuf)); 1000 assert( xstrncpy(position, """, sizeof(localbuf) + (position-localbuf)) ); 1004 1001 position += 6; 1005 1002 } else { 1006 Must(static_cast<size_t>(position - localbuf) < sizeof(localbuf) - 1);1007 1003 *position = ch; 1008 1004 ++position; 1009 1005 } 1010 1006 } 1011 Must(static_cast<size_t>(position - localbuf) < sizeof(localbuf) - 1);1007 position += strlen (position); 1012 1008 *position = '\"'; 1013 1009 ++position; 1014 1010 } 1015 1011 1016 Must(static_cast<size_t>(position - localbuf) < sizeof(localbuf) - 2);1017 1012 *position = '>'; 1018 1013 ++position; … … 1100 1095 1101 1096 case ESIElement::ESI_ELEMENT_NONE: 1102 Must(ellen < sizeof(localbuf) - 3); /* prevent unexpected overruns. */1097 assert (ellen < sizeof (localbuf)); /* prevent unexpected overruns. */ 1103 1098 /* Add elements we aren't interested in */ 1104 1099 localbuf[0] = '<'; 1105 1100 localbuf[1] = '/'; 1106 xstrncpy(&localbuf[2], el, sizeof(localbuf) - 3);1101 assert (xstrncpy (&localbuf[2], el, sizeof(localbuf) - 3)); 1107 1102 position = localbuf + strlen (localbuf); 1108 1103 *position = '>'; … … 1260 1255 } 1261 1256 1262 if (rep != NULL&& !parserState.inited())1257 if (rep && !parserState.inited()) 1263 1258 parserState.init(this); 1264 1259 … … 1399 1394 debugs(86, 5, HERE << "Freeing for this=" << this); 1400 1395 1401 rep = NULL; // refcounted1396 HTTPMSGUNLOCK(rep); 1402 1397 1403 1398 finishChildren ();
Note: See TracChangeset
for help on using the changeset viewer.