Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

socketio problem fix #203

Merged
merged 1 commit into from
Mar 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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