1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-29 03:17:53 -04:00
Commit Graph

3400 Commits

Author SHA1 Message Date
Kalle Olavi Niemitalo
01dd1b3b65 Revert "When prompting a program for copiousoutput don't show the block checkbox"
I am reverting all copiousoutput support because of bug 917.
This reverts commit 0c2ce62459.
2008-06-15 14:05:55 +03:00
Witold Filipczyk
1544b5f4b9 bug 991: fix crash when the file is already cached
If the user opens the same file again after it is in the cache, then
ELinks does not always open a new connection, so download->conn can be
NULL in init_type_query(), and download->conn->cgi would crash.
Don't read that, then; instead add a new flag cache_entry.cgi, which
http_got_header() sets or clears as soon as possible after the cache
entry has been created.
(cherry picked from commit 81f8ee1fa2)
2008-06-15 13:53:34 +03:00
Witold Filipczyk
d15439edff bug 991: Added the bit field cgi to the structs connection and type_query.
CGI scripts are distinguishable from normal files. I hope that this
fixes the bug 991. This commit also reverts the previous revert.
(cherry picked from commit 7ceba1e461)
2008-06-15 13:07:02 +03:00
Kalle Olavi Niemitalo
a3fba83f80 Remove a comment about kill_timer()
The comment said "it is not possible to call kill_timer from a timer
handler."  Sure, such calls used to crash occasionally, but that was
bug 868 and has already been fixed.
2008-06-15 11:41:52 +03:00
Kalle Olavi Niemitalo
d6fd2ac31f Erase progress.timer before calling progress.timer_func
Previously, each progress timer function registered with
start_update_progress() was directly used as the timer function of
progress.timer, so it was responsible of erasing the expired timer ID
from that member.  Failing to do this could result in heap corruption.
The progress timer functions normally fulfilled the requirement by
calling update_progress(), but one such function upload_stat_timer()
had to erase the timer ID on its own too.

Now instead, there is a wrapper function progress_timeout(), which
progress.c sets as the timer function of progress.timer.  This wrapper
erases the expired timer ID from progress.timer and then calls the
progress timer function registered with start_update_progress().  So
the progress timer function is no longer responsible of erasing the
timer ID and there's no risk that it could fail to do that in some
error situation.

This commit introduces a new risk though.  Previously, if the struct
progress was freed while the timer was running, the (progress) timer
function would still be called, and it would be able to detect that
the progress pointer is NULL and recover from this situation.  Now,
the timer function progress_timeout() has a pointer to the struct
progress and will dereference that pointer without being able to check
whether the structure has been freed.  Fortunately, done_progress()
asserts that the timer is not running, so this should not occur.
2008-06-15 11:27:19 +03:00
Laurent MONIN
1d5405e34e French translation was updated. 2008-06-11 12:59:56 +02:00
Miciah Dashiel Butler Masters
5c96d430c9 Bug 765: Bypass checks on base tab's view state when copying to a new tab
In setup_session, use copy_location, add_to_history, and
render_document_frames instead of goto_uri and copy_vs to copy the base
tab's view state.  By avoiding goto_uri, setup_session now bypasses MIME
checks, form post confirmations, malicious URL checks, and so on when
copying the base tab's current location and view state to the new tab,
so the new tab should get exactly what was loaded in the base tab.

This fixes bug 765: Opening a new tab can ask about the document of the
previous tab.
2008-06-11 10:32:02 +00:00
Miciah Dashiel Butler Masters
9e1e94bee0 Bug 620: Reset form fields to default values on reload
Do not retain changed values in form fields when the user reloads.  Doing
so can be confusing or even cause data-loss when new default values are
specified in the updated document.  For example, when editing an article on
Wikipedia, one loads the edit page for the article, makes and submits
changes, goes back to the edit page to make further modifications, and
reloads to get the new article text.  Before this change, reloading the
edit page would not update the textarea on the page with the new article
source, which can lead one (and has led me) to make changes to the original
version of the article by accident.

