You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
838 B
37 lines
838 B
import http |
|
from twisted.internet import defer |
|
|
|
""" |
|
Schema v2 |
|
|
|
Description: |
|
Adds support for specifying the port of a request and specify its port. This |
|
lets requests that have the port/ssl settings specified in the CONNECT request |
|
maintain that information. |
|
""" |
|
|
|
update_queries = [ |
|
""" |
|
ALTER TABLE requests ADD COLUMN port INTEGER; |
|
""", |
|
|
|
""" |
|
ALTER TABLE requests ADD COLUMN is_ssl INTEGER; |
|
""", |
|
|
|
""" |
|
UPDATE schema_meta SET version=2; |
|
""", |
|
] |
|
|
|
@defer.inlineCallbacks |
|
def update(dbpool): |
|
for query in update_queries: |
|
yield dbpool.runQuery(query) |
|
|
|
# Load each request and save them again for any request that specified a port |
|
# or protocol in the host header. |
|
http.init(dbpool) |
|
reqs = yield http.Request.load_from_filters([]) |
|
for req in reqs: |
|
yield req.deep_save()
|
|
|