You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Leif Hedstrom (JIRA)" <ji...@apache.org> on 2010/11/03 23:27:24 UTC

[jira] Created: (TS-507) INKUrlHostSet does not work in INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK

INKUrlHostSet does not work in INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK
-------------------------------------------------------------------

                 Key: TS-507
                 URL: https://issues.apache.org/jira/browse/TS-507
             Project: Traffic Server
          Issue Type: Bug
    Affects Versions: 2.1.3
            Reporter: Leif Hedstrom
             Fix For: 2.1.4


As of the transparent proxy merge (TS-291, SVN commit # 992187), the attached code (see separate attachment) does not long work. Basically, the plugin is intended to run instead of a "remap" rule, in a INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK. With versions of ATS before this TS-291 commit, it works fine (it'll set the URL and Host: header properly), but after this commit, it breaks.

Going back to earlier ATS versions do not show this problem.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-507) INKUrlHostSet does not work in INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK

Posted by "Alan M. Carroll (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12928099#action_12928099 ] 

Alan M. Carroll commented on TS-507:
------------------------------------

Temporary fix for testing.

Index: proxy/InkAPI.cc
===================================================================
--- proxy/InkAPI.cc	(revision 1030809)
+++ proxy/InkAPI.cc	(working copy)
@@ -5239,6 +5239,7 @@
     *bufp = hptr;
     *obj = hptr->m_http;
     sdk_sanity_check_mbuffer(*bufp);