This fixes bug 620.
2008-06-10 06:41:34 +00:00
Kalle Olavi Niemitalo
696496e831 1008: remove unused uri.big_files
The files are instead counted by open_http_post().
2008-06-10 01:05:39 +03:00
Kalle Olavi Niemitalo
a833d6d093 Bug 1015: Define and use Py_ssize_t. 2008-06-09 23:18:03 +03:00
Miciah Dashiel Butler Masters
86db3461b8 Bug 963: Parse scripts in blocks hidden with "display: none"
Handle <script> blocks even when they are contained by blocks with
"display: none" set.

This commit fixes the second problem that Kalle points out in comment 5
to bug 963.
2008-06-09 13:58:41 +00:00
Miciah Dashiel Butler Masters
cadd2ecc10 Bug 963: Correct reversed logic for document.css.ignore_display_none
When this option is enabled, elements should be rendered even when the CSS
display attribute is "none".  Before this commit, the reverse was true:
when the option was enabled, such elements were _not_ rendered.

I am not changing the default, which is enabled, meaning that by default,
ELinks renders elements regardless of "display: none".  Pasky advocates
that this remain the default until ELinks's CSS support improves.

This commit fixes the first problem that Kalle points out in comment 5 to
bug 963.
2008-06-09 13:58:41 +00:00
Miciah Dashiel Butler Masters
9af30f13b9 Document start_element and end_element 2008-06-09 13:58:41 +00:00
Miciah Dashiel Butler Masters
3c44a88b39 Document the invisible and name members of struct html_element 2008-06-09 13:58:41 +00:00
Kalle Olavi Niemitalo
af1f475417 Merge branch 'elinks-0.12' into elinks-0.13
Conflicts:

	doc/man/man1/elinks.1.in
	doc/man/man5/elinks.conf.5

Resolved by regenerating the files with make update-man.
2008-06-08 20:47:36 +03:00
Kalle Olavi Niemitalo
5e4a565603 Bug 1014: Fix incompatible pointer type in init_perl.
The second argument of PERL_SYS_INIT3 should be a char ***
but ELinks was giving it a char *(*)[1].

Also, enlarge the array to 2 elements, so that my_argv[my_argc] == NULL
like in main().  PERL_SYS_INIT3 seems hardly documented at all so I'm
not sure this is necessary, but it shouldn't hurt.
(cherry picked from commit 8d0677e76a)
2008-06-08 20:40:17 +03:00
Kalle Olavi Niemitalo
b8b54a5325 Merge branch 'top/0.13/bug1008' into elinks-0.13 2008-06-08 19:51:00 +03:00
Kalle Olavi Niemitalo
d2da3f4967 1008: larger POST_BUFFER_SIZE for CPU efficiency
Posting a 91762123-byte file to test/cgi/big_file.cgi.  The CPU
percentages are from "top" set up to update every 10 seconds and
checked near the end of the transfer, so they are less accurate
than the upload rate, which averages over the whole transfer.

buffer=4096: average 1.7 MiB/s, elinks 62% CPU, python 35% CPU.
buffer=8192: average 2.5 MiB/s, elinks 49% CPU, python 42% CPU.
buffer=16384: average 3.1 MiB/s, elinks 40% CPU, python 55% CPU.
buffer=32768: average 3.8 MiB/s, elinks 33% CPU, python 61% CPU.
buffer=65536: average 4.1 MiB/s, elinks 26% CPU, python 70% CPU.
buffer=131072: average 4.2 MiB/s, elinks 28% CPU, python 67% CPU.
buffer=262144: average 4.4 MiB/s, elinks 26% CPU, python 69% CPU.

I'm choosing 32768 as POST_BUFFER_SIZE because the advantages of
larger buffers don't seem very high and keeping this under 65536
may help anyone trying to port ELinks to DOS.

