mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
Don't fail assertion on 0-second meta-refresh
In start_document_refresh, use register_bottom_half instead of install_timer if the timeout is 0 because install_timer asserts that it is given a delay greater than 0. Add a test case, test/refresh-0timeout.html. Note that document.browse.minimum_refresh_time must be set to 0 to reproduce the assertion failure.
This commit is contained in:
parent
2b1aedf6d1
commit
874202ef7a
2
NEWS
2
NEWS
@ -43,6 +43,8 @@ Miscellaneous:
|
|||||||
* Really retry forever when connection.retries = 0.
|
* Really retry forever when connection.retries = 0.
|
||||||
* enhancement: Session-specific options. Any options changed with
|
* enhancement: Session-specific options. Any options changed with
|
||||||
toggle-* actions no longer affect other tabs or other terminals.
|
toggle-* actions no longer affect other tabs or other terminals.
|
||||||
|
* Do not crash when document.browse.minimum_refresh_time = 0 and
|
||||||
|
a document has a meta refresh with a delay of 0.
|
||||||
* enhancement: Domain-specific options. Use set_domain in elinks.conf
|
* enhancement: Domain-specific options. Use set_domain in elinks.conf
|
||||||
to e.g. disable cookies for google.com. The option manager window
|
to e.g. disable cookies for google.com. The option manager window
|
||||||
does not yet support this.
|
does not yet support this.
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include "document/document.h"
|
#include "document/document.h"
|
||||||
#include "document/refresh.h"
|
#include "document/refresh.h"
|
||||||
#include "document/view.h"
|
#include "document/view.h"
|
||||||
|
#include "main/select.h"
|
||||||
#include "main/timer.h"
|
#include "main/timer.h"
|
||||||
#include "protocol/uri.h"
|
#include "protocol/uri.h"
|
||||||
#include "session/download.h"
|
#include "session/download.h"
|
||||||
@ -120,6 +121,14 @@ start_document_refresh(struct document_refresh *refresh,
|
|||||||
if (compare_uri(refresh->uri, type_query->uri, URI_BASE))
|
if (compare_uri(refresh->uri, type_query->uri, URI_BASE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (time == 0) {
|
||||||
|
/* Use register_bottom_half() instead of install_timer()
|
||||||
|
* because the latter asserts that the delay is greater
|
||||||
|
* than 0. */
|
||||||
|
register_bottom_half(do_document_refresh, doc_view);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
install_timer(&refresh->timer, time, do_document_refresh, doc_view);
|
install_timer(&refresh->timer, time, do_document_refresh, doc_view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
6
test/refresh-0timeout.html
Normal file
6
test/refresh-0timeout.html
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<html>
|
||||||
|
<head><meta http-equiv="refresh" content="0; url=/" /></head>
|
||||||
|
<body>
|
||||||
|
Redirect to / after 0 seconds.
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user