merged https://github.com/alibaba/tengine/pull/334/files
thanks to yaoweibin