+    hptr->mark_target_dirty();
 
     return 1;
   } else {


> INKUrlHostSet does not work in INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK
> -------------------------------------------------------------------
>
>                 Key: TS-507
>                 URL: https://issues.apache.org/jira/browse/TS-507
>             Project: Traffic Server
>          Issue Type: Bug
>    Affects Versions: 2.1.3
>            Reporter: Leif Hedstrom
>             Fix For: 2.1.4
>
>         Attachments: test.cc
>
>
> As of the transparent proxy merge (TS-291, SVN commit # 992187), the attached code (see separate attachment) does not long work. Basically, the plugin is intended to run instead of a "remap" rule, in a INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK. With versions of ATS before this TS-291 commit, it works fine (it'll set the URL and Host: header properly), but after this commit, it breaks.
> Going back to earlier ATS versions do not show this problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-507) INKUrlHostSet does not work in INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12928050#action_12928050 ] 

Leif Hedstrom commented on TS-507:
----------------------------------

I should point out that this is (as far as I can tell) only a problem in reverse proxy mode. E.g. if I test this with a request like


curl http://localhost/


I expect it to fetch http://www.ogre.com/


> INKUrlHostSet does not work in INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK
> -------------------------------------------------------------------
>
>                 Key: TS-507
>                 URL: https://issues.apache.org/jira/browse/TS-507
>             Project: Traffic Server
>          Issue Type: Bug
>    Affects Versions: 2.1.3
>            Reporter: Leif Hedstrom
>             Fix For: 2.1.4
>
>         Attachments: test.cc
>
>
> As of the transparent proxy merge (TS-291, SVN commit # 992187), the attached code (see separate attachment) does not long work. Basically, the plugin is intended to run instead of a "remap" rule, in a INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK. With versions of ATS before this TS-291 commit, it works fine (it'll set the URL and Host: header properly), but after this commit, it breaks.
> Going back to earlier ATS versions do not show this problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TS-507) INKUrlHostSet does not work in INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK

Posted by "Alan M. Carroll (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alan M. Carroll updated TS-507:
-------------------------------

    Attachment: ts-507-patch.txt

Temporary patch for testing.

> INKUrlHostSet does not work in INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK
> -------------------------------------------------------------------
>
>                 Key: TS-507
>                 URL: https://issues.apache.org/jira/browse/TS-507
>             Project: Traffic Server
>          Issue Type: Bug
>    Affects Versions: 2.1.3
>            Reporter: Leif Hedstrom
>             Fix For: 2.1.4
>
>         Attachments: test.cc, ts-507-patch.txt
>
>
> As of the transparent proxy merge (TS-291, SVN commit # 992187), the attached code (see separate attachment) does not long work. Basically, the plugin is intended to run instead of a "remap" rule, in a INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK. With versions of ATS before this TS-291 commit, it works fine (it'll set the URL and Host: header properly), but after this commit, it breaks.
> Going back to earlier ATS versions do not show this problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TS-507) INKUrlHostSet does not work in INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leif Hedstrom updated TS-507:
-----------------------------

    Attachment: test.cc

With this plugin, I expect all requests to get proxied to www.ogre.com. It works up until the TS-291 commit (I think).

> INKUrlHostSet does not work in INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK
> -------------------------------------------------------------------
>
>                 Key: TS-507
>                 URL: https://issues.apache.org/jira/browse/TS-507
>             Project: Traffic Server
>          Issue Type: Bug
>    Affects Versions: 2.1.3
>            Reporter: Leif Hedstrom
>             Fix For: 2.1.4
>
>         Attachments: test.cc
>
>
> As of the transparent proxy merge (TS-291, SVN commit # 992187), the attached code (see separate attachment) does not long work. Basically, the plugin is intended to run instead of a "remap" rule, in a INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK. With versions of ATS before this TS-291 commit, it works fine (it'll set the URL and Host: header properly), but after this commit, it breaks.
> Going back to earlier ATS versions do not show this problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-507) INKUrlHostSet does not work in INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12929730#action_12929730 ] 

Leif Hedstrom commented on TS-507:
----------------------------------

Ignore that last commit, it was intended for TS-500.

> INKUrlHostSet does not work in INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK
> -------------------------------------------------------------------
>
>                 Key: TS-507
>                 URL: https://issues.apache.org/jira/browse/TS-507
>             Project: Traffic Server
>          Issue Type: Bug
>    Affects Versions: 2.1.3
>            Reporter: Leif Hedstrom
>             Fix For: 2.1.4
>
>         Attachments: test.cc, ts-507-patch.txt
>
>
> As of the transparent proxy merge (TS-291, SVN commit # 992187), the attached code (see separate attachment) does not long work. Basically, the plugin is intended to run instead of a "remap" rule, in a INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK. With versions of ATS before this TS-291 commit, it works fine (it'll set the URL and Host: header properly), but after this commit, it breaks.
> Going back to earlier ATS versions do not show this problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (TS-507) INKUrlHostSet does not work in INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK

Posted by "Alan M. Carroll (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alan M. Carroll reassigned TS-507:
----------------------------------

    Assignee: Alan M. Carroll

> INKUrlHostSet does not work in INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK
> -------------------------------------------------------------------
>
>                 Key: TS-507
>                 URL: https://issues.apache.org/jira/browse/TS-507
>             Project: Traffic Server
>          Issue Type: Bug
>    Affects Versions: 2.1.3
>            Reporter: Leif Hedstrom
>            Assignee: Alan M. Carroll
>             Fix For: 2.1.4
>
>         Attachments: test.cc, ts-507-patch.txt
>
>
> As of the transparent proxy merge (TS-291, SVN commit # 992187), the attached code (see separate attachment) does not long work. Basically, the plugin is intended to run instead of a "remap" rule, in a INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK. With versions of ATS before this TS-291 commit, it works fine (it'll set the URL and Host: header properly), but after this commit, it breaks.
> Going back to earlier ATS versions do not show this problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TS-507) INKUrlHostSet does not work in INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK

Posted by "Alan M. Carroll (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alan M. Carroll resolved TS-507.
--------------------------------

    Resolution: Fixed

I applied the patch, which fixes the problem for known uses. It's not a complete fix. The problem can still occur if a plugin carries state between callbacks (e.g., gets a URL object in one callback, caches it, and then uses it in another callback for that transaction). I consider that use case sufficiently unlikely to be tolerable for a point release.

A full fix will require significantly more work. The problem is that HTTPHdr class needs tgo cache the URL text for performance reasons, but the plugin API returns the underlyilng HTTDHdrImpl instance, bypassing the wrapper class. Beyond that it can also return the raw URL object, bypassing even the HTTPHdrImpl class. A full solution would be to force the API to go through the HTTPHdr class, even when it was putatively returning a URL instance, or to keep generation numbers in the HTTPHdrImpl and URLImpl classes which could be checked by caching logic in the wrapper classes. My personal opinion is that exposing the internal workings of a wrapper class is a Bad Thing and should be changed. But that's not a simple change.

> INKUrlHostSet does not work in INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK
> -------------------------------------------------------------------
>
>                 Key: TS-507
>                 URL: https://issues.apache.org/jira/browse/TS-507
>             Project: Traffic Server
>          Issue Type: Bug
>    Affects Versions: 2.1.3
>            Reporter: Leif Hedstrom
>            Assignee: Alan M. Carroll
>             Fix For: 2.1.4
>
>         Attachments: test.cc, ts-507-patch.txt
>
>
> As of the transparent proxy merge (TS-291, SVN commit # 992187), the attached code (see separate attachment) does not long work. Basically, the plugin is intended to run instead of a "remap" rule, in a INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK. With versions of ATS before this TS-291 commit, it works fine (it'll set the URL and Host: header properly), but after this commit, it breaks.
> Going back to earlier ATS versions do not show this problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TS-507) INKUrlHostSet does not work in INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK

Posted by "Alan M. Carroll (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alan M. Carroll updated TS-507:
-------------------------------

    Comment: was deleted

(was: Temporary fix for testing.

Index: proxy/InkAPI.cc
===================================================================
--- proxy/InkAPI.cc	(revision 1030809)
+++ proxy/InkAPI.cc	(working copy)
@@ -5239,6 +5239,7 @@
     *bufp = hptr;
     *obj = hptr->m_http;
     sdk_sanity_check_mbuffer(*bufp);
+    hptr->mark_target_dirty();
 
     return 1;
   } else {
)

> INKUrlHostSet does not work in INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK
> -------------------------------------------------------------------
>
>                 Key: TS-507
>                 URL: https://issues.apache.org/jira/browse/TS-507
>             Project: Traffic Server
>          Issue Type: Bug
>    Affects Versions: 2.1.3
>            Reporter: Leif Hedstrom
>             Fix For: 2.1.4
>
>         Attachments: test.cc
>
>
> As of the transparent proxy merge (TS-291, SVN commit # 992187), the attached code (see separate attachment) does not long work. Basically, the plugin is intended to run instead of a "remap" rule, in a INK_HTTP_READ_REQUEST_PRE_REMAP_HOOK. With versions of ATS before this TS-291 commit, it works fine (it'll set the URL and Host: header properly), but after this commit, it breaks.
> Going back to earlier ATS versions do not show this problem.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.