oxwangfeng / ats_slice_range Goto Github PK
View Code? Open in Web Editor NEW这个是自己写的ats的插件,用于解决大文件的分片存储问题,相比官方提供的range插件功能更多,也更全面。
这个是自己写的ats的插件,用于解决大文件的分片存储问题,相比官方提供的range插件功能更多,也更全面。
//add by wangfeng
if(get_content_length(txnp, txn_state) == false){
DEBUG_LOG("warnning. response is not include content_length, attempting to disable cache write.");
TSHttpHdrReasonSet(response, resp_hdr, "oxwangfeng",10);
TSHandleMLocRelease(response, resp_hdr, NULL);
return;
}
这样处理不太合适吧,不知道贵司cdn还好不,这地方的逻辑,会导致304回源有问题吧。
在range_header_check(TSHttpTxn txnp){} 函数中,txn_state->range_value = TSstrndup(hdr_value, length);
而在ats的文档中,对TSstrdup()函数,有如下说明:
func:TSstrdup
returns a pointer to a new string that is a duplicate of the string pointed to by str. The memory for the new string is allocated using :func:TSmalloc
and should be freed by a call to
:func:TSfree
.
在transfrom_data_destroy(TransfromData * data)函数中,只是TSfree(data),这个会释放data->range_value么,我觉得应该需要先调用TSfree(data->range_value)。因为代码中并没有显示释放这块内存。
Hey :
最近在看你的插件 你的插件是不是代码上有点问题
能否确认上面2个问题 存在的话 编译不通过 我用的ATS 版本不是最新的 比较旧 。
Thanks 。
TS_MIME_LEN_CACHE_CONTROL 是不是应该是TS_MIME_LEN_CONTENT_LENGTH 🙃
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.