MCPcopy Index your code
hub / github.com/apache/tomcat / recycle

Method recycle

java/org/apache/coyote/Request.java:1222–1297  ·  view source on GitHub ↗

Recycle this request for reuse.

()

Source from the content-addressed store, hash-verified

1220 * Recycle this request for reuse.
1221 */
1222 public void recycle() {
1223 bytesRead = 0;
1224
1225 contentLength = -1;
1226 contentTypeMB = null;
1227 charsetHolder = null;
1228 expectation = false;
1229 headers.recycle();
1230 trailerFields.recycle();
1231 /*
1232 * Trailer fields are limited in size by bytes. The following calls ensures that any request with a large number
1233 * of small trailer fields doesn't result in a long lasting, large array of headers inside the MimeHeader
1234 * instance. The first call ensures the array is no larger than 8. The second call allows the next request to
1235 * process more than 8 headers if it needs to.
1236 */
1237 trailerFields.setLimit(MimeHeaders.DEFAULT_HEADER_SIZE);
1238 trailerFields.setLimit(-1);
1239 serverNameMB.recycle();
1240 serverPort = -1;
1241 localAddrMB.recycle();
1242 localNameMB.recycle();
1243 localPort = -1;
1244 peerAddrMB.recycle();
1245 remoteAddrMB.recycle();
1246 remoteHostMB.recycle();
1247 remotePort = -1;
1248 available = 0;
1249 sendfile = true;
1250
1251 // There may be multiple calls to recycle but only the first should
1252 // trigger a change in the request ID until a new request has been
1253 // started. Use startTimeNanos to detect when a request has started so a
1254 // subsequent call to recycle() will trigger a change in the request ID.
1255 if (startTimeNanos != -1) {
1256 requestId = Long.toHexString(requestIdGenerator.getAndIncrement());
1257 }
1258
1259 serverCookies.recycle();
1260 parameters.recycle();
1261 pathParameters.clear();
1262
1263 uriMB.recycle();
1264 decodedUriMB.recycle();
1265 queryMB.recycle();
1266 methodMB.recycle();
1267 protoMB.recycle();
1268
1269 schemeMB.recycle();
1270
1271 remoteUser.recycle();
1272 remoteUserNeedsAuthorization = false;
1273 authType.recycle();
1274 attributes.clear();
1275
1276 errorException = null;
1277
1278 listener = null;
1279 synchronized (nonBlockingStateLock) {

Callers

nothing calls this directly

Calls 7

setHookMethod · 0.95
setInputBufferMethod · 0.95
toHexStringMethod · 0.80
recycleMethod · 0.65
clearMethod · 0.65
setMethod · 0.65
setLimitMethod · 0.45

Tested by

no test coverage detected