Created
November 27, 2012 18:39
-
-
Save hostmaster/4156129 to your computer and use it in GitHub Desktop.
transformable_request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int | |
transformable_request (TSHttpTxn txnp) | |
{ | |
TSMBuffer req_bufp; | |
TSMLoc req_loc; | |
TSMLoc field_loc; | |
const char* user_agent_value = NULL; | |
int user_agent_length = -1; | |
TSHttpTxnClientReqGet(txnp, &req_bufp, &req_loc); | |
field_loc = TSMimeHdrFieldFind(req_bufp, req_loc, TS_MIME_FIELD_USER_AGENT, TS_MIME_LEN_USER_AGENT); | |
user_agent_value = TSMimeHdrFieldValueStringGet(req_bufp, req_loc, field_loc, 0, &user_agent_length); | |
TSDebug(DBG_TAG, "UA: %s", user_agent_value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment