Skip to content

Commit

Permalink
new flush operation
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Oct 27, 2015
1 parent 1fffbba commit f5fe31c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/netius/common/http.py
Expand Up @@ -404,6 +404,8 @@ def parse(self, data):
# data that has been sent for processing
while size > 0:
print("size := %d" % size)
import sys
sys.stdout.flush()

# iterates while the current state is valid for
# parsing as there are only parsing methods for
Expand All @@ -416,8 +418,12 @@ def parse(self, data):
# zero the parsing iteration is broken
method = self.states[self.state - 1]
print("calling %s" % str(method))
import sys
sys.stdout.flush()
count = method(data)
print("count := %d" % count)
import sys
sys.stdout.flush()
if count == 0: break

# decrements the size of the data buffer by the
Expand Down Expand Up @@ -446,6 +452,10 @@ def parse(self, data):
# must add it to the buffer so that it may be used
# latter in the next parsing of the message
if size > 0: self.buffer.append(data)

print("exit parse")
import sys
sys.stdout.flush()

# returns the number of read (processed) bytes of the
# data that has been sent to the parser
Expand Down

0 comments on commit f5fe31c

Please sign in to comment.