Refine search
final int startReaderIndex = undecodedChunk.readerIndex(); final int delimeterLength = delimiter.length(); int index = 0; byte prevByte = HttpConstants.LF; boolean delimiterFound = false; while (undecodedChunk.isReadable()) { final byte nextByte = undecodedChunk.readByte(); ByteBuf content = undecodedChunk.copy(startReaderIndex, lastPosition - startReaderIndex); try { httpData.addContent(content, delimiterFound); } catch (IOException e) { throw new ErrorDataDecoderException(e);
private long readableBytes(HttpData httpData) throws IOException { if (httpData.isInMemory()) { return httpData.getByteBuf().readableBytes(); } else { return httpData.length(); } }
@Override public void cleanRequestHttpData(HttpRequest request) { List<HttpData> list = requestFileDeleteMap.remove(request); if (list != null) { for (HttpData data : list) { data.release(); } } }
while (hasNext.apply(decoder)) { HttpData field = (HttpData) decoder.next(); String name = field.getName(); if (field.getHttpDataType() == HttpDataType.FileUpload) { files.put(name, new NettyUpload((FileUpload) field, tmpdir)); } else { params.put(name, field.getString());
size -= buffer.readableBytes() + 1; if (currentBuffer.readableBytes() >= HttpPostBodyUtil.chunkSize) { buffer = fillByteBuf(); return new DefaultHttpContent(buffer); buffer = ((HttpData) currentData).getChunk(size); } catch (IOException e) { throw new ErrorDataEncoderException(e); if (buffer.readableBytes() < size) { isKey = true; delimiter = iterator.hasNext() ? wrappedBuffer("&".getBytes()) : null;
if (!undecodedChunk.hasArray()) { return loadDataMultipartStandard(undecodedChunk, delimiter, httpData); final int startReaderIndex = undecodedChunk.readerIndex(); final int delimeterLength = delimiter.length(); int index = 0; final ByteBuf content = undecodedChunk.copy(startReaderIndex, lastPosition - startReaderIndex); try { httpData.addContent(content, delimiterFound); } catch (IOException e) { throw new ErrorDataDecoderException(e);
private long resolveLength(ByteBufHolder message) { if (message instanceof HttpData) { return ((HttpData) message).length(); } else { return message.content().readableBytes(); } }
String name = data.getName(); Optional<Argument<?>> requiredInput = routeMatch.getRequiredInput(name); if (data.isCompleted() && chunkedProcessing) { subject.onComplete(); if (data instanceof Attribute && !data.isCompleted()) { request.addContent(data); s.request(1); } else { value = () -> { if (data.refCnt() > 0) { return data; } else {
} else { try { buffer = ((HttpData) currentData).getChunk(sizeleft); } catch (IOException e) { throw new ErrorDataEncoderException(e); if (buffer.capacity() == 0) { currentBuffer = wrappedBuffer(currentBuffer, buffer); if (currentBuffer.readableBytes() < HttpPostBodyUtil.chunkSize) { currentData = null; return null;
if (!undecodedChunk.hasArray()) { return loadDataMultipartStandard(undecodedChunk, delimiter, httpData); final int startReaderIndex = undecodedChunk.readerIndex(); final int delimeterLength = delimiter.length(); int index = 0; final ByteBuf content = undecodedChunk.copy(startReaderIndex, lastPosition - startReaderIndex); try { httpData.addContent(content, delimiterFound); } catch (IOException e) { throw new ErrorDataDecoderException(e);
private long resolveLength(ByteBufHolder message) { if (message instanceof HttpData) { return ((HttpData) message).length(); } else { return message.content().readableBytes(); } }
while (hasNext.apply(decoder)) { HttpData field = (HttpData) decoder.next(); String name = field.getName(); if (field.getHttpDataType() == HttpDataType.FileUpload) { files.put(name, new NettyUpload((FileUpload) field, tmpdir)); } else { params.put(name, field.getString());
} else { try { buffer = ((HttpData) currentData).getChunk(sizeleft); } catch (IOException e) { throw new ErrorDataEncoderException(e); if (buffer.capacity() == 0) { currentBuffer = wrappedBuffer(currentBuffer, buffer); if (currentBuffer.readableBytes() < HttpPostBodyUtil.chunkSize) { currentData = null; return null;
final int startReaderIndex = undecodedChunk.readerIndex(); final int delimeterLength = delimiter.length(); int index = 0; byte prevByte = HttpConstants.LF; boolean delimiterFound = false; while (undecodedChunk.isReadable()) { final byte nextByte = undecodedChunk.readByte(); ByteBuf content = undecodedChunk.copy(startReaderIndex, lastPosition - startReaderIndex); try { httpData.addContent(content, delimiterFound); } catch (IOException e) { throw new ErrorDataDecoderException(e);
if (!undecodedChunk.hasArray()) { return loadDataMultipartStandard(undecodedChunk, delimiter, httpData); final int startReaderIndex = undecodedChunk.readerIndex(); final int delimeterLength = delimiter.length(); int index = 0; final ByteBuf content = undecodedChunk.copy(startReaderIndex, lastPosition - startReaderIndex); try { httpData.addContent(content, delimiterFound); } catch (IOException e) { throw new ErrorDataDecoderException(e);
@Override public void cleanAllHttpData() { Iterator<Entry<HttpRequest, List<HttpData>>> i = requestFileDeleteMap.entrySet().iterator(); while (i.hasNext()) { Entry<HttpRequest, List<HttpData>> e = i.next(); // Calling i.remove() here will cause "java.lang.IllegalStateException: Entry was removed" // at e.getValue() below List<HttpData> list = e.getValue(); for (HttpData data : list) { data.release(); } i.remove(); } }
size -= buffer.readableBytes() + 1; if (currentBuffer.readableBytes() >= HttpPostBodyUtil.chunkSize) { buffer = fillByteBuf(); return new DefaultHttpContent(buffer); buffer = ((HttpData) currentData).getChunk(size); } catch (IOException e) { throw new ErrorDataEncoderException(e); if (buffer.readableBytes() < size) { isKey = true; delimiter = iterator.hasNext() ? wrappedBuffer("&".getBytes()) : null;