The request header of the HTTP protocol is more like a key-value pair, such as content-length:123, preceded by a key followed by a value that indicates a text length of 123. For several headers that are encapsulated as mimeheaders objects in the Request object, the Mimeheaders object contains a list structure for storing the header and header values. As above, each Mimeheaderfield object points to its predecessor node object, which also points to its successor object, which facilitates fast searching and also helps the JVM garbage collector recycle. But strangely, although designed as a doubly-linked list structure, it is not actually used, that is, there is no prev, next association, but just an array structure mimeheaderfield[], as shown in the picture below, what does the Tomcat developer think about this? But do not have to be too tangled, the structure of the difference is only the way of traversal, the main structure is the same, that is, as a unit of Mimeheaderfield, which represents a head, which contains the name, value, respectively, is used to hold the key value pairs of the head.
Like to study Java classmate can make a friend, the following is my number:
Head--mimeheaders