Skip to content

Commit

Permalink
3.3.0发布
Browse files Browse the repository at this point in the history
  • Loading branch information
tywo45 committed May 14, 2019
1 parent f3a8880 commit 0011864
Show file tree
Hide file tree
Showing 19 changed files with 90 additions and 165 deletions.
2 changes: 1 addition & 1 deletion src/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.t-io</groupId>
<artifactId>tio-parent</artifactId>
<version>3.2.9.v20190401-RELEASE</version>
<version>3.3.0.v20190512-RELEASE</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion src/core/src/main/java/org/tio/core/Tio.java
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ private static Boolean sendToSet(GroupContext groupContext, SetWithLock<ChannelC
if (isBlock) {
try {
long timeout = sendCount / 5;
timeout = timeout < 10 ? 10 : timeout;
timeout = Math.max(timeout, 10);//timeout < 10 ? 10 : timeout;
boolean awaitFlag = countDownLatch.await(timeout, TimeUnit.SECONDS);
if (!awaitFlag) {
log.error("{}, 同步群发超时, size:{}, timeout:{}, packet:{}", groupContext.getName(), setWithLock.getObj().size(), timeout, packet.logstr());
Expand Down
12 changes: 6 additions & 6 deletions src/parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>org.t-io</groupId>
<artifactId>tio-parent</artifactId>
<packaging>pom</packaging>
<version>3.2.9.v20190401-RELEASE</version>
<version>3.3.0.v20190512-RELEASE</version>
<name>${project.artifactId}</name>
<url>http://maven.apache.org</url>

Expand Down Expand Up @@ -35,7 +35,7 @@

<properties>
<maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>
<tio-utils.version>3.2.9.v20190401-RELEASE</tio-utils.version>
<tio-utils.version>3.3.0.v20190512-RELEASE</tio-utils.version>
<tio-core.version>${tio-utils.version}</tio-core.version>
<tio-flash-policy-server.version>${tio-utils.version}</tio-flash-policy-server.version>

Expand All @@ -62,7 +62,7 @@
<commons-compress.version>1.18</commons-compress.version>
<fastjson.version>1.2.58</fastjson.version>
<testng.version>6.14.3</testng.version>
<hutool.version>4.5.8</hutool.version>
<hutool.version>4.5.9</hutool.version>
<protobuf-java.version>3.7.1</protobuf-java.version>
<commons-beanutils.version>1.9.3</commons-beanutils.version>
<protobuf-java-format.version>1.4</protobuf-java-format.version>
Expand Down Expand Up @@ -411,7 +411,7 @@
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.11.3</version>
<version>1.12.1</version>
</dependency>

<dependency>
Expand All @@ -429,7 +429,7 @@
<dependency>
<groupId>nl.basjes.parse.useragent</groupId>
<artifactId>yauaa</artifactId>
<version>5.9</version>
<version>5.10</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -508,7 +508,7 @@
<dependency>
<groupId>io.github.classgraph</groupId>
<artifactId>classgraph</artifactId>
<version>4.8.29</version>
<version>4.8.34</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.paranamer</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.t-io</groupId>
<artifactId>tio-parent</artifactId>
<version>3.2.9.v20190401-RELEASE</version>
<version>3.3.0.v20190512-RELEASE</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion src/utils/src/main/java/org/tio/utils/SysConst.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
public interface SysConst {
String TIO_URL_GITHUB = "https://github.com/tywo45/t-io";
String TIO_URL_SITE = "https://www.t-io.org/";
String TIO_CORE_VERSION = "3.2.9.v20190401-RELEASE";
String TIO_CORE_VERSION = "3.3.0.v20190512-RELEASE";
/**
* \r
*/
Expand Down
2 changes: 1 addition & 1 deletion src/zoo/flash-policy-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.t-io</groupId>
<artifactId>tio-parent</artifactId>
<version>3.2.9.v20190401-RELEASE</version>
<version>3.3.0.v20190512-RELEASE</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion src/zoo/http/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.t-io</groupId>
<artifactId>tio-http-parent</artifactId>
<version>3.2.9.v20190401-RELEASE</version>
<version>3.3.0.v20190512-RELEASE</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion src/zoo/http/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.t-io</groupId>
<artifactId>tio-http-parent</artifactId>
<version>3.2.9.v20190401-RELEASE</version>
<version>3.3.0.v20190512-RELEASE</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

Expand Down
145 changes: 42 additions & 103 deletions src/zoo/http/common/src/main/java/org/tio/http/common/HttpConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,199 +30,138 @@
* 2017年8月15日 下午1:21:14
*/
public class HttpConfig {

private static Logger log = LoggerFactory.getLogger(HttpConfig.class);

private static Logger log = LoggerFactory.getLogger(HttpConfig.class);
/**
* 用于覆盖session cookie的参数名,客户端可以用这个传递sessionid
*/
public static final String TIO_HTTP_SESSIONID = "tio_http_sessionid";

public static final String TIO_HTTP_SESSIONID = "tio_http_sessionid";
/**
* 存放HttpSession对象的cacheName
*/
public static final String SESSION_CACHE_NAME = "tio-h-s";

public static final String SESSION_CACHE_NAME = "tio-h-s";
/**
* 存放sessionId的cookie value
*/
public static final String SESSION_COOKIE_NAME = "PHPSESSID";

public static final String SESSION_COOKIE_NAME = "PHPSESSID";
/**
* session默认的超时时间,单位:秒
*/
public static final long DEFAULT_SESSION_TIMEOUT = 30 * 60;

public static final long DEFAULT_SESSION_TIMEOUT = 30 * 60;
/**
* 默认的静态资源缓存时间,单位:秒
*/
public static final int MAX_LIVETIME_OF_STATICRES = 60 * 10;

public static final int MAX_LIVETIME_OF_STATICRES = 60 * 10;
/**
* 文件上传时,boundary值的最大长度
*/
public static final int MAX_LENGTH_OF_BOUNDARY = 512;

public static final int MAX_LENGTH_OF_BOUNDARY = 512;
/**
* 文件上传时,头部的最大长度
*/
public static final int MAX_LENGTH_OF_MULTI_HEADER = 512;

public static final int MAX_LENGTH_OF_MULTI_HEADER = 512;
/**
* 文件上传时,体的最大长度(默认值2M)
*/
public static final int MAX_LENGTH_OF_MULTI_BODY = 1024 * 1024 * 2;

public static final int MAX_LENGTH_OF_MULTI_BODY = 1024 * 1024 * 2;
/**
* 文件上传时,体的最大长度
*/
private int maxLengthOfMultiBody = MAX_LENGTH_OF_MULTI_BODY;

private int maxLengthOfMultiBody = MAX_LENGTH_OF_MULTI_BODY;
/**
*POST体的最大长度默认值(2M)
*/
public static final int MAX_LENGTH_OF_POST_BODY = 1024 * 1024 * 2;

public static final int MAX_LENGTH_OF_POST_BODY = 1024 * 1024 * 2;
/**
* POST体的最大长度
*/
private int maxLengthOfPostBody = MAX_LENGTH_OF_POST_BODY;

public static final int MAX_FORWARD_COUNT = 10;

/**
*
*/
public int maxForwardCount = MAX_FORWARD_COUNT;

private int maxLengthOfPostBody = MAX_LENGTH_OF_POST_BODY;
public static final int MAX_FORWARD_COUNT = 10;
public int maxForwardCount = MAX_FORWARD_COUNT;
/**
* 是否使用session
*/
private boolean useSession = true;

private boolean useSession = true;
/**
* 是否兼容1.0
* true:兼容
* false:不兼容
* 默认兼容
*/
public boolean compatible1_0 = true;

public boolean compatible1_0 = true;
/**
* 是否拼接http request header value
*
*/
private boolean appendRequestHeaderString = false;

private String bindIp = null;//"127.0.0.1";

private boolean appendRequestHeaderString = false;
private String bindIp = null; //"127.0.0.1";
/**
* 监听端口
*/
private Integer bindPort = 80;

private String serverInfo = HttpConst.SERVER_INFO;

private String charset = HttpConst.CHARSET_NAME;

private ICache sessionStore = null;

public SessionRateLimiter sessionRateLimiter;

private Integer bindPort = 80;
private String serverInfo = HttpConst.SERVER_INFO;
private String charset = HttpConst.CHARSET_NAME;
private ICache sessionStore = null;
public SessionRateLimiter sessionRateLimiter;
/**
* 访问路径前缀,譬如"/api"
*/
private String contextPath = "";

private String contextPath = "";
/**
* 加后缀,譬如".php"
*/
private String suffix = "";

private String suffix = "";
/**
* 如果访问路径是以"/"结束,则实际访问路径会自动加上welcomeFile,从而变成形如"/index.html"的路径
*/
private String welcomeFile = null;//"index.html";

private String welcomeFile = null; //"index.html";
/**
* 允许访问的域名,如果不限制,则为null
*/
private String[] allowDomains = null;

private String[] allowDomains = null;
/**
* 存放HttpSession对象的cacheName
*/
private String sessionCacheName = SESSION_CACHE_NAME;

private String sessionCacheName = SESSION_CACHE_NAME;
/**
* session超时时间,单位:秒
*/
private long sessionTimeout = DEFAULT_SESSION_TIMEOUT;

private String sessionCookieName = SESSION_COOKIE_NAME;

private long sessionTimeout = DEFAULT_SESSION_TIMEOUT;
private String sessionCookieName = SESSION_COOKIE_NAME;
/**
* 静态资源缓存时间,如果小于等于0则不缓存,单位:秒
*/
private int maxLiveTimeOfStaticRes = MAX_LIVETIME_OF_STATICRES;

private String page404 = "/404.html";

// private HttpSessionManager httpSessionManager;

private String page500 = "/500.html";

private ISessionIdGenerator sessionIdGenerator;

private HttpRequestHandler httpRequestHandler;

private int maxLiveTimeOfStaticRes = MAX_LIVETIME_OF_STATICRES;
private String page404 = "/404.html";
private String page500 = "/500.html";
private ISessionIdGenerator sessionIdGenerator;
private HttpRequestHandler httpRequestHandler;
/**
* ip被拉黑时,服务器给的响应,如果是null,服务器会直接断开连接
*/
private HttpResponse respForBlackIp = null;

private HttpResponse respForBlackIp = null;
/**
* 是否被代理
*/
private boolean isProxied = false;

private boolean isProxied = false;
/**
* 示例:
* 1、classpath中:page
* 2、绝对路径:/page
*/
private String pageRoot = null;//FileUtil.getAbsolutePath("page");//"/page";

private boolean pageInClasspath = false;

private String pageRoot = null; //FileUtil.getAbsolutePath("page");//"/page";
private boolean pageInClasspath = false;
/**
* 临时支持freemarker,主要用于开发环境中的前端开发,暂时不重点作为tio-http-server功能<br>
* 请大家暂时不要使用该功能,因为api随时会变
*/
private FreemarkerConfig freemarkerConfig = null;

private FreemarkerConfig freemarkerConfig = null;
/**
* 域名和页面根目录映射。当客户端通过不同域名访问时,其页面根目录是不一样的<br>
* key: www.t-io.org<br>
* value: 域名对应的页面根目录<br>
*/
private volatile Map<String, String> domainPageMap = null;//new HashMap<>();

public boolean checkHost = true;

// /**
// * @return the httpSessionManager
// */
// public HttpSessionManager getHttpSessionManager() {
// return httpSessionManager;
// }
//
// /**
// * @param httpSessionManager the httpSessionManager to set
// */
// public void setHttpSessionManager(HttpSessionManager httpSessionManager) {
// this.httpSessionManager = httpSessionManager;
// }
private volatile Map<String, String> domainPageMap = null; //new HashMap<>();
public boolean checkHost = true;

public Map<String, String> getDomainPageMap() {
return domainPageMap;
Expand Down
Loading

0 comments on commit 0011864

Please sign in to comment.