trafficserver-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Balsa <er...@apache.org>
Subject Re: doing remap not in a remap plugin
Date Sun, 12 Jun 2011 21:58:46 GMT
Did you remember to use TSSkipRemappingSet(TSHttpTxn txnp, int flag) I
added a while back so the SM jumps to POST_REMAP instead of requiring
a remap? Give that a try...

--Eric

On Sun, Jun 12, 2011 at 2:48 PM, Earle, Erik <Erik.Earle@disney.com> wrote:
> I'm attempting to do remap in a regular plugin by rewriting the url in the
> PRE_REMAP step.  Doesn't seem to work that way.  Am I missing a step?
>
> switch (event) {
>   case TS_EVENT_HTTP_PRE_REMAP:
>    ...
>     if (TSHttpHdrUrlGet(bufp, hdr_loc, &url_loc)!=TS_SUCCESS) {
>         TSError("couldn't retrieve request url");
>         TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
>         return;
>     }
>     if (TSUrlSchemeSet(bufp, url_loc, TS_URL_SCHEME_HTTP, -1) == TS_ERROR) {
>         TSError("Unable to set scheme in URL in the HTTP Header");
>     }
>     if (TSUrlHostSet(bufp, url_loc, "www.w3.org", -1) == TS_ERROR) {
>         TSError("Unable to set host in URL in the HTTP Header");
>     }
>     if (TSUrlPortSet(bufp, url_loc, 80) == TS_ERROR) {
>         TSError("Unable to set port in URL in the HTTP Header");
>     }
>     if (TSUrlPathSet(bufp, url_loc, "/", -1) == TS_ERROR) {
>         TSError("Unable to set path in URL in the HTTP Header");
>     }

Mime
View raw message