gsathya / htpt

HTTP Tor Pluggable Transport
Other
4 stars 3 forks source link

Frame refactor #33

Closed ben-jones closed 10 years ago

ben-jones commented 10 years ago

Initial refactoring for the framing and buffer code. This code makes the interface cleaner and resolves some bugs. This is a partial solution to issue 28

Changes

buffer.py:

  1. correctly sets the min and max seq number for the window. This resolves several bugs related to how data is queued in the buffer.
  2. added functionality to let the buffer start numbering at an arbitrary sequence number

frame.py:

  1. Refactored SeqNum and SessionID to use class methods. This establishes more consistency in the sequence numbers and ensures that the SessionIDs will be unique for the server when the server generates them. This code may need to be adjusted to support multiple sequence numbers on the server side.
  2. Split some of the functionality of Dissambler.retrieveHeaders() out of the function. Added a module function which will split the headers up and which allows the headers to be examined without changing the state of a Disassembler.
  3. Moved initServerConnection out of the Disassembler so that it can return an assembler and a dissassembler if the connection correctly authenticates.

    Functionality still to be added:

Make use of flags, specifically SYN and MORE

gsathya commented 10 years ago

Looks fine to me. should I merge it or wait for the other stuff?

ben-jones commented 10 years ago

I would prefer to merge now. Even though we are working on different issues, we will end up touching the same code and I would like to keep in sync to avoid pain in merging conflicts later. Also, this merge touches a significant portion of our codebase (3 files) so I figured it would be better to get it out of the way before you start coding.

What do you think?

gsathya commented 10 years ago

What do you think?

Done :+1: