2009-11-17 06:12:55 +01:00
|
|
|
/*
|
2012-06-04 22:31:44 +02:00
|
|
|
* Copyright 2012 The Netty Project
|
2009-11-17 06:12:55 +01:00
|
|
|
*
|
2011-12-09 06:18:34 +01:00
|
|
|
* The Netty Project licenses this file to you under the Apache License,
|
|
|
|
* version 2.0 (the "License"); you may not use this file except in compliance
|
|
|
|
* with the License. You may obtain a copy of the License at:
|
2009-11-17 06:12:55 +01:00
|
|
|
*
|
2012-06-04 22:31:44 +02:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2009-11-17 06:12:55 +01:00
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
2011-12-09 06:18:34 +01:00
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
2009-11-17 06:12:55 +01:00
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
|
|
|
*/
|
2011-12-09 04:38:59 +01:00
|
|
|
package io.netty.handler.codec.http;
|
2009-11-17 06:12:55 +01:00
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
import io.netty.buffer.ByteBuf;
|
|
|
|
import io.netty.buffer.Unpooled;
|
|
|
|
import io.netty.handler.codec.DecoderResult;
|
2009-11-17 06:12:55 +01:00
|
|
|
|
|
|
|
/**
|
2013-01-14 16:52:30 +01:00
|
|
|
* The last {@link HttpContent} which has trailing headers.
|
2009-11-17 06:12:55 +01:00
|
|
|
*/
|
2013-01-14 16:52:30 +01:00
|
|
|
public interface LastHttpContent extends HttpContent {
|
2009-11-17 06:12:55 +01:00
|
|
|
|
|
|
|
/**
|
2013-01-16 05:22:50 +01:00
|
|
|
* The 'end of content' marker in chunked encoding.
|
2012-01-13 09:41:18 +01:00
|
|
|
*/
|
2013-01-16 05:22:50 +01:00
|
|
|
LastHttpContent EMPTY_LAST_CONTENT = new LastHttpContent() {
|
2009-11-17 06:12:55 +01:00
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
@Override
|
2013-05-01 10:04:43 +02:00
|
|
|
public ByteBuf content() {
|
2013-01-16 05:22:50 +01:00
|
|
|
return Unpooled.EMPTY_BUFFER;
|
|
|
|
}
|
2009-11-17 06:12:55 +01:00
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
@Override
|
|
|
|
public LastHttpContent copy() {
|
|
|
|
return EMPTY_LAST_CONTENT;
|
|
|
|
}
|
2010-01-08 09:29:37 +01:00
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
@Override
|
|
|
|
public HttpHeaders trailingHeaders() {
|
|
|
|
return HttpHeaders.EMPTY_HEADERS;
|
|
|
|
}
|
2009-11-17 06:12:55 +01:00
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
@Override
|
2013-01-30 07:42:18 +01:00
|
|
|
public DecoderResult getDecoderResult() {
|
2013-01-16 05:22:50 +01:00
|
|
|
return DecoderResult.SUCCESS;
|
|
|
|
}
|
2009-11-17 06:12:55 +01:00
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
@Override
|
2013-01-30 07:42:18 +01:00
|
|
|
public void setDecoderResult(DecoderResult result) {
|
2013-01-16 05:22:50 +01:00
|
|
|
throw new UnsupportedOperationException("read only");
|
|
|
|
}
|
2009-11-17 06:12:55 +01:00
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
@Override
|
2013-02-10 05:10:09 +01:00
|
|
|
public int refCnt() {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2013-02-13 08:09:33 +01:00
|
|
|
public LastHttpContent retain() {
|
|
|
|
return this;
|
|
|
|
}
|
2013-02-10 05:10:09 +01:00
|
|
|
|
|
|
|
@Override
|
2013-02-13 08:09:33 +01:00
|
|
|
public LastHttpContent retain(int increment) {
|
|
|
|
return this;
|
|
|
|
}
|
2013-02-10 05:10:09 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean release() {
|
2013-01-16 05:22:50 +01:00
|
|
|
return false;
|
|
|
|
}
|
2009-11-17 06:12:55 +01:00
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
@Override
|
2013-02-10 05:10:09 +01:00
|
|
|
public boolean release(int decrement) {
|
|
|
|
return false;
|
2013-01-16 05:22:50 +01:00
|
|
|
}
|
|
|
|
};
|
2009-11-17 06:12:55 +01:00
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
HttpHeaders trailingHeaders();
|
2009-11-17 06:12:55 +01:00
|
|
|
|
2013-01-16 05:22:50 +01:00
|
|
|
@Override
|
|
|
|
LastHttpContent copy();
|
2013-02-13 08:09:33 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
LastHttpContent retain(int increment);
|
|
|
|
|
|
|
|
@Override
|
|
|
|
LastHttpContent retain();
|
2009-11-17 06:12:55 +01:00
|
|
|
}
|