本文整理了Java中org.jboss.netty.handler.codec.http.HttpRequest.isChunked()
方法的一些代码示例,展示了HttpRequest.isChunked()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpRequest.isChunked()
方法的具体详情如下:
包路径:org.jboss.netty.handler.codec.http.HttpRequest
类名称:HttpRequest
方法名:isChunked
暂无
代码示例来源:origin: io.netty/netty
/**
*
* @param factory the factory used to create InterfaceHttpData
* @param request the request to decode
* @param charset the charset to use as default
* @throws NullPointerException for request or charset or factory
* @throws ErrorDataDecoderException if the default charset was wrong when decoding or other errors
*/
public HttpPostStandardRequestDecoder(HttpDataFactory factory, HttpRequest request,
Charset charset) throws ErrorDataDecoderException {
if (factory == null) {
throw new NullPointerException("factory");
}
if (request == null) {
throw new NullPointerException("request");
}
if (charset == null) {
throw new NullPointerException("charset");
}
this.request = request;
this.charset = charset;
this.factory = factory;
if (!this.request.isChunked()) {
undecodedChunk = this.request.getContent();
isLastChunk = true;
parseBody();
}
}
代码示例来源:origin: io.netty/netty
@Override
protected Object encode(ChannelHandlerContext ctx, Channel channel,
Object msg) throws Exception {
if (msg instanceof HttpRequest && !done) {
queue.offer(((HttpRequest) msg).getMethod());
}
Object obj = super.encode(ctx, channel, msg);
if (failOnMissingResponse) {
// check if the request is chunked if so do not increment
if (msg instanceof HttpRequest && !((HttpRequest) msg).isChunked()) {
requestResponseCounter.incrementAndGet();
} else if (msg instanceof HttpChunk && ((HttpChunk) msg).isLast()) {
// increment as its the last chunk
requestResponseCounter.incrementAndGet();
}
}
return obj;
}
}
代码示例来源:origin: voldemort/voldemort
if(request.isChunked()) {
readingChunks = true;
} else {
代码示例来源:origin: io.netty/netty
/**
*
* @param factory the factory used to create InterfaceHttpData
* @param request the request to decode
* @param charset the charset to use as default
* @throws NullPointerException for request or charset or factory
* @throws ErrorDataDecoderException if the default charset was wrong when decoding or other errors
*/
public HttpPostMultipartRequestDecoder(HttpDataFactory factory, HttpRequest request,
Charset charset) throws ErrorDataDecoderException {
if (factory == null) {
throw new NullPointerException("factory");
}
if (request == null) {
throw new NullPointerException("request");
}
if (charset == null) {
throw new NullPointerException("charset");
}
this.request = request;
this.charset = charset;
this.factory = factory;
// Fill default values
setMultipart(this.request.headers().get(HttpHeaders.Names.CONTENT_TYPE));
if (!this.request.isChunked()) {
undecodedChunk = this.request.getContent();
isLastChunk = true;
parseBody();
}
}
代码示例来源:origin: voldemort/voldemort
logger.debug("Admin Request URI: " + requestURI);
if(request.isChunked()) {
readingChunks = true;
} else {
代码示例来源:origin: neilbeveridge/zuul-netty
@Override
public void operationComplete(ChannelFuture future) throws Exception {
final Channel outboundChannel = future.getChannel();
LOG.debug("writing request to connection {}", connection.getId());
//write request onto established connection
performWrite(inboundChannel, outboundChannel, request);
//don't do lock acquisition unless we really must - this is the trunk road
if (request.isChunked()) {
synchronized (queuedChunks) {
performChunkWrite(inboundChannel, outboundChannel, queuedChunks);
HttpProxyHandler.this.doneSendingRequestAndBuffer = true;
}
}
HttpProxyHandler.this.doneSendingRequestAndBuffer = true;
}
代码示例来源:origin: org.openmobster.core/dataService
if(!request.isChunked())
代码示例来源:origin: fjfd/microscope
/**
* Finds the right handler for an HTTP query and executes it.
*
* @param chan The channel on which the query was received.
* @param req The parsed HTTP request.
*/
private void handleHttpQuery(final Channel chan, final HttpRequest req) {
http_rpcs_received.incrementAndGet();
final HttpQuery query = new HttpQuery(req, chan);
if (req.isChunked()) {
logError(query, "Received an unsupported chunked request: "
+ query.request());
query.badRequest("Chunked request not supported.");
return;
}
try {
final HttpRpc rpc = http_commands.get(getEndPoint(query));
if (rpc != null) {
rpc.execute(tsdb, query);
} else {
query.notFound();
}
} catch (BadRequestException ex) {
query.badRequest(ex.getMessage());
} catch (Exception ex) {
query.internalError(ex);
exceptions_caught.incrementAndGet();
}
}
代码示例来源:origin: landy8530/netty-file-parent
if (request.isChunked()) { //说明还没有请求完成,继续
this.readingChunks = true;
LOGGER.info("文件分块操作....");
代码示例来源:origin: org.graylog2/jersey-netty
if (e.getMessage() instanceof DefaultHttpRequest) {
httpRequest = (DefaultHttpRequest) e.getMessage();
if (httpRequest.isChunked()) {
chunkedRequestAssembler.setup(e.getChannel(), httpRequest);
代码示例来源:origin: org.vert-x/vertx-core
if (!request.isChunked()) {
if (!paused) {
handleEnd();
内容来源于网络,如有侵权,请联系作者删除!