You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by James Peach <ja...@me.com> on 2012/01/06 06:27:09 UTC
TSFetchUrl return value depends on wakeup options
Hi all,
So I was very confused that Brian Geffon and I were getting different results from TSFetchUrl() after the patch I posted in TS-1043. I went back to figure out what I did wrong and it turns out that TSFetchRespGet() returns different results depending on the TSFetchWakeUpOptions you give to TSFetchUrl().
If you pass AFTER_BODY, then TSFetchRespGet() will return the complete response, which you can then parse with a TSHttpParser. If you pass AFTER_HEADER, then TSFetchRespGet() will return NULL on the header event, and the response *body* (ie. the content sans HTTP and MIME headers) on the body event. My patch caused TSFetchUrl() to *always* parse the headers, thereby causing TSFetchRespGet() to always return just the content. Sigh.
J