mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-23 15:54:24 +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 re
|
||||
import shlex
|
||||
import socket
|
||||
import sqlite3
|
||||
import sys
|
||||
import tempfile
|
||||
|
@ -654,7 +655,13 @@ def server(host="0.0.0.0", port=RESTAPI_SERVER_PORT):
|
|||
DataStore.current_db.init()
|
||||
|
||||
# Run RESTful API
|
||||
try:
|
||||
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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user