Plugin test-transform Spec

 

Overview

This plugin is based on the null-transform sample plugin. It inserts several APIs in the TSIOBuffer*, TSVConn*, TSVIO* and other categories into the appropriate places for testing.

Feature Description

In the TSPluginInit(), the plugin calls a test_iobuffer() function, which tests the IOBuffer functions in the following way:

It creates an an IOBuffer and a full IOBufferBlock. Then it appends the block to the IOBuffer. Since the block in the IOBuffer is full, when TSIOBufferStart is called, it will add a new block to the IOBuffer and the its return value points to the new block. The plugin checks if this is true and prints out the pass/fail information to the log file. Then it gets the read avail of the first block and write avail of the second block of the IOBuffer and prints out the values to the log file.

The plugin instructs the HTTP state machine to cache the transform version of the server response. It tries to get the transform response header and if it succeeds, it adds a Content-Encoding: null header field to the transform header.

During the transformation process, the plugin gets the write VIO for the vconnection, and gets the mutex of the write VIO. This mutex should equal to the mutex of the continuation. If not, it prints out an error message to the log. It also gets the VConnection of the write VIO. It should equal to the continuation. If not, it prints out an error message to the log.