1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-19 01:36:33 -04:00
Commit Graph

62 Commits

Author SHA1 Message Date
Kalle Olavi Niemitalo
a7232792dd encoding: Don't leak a pipe fd if open_encoded() fails. 2008-02-17 21:54:19 +02:00
Kalle Olavi Niemitalo
6555359f8e Debian bug 464384: fix cast warning in ssl_connect
There are warnings about casts in the Debian amd64 build logs:
http://buildd.debian.org/fetch.cgi?&pkg=elinks&ver=0.11.3-2&arch=amd64&stamp=1200348983&file=log

	[CC]   src/intl/gettext/dcigettext.o
/build/buildd/elinks-0.11.3/src/intl/gettext/dcigettext.c: In function '_nl_find_msg':
/build/buildd/elinks-0.11.3/src/intl/gettext/dcigettext.c:745: warning: cast from pointer to integer of different size
/build/buildd/elinks-0.11.3/src/intl/gettext/dcigettext.c:746: warning: cast from pointer to integer of different size
...
	[CC]   src/network/ssl/socket.o
/build/buildd/elinks-0.11.3/src/network/ssl/socket.c: In function 'ssl_connect':
/build/buildd/elinks-0.11.3/src/network/ssl/socket.c:219: warning: cast to pointer from integer of different size

The warnings in _nl_find_msg were caused by alignof, which I already
fixed.  This commit ought to fix the gnutls_transport_set_ptr call in
ssl_connect.  This warning did not yet happen in bug 464384 because
the others broke the build before it got that far.
2008-02-09 15:19:20 +02:00
Miciah Dashiel Butler Masters
3a0286e447 Strings corrections from Malcolm Parsons
Fix the spelling and grammar in various comments, variable names, comment
descriptions, and documentation.
2008-01-27 04:19:23 +00:00
Kalle Olavi Niemitalo
e5922e4fe1 Bug 997: Fix unlikely stack corruption in get_pasv_socket.
It is unlikely because the standard members of struct sockaddr_in
(sin_family, sin_port, sin_addr) already require at least 8 bytes
and I don't know of any system that has size_t larger than that.
Besides, at least glibc pads the structure to 16 bytes.
2008-01-22 00:42:13 +02:00
Kalle Olavi Niemitalo
0c1b52637f get_pasv_socket: Use AF_INET6 when appropriate.
When get_pasv6_socket was merged into get_pasv_socket on 2005-04-15,
the AF_INET6 of get_pasv6_socket was lost and the merged function
always returned AF_INET sockets.  This then made getsockname fill
only part of the struct sockaddr_in6, and ELinks sent to the server
an EPRT command that had half the bits missing from the IPv6 address.
At least ftp.funet.fi then rejected the command, helpfully saying
what the address should have been.

This commit fixes active FTP over IPv6.  Passive FTP was already fixed
in 0.11.3.GIT (887d650efe), on 2007-05-01.
2008-01-22 00:41:25 +02:00
Miciah Dashiel Butler Masters
a197bde2f6 Really retry forever when connection.retries = 0
This feature has been broken since zas backported it from Links 0.99pre3 2003-04-20.
2007-09-26 16:18:59 +00:00
Kalle Olavi Niemitalo
96176a8c77 Declare element types of lists. 2007-07-26 22:47:23 +03:00
Kalle Olavi Niemitalo
146c42dcaa Win32: Get socklen_t from <ws2tcpip.h>. 2007-07-18 00:41:08 +03:00
Kalle Olavi Niemitalo
90518c7d23 Bug 920, move_download: Sort the queue before calling cancel_download. 2007-06-23 23:28:54 +03:00
Kalle Olavi Niemitalo
a38cc74ee0 Change connection.pri[] to int, reverting part of 7215c964e4.
Revert part of commit 7215c964e40afe953787d7831b04182fbaba4662,
"Use real types (enum connection_{state,priority})." of 2005-06-14.

connection.pri[] is indexed by enum connection_priority, but its
elements are merely reference counts; they are never assigned from
or compared to enum connection_priority.  Defining the elements
as int will result in more readable output from GDB.

