chunked
This commit is contained in:
@@ -118,6 +118,13 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
|
|
||||||
private boolean expect = false; // 是否Expect:100-continue
|
private boolean expect = false; // 是否Expect:100-continue
|
||||||
|
|
||||||
|
// @since 2.8.0
|
||||||
|
protected boolean chunked = false;
|
||||||
|
|
||||||
|
protected int chunkedLength = -1;
|
||||||
|
|
||||||
|
protected byte[] chunkedHalfLenBytes;
|
||||||
|
|
||||||
protected boolean rpc;
|
protected boolean rpc;
|
||||||
|
|
||||||
protected int readState = READ_STATE_ROUTE;
|
protected int readState = READ_STATE_ROUTE;
|
||||||
@@ -153,8 +160,6 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
|
|
||||||
protected final HttpParameters params = HttpParameters.create();
|
protected final HttpParameters params = HttpParameters.create();
|
||||||
|
|
||||||
protected boolean chunked = false;
|
|
||||||
|
|
||||||
protected boolean boundary = false;
|
protected boolean boundary = false;
|
||||||
|
|
||||||
protected int moduleid;
|
protected int moduleid;
|
||||||
@@ -295,6 +300,10 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
return expect;
|
return expect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean isChunked() {
|
||||||
|
return chunked;
|
||||||
|
}
|
||||||
|
|
||||||
protected void setKeepAlive(boolean keepAlive) {
|
protected void setKeepAlive(boolean keepAlive) {
|
||||||
this.keepAlive = keepAlive;
|
this.keepAlive = keepAlive;
|
||||||
}
|
}
|
||||||
@@ -339,6 +348,8 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
this.keepAlive = httpLast.keepAlive;
|
this.keepAlive = httpLast.keepAlive;
|
||||||
this.maybews = httpLast.maybews;
|
this.maybews = httpLast.maybews;
|
||||||
this.expect = httpLast.expect;
|
this.expect = httpLast.expect;
|
||||||
|
this.chunked = httpLast.chunked;
|
||||||
|
this.chunkedLength = httpLast.chunkedLength;
|
||||||
this.rpc = httpLast.rpc;
|
this.rpc = httpLast.rpc;
|
||||||
this.traceid = httpLast.traceid;
|
this.traceid = httpLast.traceid;
|
||||||
this.currentUserid = httpLast.currentUserid;
|
this.currentUserid = httpLast.currentUserid;
|
||||||
@@ -1092,6 +1103,7 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
req.keepAlive = this.keepAlive;
|
req.keepAlive = this.keepAlive;
|
||||||
req.maybews = this.maybews;
|
req.maybews = this.maybews;
|
||||||
req.expect = this.expect;
|
req.expect = this.expect;
|
||||||
|
req.chunked = this.chunked;
|
||||||
req.rpc = this.rpc;
|
req.rpc = this.rpc;
|
||||||
req.traceid = this.traceid;
|
req.traceid = this.traceid;
|
||||||
req.currentUserid = this.currentUserid;
|
req.currentUserid = this.currentUserid;
|
||||||
@@ -1129,6 +1141,9 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
this.cookies = null;
|
this.cookies = null;
|
||||||
this.maybews = false;
|
this.maybews = false;
|
||||||
this.expect = false;
|
this.expect = false;
|
||||||
|
this.chunked = false;
|
||||||
|
this.chunkedLength = -1;
|
||||||
|
this.chunkedHalfLenBytes = null;
|
||||||
this.rpc = false;
|
this.rpc = false;
|
||||||
this.readState = READ_STATE_ROUTE;
|
this.readState = READ_STATE_ROUTE;
|
||||||
this.currentUserid = CURRUSERID_NIL;
|
this.currentUserid = CURRUSERID_NIL;
|
||||||
@@ -1146,7 +1161,6 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
this.requestPath = null;
|
this.requestPath = null;
|
||||||
this.queryBytes = null;
|
this.queryBytes = null;
|
||||||
this.boundary = false;
|
this.boundary = false;
|
||||||
this.chunked = false;
|
|
||||||
this.bodyParsed = false;
|
this.bodyParsed = false;
|
||||||
this.moduleid = 0;
|
this.moduleid = 0;
|
||||||
this.actionid = 0;
|
this.actionid = 0;
|
||||||
@@ -1176,7 +1190,7 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void unzipEncoding() {
|
protected void unzipEncoding() {
|
||||||
try {
|
try {
|
||||||
if ("gzip".contains(this.contentEncoding)) {
|
if ("gzip".contains(this.contentEncoding)) {
|
||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
@@ -1746,6 +1760,7 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
+ (this.protocol != null ? (", \r\n protocol: " + this.protocol) : "")
|
+ (this.protocol != null ? (", \r\n protocol: " + this.protocol) : "")
|
||||||
+ (this.getHost() != null ? (", \r\n host: " + this.host) : "")
|
+ (this.getHost() != null ? (", \r\n host: " + this.host) : "")
|
||||||
+ (this.getContentLength() >= 0 ? (", \r\n contentLength: " + this.contentLength) : "")
|
+ (this.getContentLength() >= 0 ? (", \r\n contentLength: " + this.contentLength) : "")
|
||||||
|
+ (this.contentEncoding != null ? (", \r\n contentEncoding: " + this.contentEncoding) : "")
|
||||||
+ (this.array.length() > 0 ? (", \r\n bodyLength: " + this.array.length()) : "")
|
+ (this.array.length() > 0 ? (", \r\n bodyLength: " + this.array.length()) : "")
|
||||||
+ (this.boundary || this.array.isEmpty()
|
+ (this.boundary || this.array.isEmpty()
|
||||||
? ""
|
? ""
|
||||||
|
|||||||
Reference in New Issue
Block a user