I'm using the same value for HTTP too, just to keep things consistent
until there is a reason to diverge.
2008-06-08 18:38:48 +03:00
Kalle Olavi Niemitalo
5839aa070a 1008: show upload progress in local CGI too 2008-06-08 17:30:17 +03:00
Kalle Olavi Niemitalo
bed84c483e Bug 517: read_encoded() == 0 might not mean EOF if non-blocking.
Without this patch, ELinks showed garbage at
<http://www.dwheeler.com/oss_fs_why.html> when bzip2 decompression was
enabled.  safe_read() in bzip2_read() did not see all of the body
bytes that ELinks had received from the server.  After bzip2_read()
received EAGAIN from safe_read() and returned 0, something skipped
1460 bytes.

decompress_data() apparently assumed that read_encoded() returning 0
meant the end of the file, and returned even though len still was
nonzero, i.e. it had not yet written to the pipe all the data that
the caller (read_chunked_http_data() or read_normal_http_data()) had
provided.  The caller did not know this, and discarded the data.
(cherry picked from commit 7e5e05ca60)
2008-06-07 23:33:23 +03:00
Kalle Olavi Niemitalo
7e5e05ca60 Bug 517: read_encoded() == 0 might not mean EOF if non-blocking.
Without this patch, ELinks showed garbage at
<http://www.dwheeler.com/oss_fs_why.html> when bzip2 decompression was
enabled.  safe_read() in bzip2_read() did not see all of the body
bytes that ELinks had received from the server.  After bzip2_read()
received EAGAIN from safe_read() and returned 0, something skipped
1460 bytes.

decompress_data() apparently assumed that read_encoded() returning 0
meant the end of the file, and returned even though len still was
nonzero, i.e. it had not yet written to the pipe all the data that
the caller (read_chunked_http_data() or read_normal_http_data()) had
provided.  The caller did not know this, and discarded the data.
2008-06-07 21:27:37 +03:00
Kalle Olavi Niemitalo
2482bdf913 1008: NEWS entry 2008-06-06 09:43:51 +03:00
Kalle Olavi Niemitalo
3e370677c4 1008: assert there's no FILE_CHAR in file names 2008-06-04 01:15:07 +03:00
Kalle Olavi Niemitalo
8e33098306 1008: always erase timer ID in upload_stat_timer() 2008-06-03 10:02:06 +03:00
Kalle Olavi Niemitalo
08941fd47d 1008: rename connection.upload_progress to .http_upload_progress 2008-06-03 09:57:58 +03:00
Kalle Olavi Niemitalo
fa51846f68 1008: increment http_post->uploaded in read_http_post() 2008-06-03 09:45:40 +03:00
Kalle Olavi Niemitalo
2d2cc6c5f5 1008: Abort connection if a file is resized. 2008-06-03 01:49:10 +03:00
Kalle Olavi Niemitalo
d3ee4e2e47 1008: error parameter in read_http_post
This function will need to set ELinks-specific errors
and it would not be right to write those in errno.
2008-06-03 01:26:19 +03:00
Kalle Olavi Niemitalo
44bf538cab 1008: Remember the sizes of files during the upload.
This will soon allow read_http_post_fd() to detect if a size has
changed.
2008-06-03 00:46:12 +03:00
Kalle Olavi Niemitalo
c2d854b240 1008: open_http_post() can return an error.
It does not yet take advantage of that though.
2008-06-03 00:18:47 +03:00
Kalle Olavi Niemitalo
533e7fc62b 1008: replace post_length() with open_http_post() 2008-06-02 10:41:55 +03:00
Kalle Olavi Niemitalo
88a59a06c0 1008: move stuff to new src/protocol/http/post.{c,h} 2008-06-02 10:40:34 +03:00
Kalle Olavi Niemitalo
0a95ae85ab 1008: finish renaming http_read_post_data to read_http_post
Fix the compilation error caused in the previous commit.
2008-06-02 01:06:23 +03:00
Paul B. Mahol
b03ddccf08 Recognize Insert key on cons25 (FreeBSD console) 2008-05-31 13:04:25 +03:00
Kalle Olavi Niemitalo
4768243d0c 1008: rename http_read_post_data to read_http_post 2008-05-26 10:40:43 +03:00
Kalle Olavi Niemitalo
1b707208d3 1008: New struct http_post.
Move connection.post_fd to http_post.post_fd.
Make connection.done point to the new done_http_connection(),
which calls the new done_http_post(), which closes post_fd.
So done_connection() no longer needs to do that.

