Merge branch 'Kingdread-download-ssl-crash'
This commit is contained in:
commit
612ef09f97
@ -45,6 +45,12 @@ Changed
|
|||||||
versions those already all are disabled, but with older versions they might
|
versions those already all are disabled, but with older versions they might
|
||||||
not be.
|
not be.
|
||||||
|
|
||||||
|
Fixed
|
||||||
|
-----
|
||||||
|
|
||||||
|
- Fixed crash when downloading from an URL with SSL errors
|
||||||
|
- Close file handles correctly when a download failed
|
||||||
|
|
||||||
v0.6.2
|
v0.6.2
|
||||||
------
|
------
|
||||||
|
|
||||||
|
@ -412,6 +412,8 @@ class DownloadItem(QObject):
|
|||||||
self.reply = None
|
self.reply = None
|
||||||
self.done = True
|
self.done = True
|
||||||
self.data_changed.emit()
|
self.data_changed.emit()
|
||||||
|
if self.fileobj is not None:
|
||||||
|
self.fileobj.close()
|
||||||
|
|
||||||
def init_reply(self, reply):
|
def init_reply(self, reply):
|
||||||
"""Set a new reply and connect its signals.
|
"""Set a new reply and connect its signals.
|
||||||
|
@ -226,6 +226,10 @@ class NetworkManager(QNetworkAccessManager):
|
|||||||
self.shutting_down.connect(q.abort)
|
self.shutting_down.connect(q.abort)
|
||||||
if owner is not None:
|
if owner is not None:
|
||||||
owner.destroyed.connect(q.abort)
|
owner.destroyed.connect(q.abort)
|
||||||
|
|
||||||
|
# This might be a generic network manager, e.g. one belonging to a
|
||||||
|
# DownloadManager. In this case, just skip the webview thing.
|
||||||
|
if self._tab_id is not None:
|
||||||
webview = objreg.get('webview', scope='tab', window=self._win_id,
|
webview = objreg.get('webview', scope='tab', window=self._win_id,
|
||||||
tab=self._tab_id)
|
tab=self._tab_id)
|
||||||
webview.loadStarted.connect(q.abort)
|
webview.loadStarted.connect(q.abort)
|
||||||
|
@ -44,6 +44,14 @@ Feature: Downloading things from a website.
|
|||||||
And I run :leave-mode
|
And I run :leave-mode
|
||||||
Then no crash should happen
|
Then no crash should happen
|
||||||
|
|
||||||
|
Scenario: Downloading with SSL errors (issue 1413)
|
||||||
|
When I run :debug-clear-ssl-errors
|
||||||
|
And I set network -> ssl-strict to ask
|
||||||
|
And I download a SSL page
|
||||||
|
And I wait for "Entering mode KeyMode.* (reason: question asked)" in the log
|
||||||
|
And I run :prompt-accept
|
||||||
|
Then the error "Download error: SSL handshake failed" should be shown
|
||||||
|
|
||||||
Scenario: Retrying a failed download
|
Scenario: Retrying a failed download
|
||||||
When I run :download http://localhost:(port)/does-not-exist
|
When I run :download http://localhost:(port)/does-not-exist
|
||||||
And I wait for the error "Download error: * - server replied: NOT FOUND"
|
And I wait for the error "Download error: * - server replied: NOT FOUND"
|
||||||
|
@ -41,6 +41,12 @@ def wait_for_download_finished(quteproc):
|
|||||||
quteproc.wait_for(category='downloads', message='Download finished')
|
quteproc.wait_for(category='downloads', message='Download finished')
|
||||||
|
|
||||||
|
|
||||||
|
@bdd.when("I download a SSL page")
|
||||||
|
def download_ssl_page(quteproc, ssl_server):
|
||||||
|
quteproc.send_cmd(':download https://localhost:{}/'
|
||||||
|
.format(ssl_server.port))
|
||||||
|
|
||||||
|
|
||||||
@bdd.then(bdd.parsers.parse("The downloaded file {filename} should not exist"))
|
@bdd.then(bdd.parsers.parse("The downloaded file {filename} should not exist"))
|
||||||
def download_should_not_exist(filename, tmpdir):
|
def download_should_not_exist(filename, tmpdir):
|
||||||
path = tmpdir / filename
|
path = tmpdir / filename
|
||||||
|
Loading…
Reference in New Issue
Block a user