Skip to content

Commit dfd559f

Browse files
committed
小更新
1 parent 43192c2 commit dfd559f

File tree

3 files changed

+8
-20
lines changed

3 files changed

+8
-20
lines changed

README_ZH-CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## t-io简介
2-
t-io是基于java aio研发的网络编程框架
2+
t-io是基于java aio研发的网络编程框架,从收集到的案例来看,用t-io做物联网、IM、客服的比较多,堪称殿堂级网络开发框架
33
- [快速开始](https://www.tiomq.com/books/doc/126/1013):Show me the code and document
44
- [用户案例](https://www.tiomq.com/books/doc/36/1017):看看哪些人在使用t-io,并且愿意让大家知道他们使用了t-io
55
- [提交案例](https://www.tiomq.com/books/doc/36/1135):这将增加您产品的曝光率,让更多人知道您的产品

src/zoo/http/common/src/main/java/org/tio/http/common/HttpRequestDecoder.java

+3-16
Original file line numberDiff line numberDiff line change
@@ -225,17 +225,17 @@ public static enum Step {
225225
private static Logger log = LoggerFactory.getLogger(HttpRequestDecoder.class);
226226

227227
/**
228-
* 头部,最多有多少字节
228+
* 头部最多有多少字节
229229
*/
230230
public static final int MAX_LENGTH_OF_HEADER = 20480;
231231

232232
/**
233-
* 头部,每行最大的字节数
233+
* 头部每行最大的字节数
234234
*/
235235
public static final int MAX_LENGTH_OF_HEADERLINE = 2048;
236236

237237
/**
238-
* 请求行的最大长度
238+
* 请求行的最大长度
239239
*/
240240
public static final int MAX_LENGTH_OF_REQUESTLINE = 2048;
241241

@@ -253,23 +253,10 @@ public static enum Step {
253253
*/
254254
public static HttpRequest decode(ByteBuffer buffer, int limit, int position, int readableLength, ChannelContext channelContext, HttpConfig httpConfig)
255255
throws TioDecodeException {
256-
// int initPosition = position;
257-
// int count = 0;
258-
// Step step = Step.firstline;
259-
// StringBuilder currLine = new StringBuilder();
260256
Map<String, String> headers = new HashMap<>();
261257
int contentLength = 0;
262258
byte[] bodyBytes = null;
263-
// StringBuilder headerSb = null;//new StringBuilder(512);
264259
RequestLine firstLine = null;
265-
// boolean appendRequestHeaderString = httpConfig.isAppendRequestHeaderString();
266-
267-
// if (httpConfig != null) {
268-
//
269-
// }
270-
// if (appendRequestHeaderString) {
271-
// headerSb = new StringBuilder(512);
272-
// }
273260

274261
// request line start
275262
firstLine = parseRequestLine(buffer, channelContext);

src/zoo/http/server/src/main/java/org/tio/http/server/session/DomainSessionCookieDecorator.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ recommend that a file or class name and description of purpose be included on
200200
import org.slf4j.LoggerFactory;
201201
import org.tio.http.common.Cookie;
202202
import org.tio.http.common.HttpRequest;
203+
import org.tio.utils.hutool.StrUtil;
203204

204205
/**
205206
* @author tanyaowu
@@ -223,10 +224,10 @@ public class DomainSessionCookieDecorator implements SessionCookieDecorator {
223224
*/
224225
public DomainSessionCookieDecorator(String domain) {
225226
this.domain = domain;
226-
227227
Map<String, String> domainMap = new HashMap<>();
228-
domainMap.put("(.)*(" + domain + "){1}", domain);
229-
228+
if (StrUtil.isNotBlank(domain)) {
229+
domainMap.put("(.)*(" + domain + "){1}", domain);
230+
}
230231
domainMappingSessionCookieDecorator = new DomainMappingSessionCookieDecorator(domainMap);
231232
}
232233

0 commit comments

Comments
 (0)