Repository: trafficserver Updated Branches: refs/heads/master ecf3e5fbd -> 2309ec101
TS-2760: Add TSFetchClientProtoStackSet/Get() API in experimental.h Users need a way to set/get client protocol stack when working with TSFetchSM extended API. Actually, these two API had been implemented in Taobao's branch, I forgot to migrate them to ATS core, all it's my wrong. Signed-off-by: Yunkai Zhang <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/3f0f40b6 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/3f0f40b6 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/3f0f40b6 Branch: refs/heads/master Commit: 3f0f40b678fcd519c6f29bf5493de4b9e71fc9d4 Parents: ecf3e5f Author: Yunkai Zhang <[email protected]> Authored: Sun Apr 27 15:28:59 2014 +0800 Committer: Yunkai Zhang <[email protected]> Committed: Sun Apr 27 15:28:59 2014 +0800 ---------------------------------------------------------------------- CHANGES | 2 ++ proxy/InkAPI.cc | 16 ++++++++++++++++ proxy/api/ts/experimental.h | 17 +++++++++++++++++ 3 files changed, 35 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3f0f40b6/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index c396f1b..0c78519 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes with Apache Traffic Server 5.0.0 + *) [TS-2760] Add TSFetchClientProtoStackSet/Get() API in experimental.h. + *) [TS-2743] Ignore invalid HTTP headers in SpdyNV carefully. *) [TS-2742] TSFetchCreate should accept both IPv4 and IPv6. http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3f0f40b6/proxy/InkAPI.cc ---------------------------------------------------------------------- diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc index a8a410b..501d931 100644 --- a/proxy/InkAPI.cc +++ b/proxy/InkAPI.cc @@ -7352,6 +7352,22 @@ TSFetchUserDataSet(TSFetchSM fetch_sm, void *data) ((FetchSM*)fetch_sm)->ext_set_user_data(data); } +void +TSFetchClientProtoStackSet(TSFetchSM fetch_sm, TSClientProtoStack proto_stack) +{ + sdk_assert(sdk_sanity_check_fetch_sm(fetch_sm) == TS_SUCCESS); + + ((FetchSM*)fetch_sm)->ext_set_proto_stack(proto_stack); +} + +TSClientProtoStack +TSFetchClientProtoStackGet(TSFetchSM fetch_sm) +{ + sdk_assert(sdk_sanity_check_fetch_sm(fetch_sm) == TS_SUCCESS); + + return ((FetchSM*)fetch_sm)->ext_get_proto_stack(); +} + void* TSFetchUserDataGet(TSFetchSM fetch_sm) { http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3f0f40b6/proxy/api/ts/experimental.h ---------------------------------------------------------------------- diff --git a/proxy/api/ts/experimental.h b/proxy/api/ts/experimental.h index 8621158..a36dc3e 100644 --- a/proxy/api/ts/experimental.h +++ b/proxy/api/ts/experimental.h @@ -700,6 +700,23 @@ extern "C" tsapi void TSFetchDestroy(TSFetchSM fetch_sm); /* + * Set client protocol stack in FetchSM + * + * @param fetch_sm: returned value of TSFetchCreate(). + * @param proto_stack: client protocol stack. + */ + tsapi void TSFetchClientProtoStackSet(TSFetchSM fetch_sm, TSClientProtoStack proto_stack); + + /* + * Get client protocol stack in FetchSM + * + * @param fetch_sm: returned value of TSFetchCreate(). + * + * return the client protocol stack of fetch_sm. + */ + tsapi TSClientProtoStack TSFetchClientProtoStackGet(TSFetchSM fetch_sm); + + /* * Set user-defined data in FetchSM */ tsapi void TSFetchUserDataSet(TSFetchSM fetch_sm, void *data);