Now that done_http_post() exists, a later commit can add dynamically
allocated data in struct http_post and ensure that it will be freed.
2008-05-26 01:56:58 +03:00
Kalle Olavi Niemitalo
6e616e4f93 1008: Remove assertion from init_http_connection_info().
As the comment near the end of this function says, conn->info is
already non-NULL if a HTTPS proxy is being used, and the code in fact
correctly frees the previous info.  So there is no need to assert its
nonexistence.  I added that bug on 2008-05-22, in commit 291a913d1e.
2008-05-25 22:40:27 +03:00
Kalle Olavi Niemitalo
7a72a685e5 1008: Centralize random numbers.
If ELinks is being linked with SSL library, use its random number
generator.

Otherwise, try /dev/urandom and /dev/prandom.  If they do not work,
fall back to rand(), calling srand() only once.  This fallback is
mostly interesting for the Hurd and Microsoft Windows.

BitTorrent piece selection and dom/test/html-mangle.c still use rand()
(but not srand()) directly.  Those would not benefit from being
unpredictable, I think.
2008-05-25 18:44:21 +03:00
Kalle Olavi Niemitalo
291a913d1e 1008: Call and reset conn->done when freeing conn->info.
In the places that set conn->info without freeing the original value,
assert that both conn->info and conn->done are NULL.
2008-05-22 03:59:33 +03:00
Kalle Olavi Niemitalo
2256a8c94a 1008: HTTP upload counters are off_t, not size_t.
So that ELinks can upload files larger than 4 GiB even if size_t is
32-bit.
2008-05-21 08:20:03 +03:00
Kalle Olavi Niemitalo
3b5e10d3da 1008: Merge POST data sending of HTTP and local CGI.
To reduce code duplication, src/protocol/file/cgi.c no longer parses
connection->uri->post on its own but rather calls the new function
http_read_post_data(), provided by src/protocol/http/http.c.  The same
code is now also used for POST requests that do not include files.
2008-05-19 08:09:39 +03:00
Kalle Olavi Niemitalo
181486696b 1008: comments about struct http_connection_info 2008-05-18 22:30:30 +03:00
Witold Filipczyk
5c885def9b 1008: Do not check boundaries, use random ones. 2008-05-17 18:20:13 +02:00
Kalle Olavi Niemitalo
0298d88167 1008: Save errno if open() fails in file upload. 2008-05-17 10:39:10 +03:00
Witold Filipczyk
d10604334c pl.po: More question marks. 2008-05-16 11:17:03 +02:00
Witold Filipczyk
85fdfe14d3 pl.po: Another, hopefully the last, test commit.
This time test if daemonize works.
2008-05-16 10:59:22 +02:00
Witold Filipczyk
ae2a9dbc27 pl.po: Another question mark. 2008-05-16 10:40:14 +02:00
Miciah Dashiel Butler Masters
e174b9b023 Drop unused local variable scriptlen and strlen call in execute_cgi 2008-05-16 04:00:18 +00:00
Witold Filipczyk
a04952a5fa pl.po: Added the question mark. 2008-05-15 22:15:14 +02:00
Witold Filipczyk
4f053ddc97 Test mail. 2008-05-15 21:28:08 +02:00