mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-24 00:04:23 +03:00
Handling 'address already in use' for sqlmapapi server instance
This commit is contained in:
parent
31d250f98e
commit
2eb5f5e841
|
@ -10,6 +10,7 @@ import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import shlex
|
import shlex
|
||||||
|
import socket
|
||||||
import sqlite3
|
import sqlite3
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
@ -654,7 +655,13 @@ def server(host="0.0.0.0", port=RESTAPI_SERVER_PORT):
|
||||||
DataStore.current_db.init()
|
DataStore.current_db.init()
|
||||||
|
|
||||||
# Run RESTful API
|
# Run RESTful API
|
||||||
|
try:
|
||||||
run(host=host, port=port, quiet=True, debug=False)
|
run(host=host, port=port, quiet=True, debug=False)
|
||||||
|
except socket.error, ex:
|
||||||
|
if "already in use" in getSafeExString(ex):
|
||||||
|
logger.error("Address already in use ('%s:%s')" % (host, port))
|
||||||
|
else:
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
def _client(url, options=None):
|
def _client(url, options=None):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user