Noted in bug 920.
2007-06-23 18:08:08 +03:00
Kalle Olavi Niemitalo
c0f488251f Revert 2d6840b9, "Only set the socket protocol family on success."
Revert commit 2d6840b9bd9d3a7a45a5ad92b4e98ff7224d6d97.  It is causing
passive FTP via IPv6 to fail on ftp.funet.fi.  ELinks sends PASV and
the server says "425 You cannot use PASV on IPv6 connections. Use EPSV
instead."
2007-04-30 09:08:20 +03:00
Kalle Olavi Niemitalo
2f25d3e57c Bug 712, ssl_set_no_tls: Disable TLS protocols for GnuTLS too.
And log this in NEWS, although that may have to be reverted later if
it turns out this change just hides a real bug elsewhere in ELinks.
2007-04-21 13:58:20 +03:00
Simon Josefsson
82edb1f892 Use gnutls_set_default_priority.
Thereby enabling TLS 1.2 on GnuTLS versions that support it.
2007-04-21 13:30:34 +03:00
Kalle Olavi Niemitalo
801d520ddd Fix compiler errors without HAVE_VARIADIC_MACROS. 2007-03-11 12:22:02 +02:00
Kalle Olavi Niemitalo
80a3019a2f fsp: Comment about connection.data_socket. 2007-03-05 19:34:19 +02:00
Kalle Olavi Niemitalo
3651a53e58 do_real_lookup: Assert that ai_addrlen <= sizeof(struct sockaddr_storage). 2007-02-17 22:21:56 +02:00
Kalle Olavi Niemitalo
543b0f6768 Make msg_dsc[] static const. 2007-02-04 13:40:46 +02:00
Kalle Olavi Niemitalo
bddafe5f7e Document how timer callbacks erase timer IDs; add some assertions.
Tangential to bug 868.
2006-12-02 18:35:03 +02:00
Jonas Fonseca
b61d8d06d9 Fix crashes with various bogus BitTorrent URLs
... mainly bittorrent:// and bittorrent://x

The BitTorrent URL is supposed to contain an embedded URL pointing to a
metainfo file. If this is not the case a "custom" error message will be
shown. Also fixes calling of free_list() on an uninitialized list.

Closes bug 729.
2006-11-06 16:24:07 +01:00
Miciah Dashiel Butler Masters
f7fba1b8e4 Use DNS_ERROR instead of -1 where appropriate 2006-10-20 23:10:36 +00:00
Jonas Fonseca
b9d66bd9bd Fix compilation on Minix3
- Include arpa/inet.h to get hton* ntoh* functions.
 - Use socklen_t instead of int.
 - Try to define PF_INET to AF_INET if it doesn't exist.

Reported-by: Andy Tanenbaum <ast@cs.vu.nl>
2006-08-22 22:18:00 +02:00
Miciah Dashiel Butler Masters
8344dfe6c9 Fix IPv4 DNS lookup bug
In revision 1.15 of dns.c (as it was called way back then), pasky
backported a fix from Links 0.97pre2 to try gethostbyaddr before
trying gethostbyname for DNS lookups:

   MacOS address resolution fix (Aldy Hernandez) (from 0.97pre2)

However, that fix introduced a bug, because it was calling gethostbyaddr
on all addresses, not just IP addresses. Mikulas fixed that bug in Links
0.98:

   Do not call gethostbyaddr when name is not ip address (it should avoid
   some useless nameserver queries)'

This fix was never backported to ELinks. Until today.

This commit is functionally the same as the fix in Links 0.98, plus it uses
inet_aton for great correctness!

This fixes a bug reported in #elinks by tnks, whereby lookups for
yubnub.org resulted in 121.117.98.110 == 0x7975626E == 'y', 'u', 'b', 'n'.
I believe that it also fixes bug 691 (which is already closed with a
workaround).
2006-08-09 12:42:54 +00:00
Witold Filipczyk
d0f7a9279e It works without this code 2006-07-16 16:00:56 +02:00
Witold Filipczyk
ff136e5116 Bugfix for bug 770 (Download resuming simply restarts the download)
using magic ;)

Now in resume mode connection is always interrupted
and resumed. Even when all file is downloaded from beginning
conection will be resumed from old end of file. Feel free to fix it.
2006-07-16 14:46:46 +02:00
Witold Filipczyk
3dc145bde2 Changes related to Win32 port. S_IRWXG and S_IRWXO were undefined
under crossmingw32. init_static_version must be called after init_options
because ELinks wanted to read "verbose" option before it was initialized.
2006-05-18 21:46:42 +02:00
Witold Filipczyk
47f3dd0421 copiousoutput: I'm not sure about this. pclose may hang ELinks for long time,
fclose should return immediately
2006-05-09 10:12:36 +02:00
Witold Filipczyk
4dc4ea47f2 copiousoutput: cleanup after copiousoutput handling. Temporary files should
be deleted
2006-05-09 09:36:16 +02:00
Witold Filipczyk
e0103c2c68 Drop unnecessary cgi_pipes[2] 2006-05-03 21:46:39 +02:00
Jonas Fonseca
e726be3a76 NET: Nullify download->progress when move_download args are in result state
This is another follow-up regression fix that made open and save actions in
the WTD-dialog not function correctly when the connection ended before they
were pressed.

