Skip to content

Commit

Permalink
issue 202 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pwnslinger committed Jul 6, 2018
1 parent 8f094b3 commit 4dfae62
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
8 changes: 6 additions & 2 deletions middleware/qira_webserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def func_wrapper(*args, **kwargs):
LIMIT = 0

from flask import Flask, Response, redirect, request
from flask.ext.socketio import SocketIO, emit
#from flask.ext.socketio import SocketIO, emit
from flask_socketio import SocketIO, emit

# http://stackoverflow.com/questions/8774958/keyerror-in-module-threading-after-a-successful-py-test-run
import threading
Expand Down Expand Up @@ -66,6 +67,7 @@ def push_trace_update(i):
t.needs_update = False

def push_updates(full = True):

socketio.emit('pmaps', program.get_pmaps(), namespace='/qira')
socketio.emit('maxclnum', program.get_maxclnum(), namespace='/qira')
socketio.emit('arch', list(program.tregs), namespace='/qira')
Expand Down Expand Up @@ -431,7 +433,9 @@ def run_server(largs, lprogram):
print "****** starting WEB SERVER on %s:%d" % (qira_config.HOST, qira_config.WEB_PORT)
threading.Thread(target=mwpoller).start()
try:
socketio.run(app, host=qira_config.HOST, port=qira_config.WEB_PORT, log=open("/dev/null", "w"))
#socketio.run(app, host=qira_config.HOST, port=qira_config.WEB_PORT, log=open("/dev/null", "w"))
socketio.run(app, host=qira_config.HOST, port=qira_config.WEB_PORT,
log_output=False)
except KeyboardInterrupt:
print "*** User raised KeyboardInterrupt"
exit()
Expand Down
5 changes: 3 additions & 2 deletions middleware/qira_webstatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
from qira_webserver import app

from flask import Flask, Response, redirect, request
from flask.ext.socketio import SocketIO, emit
#from flask.ext.socketio import SocketIO, emit
from flask_socketio import SocketIO, emit

from qira_base import *
import json
Expand Down Expand Up @@ -81,7 +82,7 @@ def graph_dot():
os.system("dot /tmp/in.dot > /tmp/out.dot")
ret = open("/tmp/out.dot").read()
#print "DOT RESPONSE", ret
return ret
return ret

# currently if we aren't using static, we don't want to draw the staticview
# or be able to makefunction
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ capstone
hexdump
nose
./qiradb
https://pypi.python.org/packages/source/p/pyparsing/pyparsing-1.5.7.tar.gz#md5=9be0fcdcc595199c646ab317c1d9a709
pyparsing>=2.1.4
#https://pypi.python.org/packages/source/p/pyparsing/pyparsing-1.5.7.tar.gz#md5=9be0fcdcc595199c646ab317c1d9a709

10 changes: 8 additions & 2 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,14 @@ fi
# phantomjs
# use phantomjs2.0 for non-draft WebSockets protol
# unforunately this doesn't ship with Ubuntu by default

sudo apt-get install $LIBICU
if [ $(sudo apt-get install $LIBICU; echo $?) != 100 ]; then
echo "libcsu55 installed successfully."
else
echo "missing dependencies, fixing source"
echo -e "deb http://security.ubuntu.com/ubuntu trusty-security main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install $LIBICU
fi

wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-$VER.tar.bz2
tar xf ./phantomjs-2.0.0-ubuntu-$VER.tar.bz2
Expand Down

0 comments on commit 4dfae62

Please sign in to comment.