class documentation
class HttpMessageReader(object):
Known subclasses: ganeti.http.server._HttpClientToServerMessageReader, server._HttpClientToServerMessageReader
Reads HTTP message from socket.
| Method | __init__ |
Reads an HTTP message from a socket. |
| Method | |
Parses the start line of a message. |
| Constant | HEADER |
Undocumented |
| Constant | PS |
Undocumented |
| Constant | PS |
Undocumented |
| Constant | PS |
Undocumented |
| Constant | PS |
Undocumented |
| Constant | START |
Undocumented |
| Instance Variable | body |
Undocumented |
| Instance Variable | content |
Undocumented |
| Instance Variable | header |
Undocumented |
| Instance Variable | msg |
Undocumented |
| Instance Variable | parser |
Undocumented |
| Instance Variable | peer |
Undocumented |
| Instance Variable | sock |
Undocumented |
| Instance Variable | start |
Undocumented |
| Method | _ |
Limits the header buffer size. |
| Method | _ |
Limits the start line buffer size. |
| Method | _ |
Main function for HTTP message state machine. |
| Method | _ |
Parses the headers. |
| Method | _ |
Evaluate whether peer will close the connection. |
Reads an HTTP message from a socket.
| Parameters | |
| sock:socket | Socket to be read from |
| msg:http.HttpMessage | Object for the read message |
| read | Read timeout for socket |
overridden in
ganeti.http.server._HttpClientToServerMessageReader, server._HttpClientToServerMessageReaderParses the start line of a message.
Must be overridden by subclass.
| Parameters | |
| start | Start line string |
HEADER_LENGTH_MAX =
¶
overridden in
ganeti.http.server._HttpClientToServerMessageReader, server._HttpClientToServerMessageReaderUndocumented
| Value |
|
START_LINE_LENGTH_MAX =
¶
overridden in
ganeti.http.server._HttpClientToServerMessageReader, server._HttpClientToServerMessageReaderUndocumented
| Value |
|
Main function for HTTP message state machine.
| Parameters | |
| buf:string | Receive buffer |
| eof:bool | Whether we've reached EOF on the socket |
| Returns | |
| string | Updated receive buffer |
Parses the headers.
This function also adjusts internal variables based on header values.
RFC2616, section 4.3: The presence of a message-body in a request is signaled by the inclusion of a Content-Length or Transfer-Encoding header field in the request's message-headers.