Related: 347970988d
2006-02-09 00:32:51 +01:00
Jonas Fonseca
854bb90d88 NET: Move cache entry normalization to abort_connection
It simplifies the code and ensures that stuff like conn->from is properly
updated.
2006-02-08 21:40:08 +01:00
Jonas Fonseca
0d53158553 NET: Ensure that move_download sets new->conn to NULL when in result state
When in result state the connection might already have been freed.
2006-02-07 02:02:33 +01:00
Jonas Fonseca
347970988d NET: Fix regression from the latest change_connection changes
This makes move_download not assume that there is a connection attached
when it is called. This is the case pretty often for file:// downloads when
dialogs are involved (query file) and the reason why it explicitly checks
if the connection state is 'in result state'. Anyway, fill the new download
struct with variabled from the old one instead of taking variables from the
connection struct.

This patch also adds some assertions and a few comments.
2006-02-04 23:20:40 +01:00
Jonas Fonseca
c51300066f NET: Rename old to download in cancel_download 2006-02-03 10:44:30 +01:00
Jonas Fonseca
637f1e82e6 NET: Merge change_connection into cancel_download 2006-02-03 10:44:30 +01:00
Jonas Fonseca
33625ae9e2 NET: Move attaching of new download to move_download
This includes setting the new priority and adding the download to the list
of connection downloads. If the connection has no downloads set the
PRI_CANCEL priority; get_priority() requires that.
2006-02-03 10:44:29 +01:00
Jonas Fonseca
c2d5464910 NET: Minor tidyup 2006-02-03 10:44:29 +01:00
Jonas Fonseca
8b938cb7a6 NET: Move shortcut from change_connection to the two front-ends 2006-02-03 10:44:29 +01:00
Jonas Fonseca
500de86927 NET: Setup the new download in the start of move_download 2006-02-03 10:44:29 +01:00
Jonas Fonseca
3324496b57 NET: Replace change_connection with cancel_download and move_download
This simplifies unqueuing of downloads and makes it more obvious that
the 'change' being performed is to migrate or replace an old download
handle with a new one.
2006-02-03 10:44:28 +01:00
Miciah Dashiel Butler Masters
5bcb1309da Use enum connection_state
Use enum connection_state instead of int in load_uri,
proxy_uri, get_proxy_worker, and get_proxy_uri. See commit
d18809522e. I hope that satisfies TCC.
2006-01-28 20:21:09 +00:00
d18809522e Make elinks tcc (tiny C compiler) friendly.
If you want to try tcc use CC=tcc ./configure and make LD=tcc.
I built ELinks with tcc, but ELinks segfaults.
2006-01-21 21:33:23 +01:00
Jonas Fonseca
2748d043f9 Autogenerate .vimrc files and put the master in config/vimrc
This changes the init target to be idempotent: most importantly it will now
never overwrite a Makefile if it exists. Additionally 'make init' will
generate the .vimrc files. Yay, no more stupid 'added fairies' commits! ;)
2006-01-15 18:38:58 +01:00
Laurent MONIN
18649c8988 connect_socket(): simplify code a bit. 2006-01-05 18:36:22 +01:00
Laurent MONIN
c6dfce8ad8 connect_socket(): set @pf at appropriate time. 2006-01-05 18:29:42 +01:00
Laurent MONIN
9e55cb0d2a connect_socket(): cache options values. 2006-01-05 18:28:16 +01:00
Laurent MONIN
88730120ba Define EL_PF_INET and EL_PF_INET6 to identify protocol in use instead
of numeric values.
2006-01-04 18:06:53 +01:00
Laurent MONIN
8b7657deaf Use PF_* instead of AF_* as first parameter of socket(2). 2006-01-04 00:32:58 +01:00
Laurent MONIN
852bdaec88 sort_queue(): make @swp variable local to the loop. 2005-12-13 16:50:04 +01:00
Jonas Fonseca
5dffe2e8ac Fix various sparse warnings
Mostly non-ANSI function declarations, using 0 as NULL and inline
function prototypes. Also removed unused S_HTTP_100 network state
enum type, which text message contained unknown escape sequence: '\?'.
2005-11-24 15:38:47 +01:00
Jonas Fonseca
acf2ec806b Remove empty lines in start of header files
A left over from the CVS Id removal. Also, for a few files, normalize the
order in which things are declared in headers.
2005-11-15 11:33:27 +01:00