Skip to content

Commit

Permalink
Fixed a silly bug which caused a spin loop.
Browse files Browse the repository at this point in the history
darcs-hash:20090617020833-20ca2-94bcc35d11aa3df6c21892a6b9352f4223fdd916.gz
  • Loading branch information
scudette committed Jun 17, 2009
1 parent 3031395 commit 83c7698
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
5 changes: 1 addition & 4 deletions src/FileFormats/HTML.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ def decoder(x):
return x.group(1).decode("hex")

## we can use this to handle arbitrary levels of quoting
while "%" in string:
try:
string = re.sub("%(..)", decoder, string)
except: break
string = re.sub("%(..)", decoder, string)

## references seem to _always_ be encoded using utf8 - even if the
## page is encoded using a different charset??? This whole quoting
Expand Down
12 changes: 9 additions & 3 deletions src/pyflag/Farm.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,13 @@ def wake_workers():

Registry.Init()

#config.parse_options()

config.parse_options()

def handler(sig, frame):
import pdb
pdb.set_trace()

print "Setting int"
signal.signal(signal.SIGINT, handler)
pyflaglog.log(pyflaglog.INFO,"Starting PyFlag worker")
nanny(worker_run)
worker_run()
21 changes: 13 additions & 8 deletions utilities/incremental_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,19 @@ def load_file(filename, processor, pcap_dbh):
except StopIteration:
break

pcap_dbh.mass_insert(
id = pcap_id,
iosource = config.iosource,
offset = offset,
length = packet.caplen,
_ts_sec = "from_unixtime('%s')" % packet.ts_sec,
ts_usec = packet.ts_usec,
)
try:
pcap_dbh.mass_insert(
id = pcap_id,
iosource = config.iosource,
offset = offset,
length = packet.caplen,
_ts_sec = "from_unixtime('%s')" % packet.ts_sec,
ts_usec = packet.ts_usec,
)
except KeyError,e:
print packet.list()
print e
continue

input_file.set_id(pcap_id)

Expand Down

0 comments on commit 83c7698

Please sign in to comment.