[
https://issues.apache.org/jira/browse/TS-3096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14148444#comment-14148444
]
Daniel Vitor Morilha commented on TS-3096:
------------------------------------------
Hi Alan,
here's an (incomplete) example I crafted where I see the problem:
static int fetcher(TSCont contp, TSEvent event, void *) {
TSDebug(PLUGIN_TAG, "\n\nvconnection: %p, closed: %d, event: %d\n\n",
contp, TSVConnClosedGet(contp), event);
}
template < class C >
void get(const std::string & request, const C & callback) {
struct sockaddr_in socket;
socket.sin_family = AF_INET;
socket.sin_port = 80;
socket.sin_addr.s_addr = 0x0100007f;
TSVConn vconn = TSHttpConnectWithPluginId(reinterpret_cast< sockaddr *
>(&socket), PLUGIN_TAG, 0);
if (vconn) {
TSCont contp = TSContCreate(fetcher< C >, NULL);
if (contp) {
HttpConnectState< C > * state = new HttpConnectState< C
>(request, vconn, callback);
state->out = IO::write(vconn, contp, request.size());
TSContDataSet(contp, state);
}
}
}
I tested with Yahoo's Traffic Server version, so I don't know how to map that
with the outside world version.
> After TS-2751 TSVConnClosedGet changed its behaviour
> ----------------------------------------------------
>
> Key: TS-3096
> URL: https://issues.apache.org/jira/browse/TS-3096
> Project: Traffic Server
> Issue Type: Bug
> Components: TS API
> Reporter: Daniel Vitor Morilha
> Priority: Critical
> Fix For: 5.2.0
>
>
> One of our plug-ins initiates a background connection to an origin by using
> TSHttpConnect API.
> While handling the continuation events (WRITE, READ) the plug-in checks if
> the vconnection is still open by calling TSVConnClosedGet(vconnection).
> ATS recently changed the behavior. Now TSVConnClosedGet(vconnections) returns
> a value different than 0 before any data can be retrieved.
> If the call to TSVConnClosedGet is ignored the plug-in successfully writes
> the request and receives the response.
> By investigation our different Traffic Server versions the described change
> seems to be related with TS-2751.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)