Commit Graph

3887 Commits

Author SHA1 Message Date
Doug Rabson
678ef1b49e Call _thread_init() from pthread_once() if it has not already been called.
This fixes a segfault in some C++ programs which use exceptions before
main() has been called (i.e. from global constructors).

Reviewed by: deischen
2000-07-21 09:31:13 +00:00
Jason Evans
61e4108c41 Use _close() instead of close() in addrconfig() to keep it from becoming a
potential cancellation point in libc_r.
2000-07-21 04:22:39 +00:00
David E. O'Brien
00a5a11605 Fix problem where original author thought `unsigned long' was the best
32-bit type (rather than define his own type based on the type of box
being compiled on).

Submitted by:	Mark Abene <phiber@radicalmedia.com>
		(however I applied a slightly different fix)
2000-07-20 20:11:36 +00:00
Hajimu UMEMOTO
c98e299e93 Copy canonname for *ahost, into static buffer.
Obtained from:	KAME Project
2000-07-20 18:49:35 +00:00
Alfred Perlstein
372e9eb0af use .Pp instead of faking it with an extra newline
Pointed out by: sheldonh
2000-07-20 11:05:52 +00:00
Alfred Perlstein
f47d88b0b7 document get/set sockopt usage with accept_filter(9) 2000-07-20 10:33:08 +00:00
Brian Somers
732d07e535 Alocate rcmd{,_af}()'s *ahost argument using malloc() (well
strdup()) rather than pointing it at something that's free()d
(via freeaddrinfo(res)) before the function returns.

I appreciate that this is an API change, but it's the only way
(AFAIK) of doing this without breaking existing code that uses
rcmd{,_af}().

Pointed out by: phkmalloc
2000-07-20 09:05:15 +00:00
Dag-Erling Smørgrav
5e3f46b51a Fix the case where the file name is preceded by a lone slash. 2000-07-20 02:03:56 +00:00
Dag-Erling Smørgrav
87b41116cc Don't try to skip to the requested offset if the server returns more data
than requested.  Instead, inform the caller of the real offset by modifying
the offset field in the original struct url, and let him decide how to handle
the situation.
2000-07-19 23:43:49 +00:00
Jason Evans
c1110eb673 pthread_once --> pthread_once_t. 2000-07-19 16:38:07 +00:00
Sheldon Hearn
a6b651021d Update stale references to update(4) with references to the new
syncer(4) manual page.
2000-07-19 07:39:08 +00:00
Hajimu UMEMOTO
05c36511b9 To define A RR to root (.) is valid in DNS. So, h_name = "" shouldn't
be treated as NULL.

PR:		bin/19816
Submitted by:	Bill Fenner <fenner@research.att.com>
Reviewed by:	Atsushi Onoe <onoe@sm.sony.co.jp>
2000-07-19 06:22:01 +00:00
Archie Cobbs
6e64168369 Const'ify parameters to ethers(3) routines as appropriate. 2000-07-18 22:44:52 +00:00
Jonathan Lemon
a8e65b915e Simplify kqueue API slightly.
Discussed on:	-arch
2000-07-18 19:31:52 +00:00
Sheldon Hearn
93238a0c40 Substitute UT_NAMESIZE for 8 when truncating long usernames.
PR:		19886
Reported by:	Gregory Bond <gnb@itga.com.au>
2000-07-18 11:32:27 +00:00
Sheldon Hearn
47e05f6091 Fix header inclusions in preparation for a fix for PR 19886.
The CVS Id tag FreeBSD was added to satisfy commit_prep.pl.
2000-07-18 11:29:13 +00:00
Alexander Langer
6e145859ff Drop the references to index(3) and rindex(3), which are non-standard
and people shouldn't be encouraged to use them.

Asked by:	sheldonh
2000-07-18 08:05:11 +00:00
Dag-Erling Smørgrav
269532d987 Don't take a failure to stat a file to mean that it doesn't exist, as it may
be a dynamically created file, e.g. a tarball on servers that support sending
tarballs of directories.
2000-07-18 07:12:26 +00:00
Jason Evans
8e234adf86 Change my email address in the copyright notices for the sake of consistency
(jasone@canonware.com --> jasone@freebsd.org).
2000-07-18 01:38:19 +00:00
Jason Evans
390a1cd5eb Deal correctly with statically initialized condition variables in
pthread_cond_signal(), pthread_cond_broadcast(), and pthread_cond_timedwait().

Do not dump core in pthread_cond_timedwait() (due to a NULL pointer
dereference) if attempting to wait on an uninitialized condition variable.

PR:	bin/18099
2000-07-17 22:55:05 +00:00
Jason Evans
82db3da3e1 Reshuffle the SEE ALSO section.
Prompted by:	sheldonh
2000-07-17 22:33:32 +00:00
Dag-Erling Smørgrav
1a5faa1061 Introduce fetchXGet*(), which combine the functionalities of fetchGet*() and
fetchStat*().  In most cases, either fetchGet*() or fetchXGet*() is a wrapper
around the other; in all cases, calling fetchGet*() is identical to calling
fetchXGet*() with the second argument set to NULL.
2000-07-17 21:25:00 +00:00
Dag-Erling Smørgrav
c789727701 Don't forget to set file descriptor to -1 after closing it, since the code
outside the loop inspects it to determine whether or not we succeeded in
retrieving the requested document. This fixes a bug where fetchGetHTTP()
would return a FILE with an invalid file descriptor if it hit the redirect
limit without locating the requested document.
2000-07-17 21:09:11 +00:00
Dag-Erling Smørgrav
5cd33c40d7 Use a symbolic constant instead of hardcoding 999 2000-07-17 21:00:49 +00:00
Dag-Erling Smørgrav
d999dcac2d Don't forget to declare fetchRestartCalls. 2000-07-17 20:52:06 +00:00
Dag-Erling Smørgrav
a1bb3f482a Introduce the (undocumented) variable fetchRestartCalls, which controls whether
or not interrupted system calls will be restarted. This fixes a bug where
fetch(1) would hang (potentially forever) if a server stopped responding,
because the signal handler would absorb the user's efforts to interrupt the
transfer.
2000-07-17 20:49:39 +00:00
Dag-Erling Smørgrav
7c80207e33 Remove fetchContentType(), which disappeared in the HTTP rewrite. 2000-07-17 20:42:13 +00:00
Alexander Langer
24c196fe25 Add SEE ALSO section, as with the other string functions.
Submitted by:	dcs
2000-07-17 19:00:26 +00:00
Dag-Erling Smørgrav
e66b380285 #ifdef DEBUG -> #ifndef NDEBUG
Pointed out by:	ache
2000-07-16 23:18:44 +00:00
Dag-Erling Smørgrav
6290ee735b Reinsert the MIT copyright, which applies to the base64 code and was
left out by accident during the rewrite.
2000-07-16 01:04:10 +00:00
Ben Smithurst
f21ff38bf4 Make the NAME section a bit less confusing.
PR:		19262
Submitted by:	NOKUBI Hirotaka <nokubi@ff.iij4u.or.jp>
Reviewed by:	sheldonh
2000-07-15 13:04:33 +00:00
Hajimu UMEMOTO
6484396e99 Sshd writes connected host into utmp directly. If the connection is
via IPv6, the hostname is trimed due to the length of IPv6 address.
This change saves it as possible.
I have a grudge against the shortage of UT_HOSTSIZE.
2000-07-14 18:08:19 +00:00
Hajimu UMEMOTO
b208ff84c1 Add IPv6 scoped address support.
It enables us to control link-local connections by interface like
this:

    ALL : [fe80::%ed0]/10 : allow
    ALL : [fe80::]/10 : deny
2000-07-14 17:15:34 +00:00
Sheldon Hearn
0c69785700 Make sbsize a size instead of a number. This allows the usual suffixes
to be applied to the value given.  This does not break installed
/etc/login.conf files, since un-suffixed numbers are interpreted as
they were before.

PR:		19750
Submitted by:	Paul Herman <pherman@frenchfries.net>
2000-07-14 13:56:07 +00:00
Jeroen Ruigrok van der Werven
62048b0a9e Fix typo, teh -> the. 2000-07-14 11:23:04 +00:00
Dag-Erling Smørgrav
f4683775d7 Fix a bug (misplaced continue) that caused redirects to fail. Lots of code
moved around, but the acutal functional changes are small.
Add support for site-internal redirects (where the Location: header gives a
path instead of an absolute URI)

Pointed out by:	kuriyama
2000-07-13 09:13:58 +00:00
John Baldwin
be0fdc4646 - Allow support for MBR boot loaders that are longer than one sector. As
with fdisk, ensure that they are a multiple of the sector size in length.
- Axe all the 1024 cylinder checks as they are no longer relevant with the
  fixed bootstrap.
2000-07-12 18:05:18 +00:00
Dag-Erling Smørgrav
98f5573fdd Fully document the HTTP authorization feature.
Update the BUGS section to reflect the HTTP rewrite.
2000-07-12 10:41:29 +00:00
Dag-Erling Smørgrav
e4878e39a3 Extensive rewrite of the HTTP code. The new code is significantly cleaner and
more robust, and somewhat more efficient. It also handles authorization and
redirects properly, and supports timeouts like the FTP code.

Many thanks to Umemoto-san for his assistance with IPv6 support, both here
and in other parts of libfetch.
2000-07-12 10:39:56 +00:00
Kris Kennaway
0e0b415c72 Don't call warn() without a format string. 2000-07-12 00:50:15 +00:00
Dag-Erling Smørgrav
e137bceb8f Use fetch_putln() 2000-07-11 23:50:22 +00:00
Dag-Erling Smørgrav
a176302737 Add _fetch_putln() 2000-07-11 23:50:08 +00:00
Kris Kennaway
c2616fc538 Don't call printf without a format string. 2000-07-11 23:49:24 +00:00
Dag-Erling Smørgrav
bc2a5e683a Document that basic authorization now kinda works. 2000-07-11 18:13:08 +00:00
Dag-Erling Smørgrav
35f723db8a Rework the authorization code.
Only send absolute URI if connected to a proxy, since Apache doesn't always
understand absolute URIs.
Clean up some of the debugging output.
2000-07-11 18:12:41 +00:00
Dag-Erling Smørgrav
ec894321e3 Clean up the debugging output 2000-07-11 18:07:09 +00:00
Ben Smithurst
744cb90e1f Fix typo; sa_siginfo -> sa_sigaction
PR:		19602
Submitted by:	Tony Finch <dot@dotat.at>
2000-07-11 11:39:57 +00:00
Peter Wemm
4a1afa49fd Try and fix the worst of some highly bogus malloc/free resource
management involving rcmd_af(), getaddrinfo(), freeaddrinfo(), etc.
We set *ahost to point to ai->canonname; and later free the ai-> stuff
and still leave the old pointers in *ahost to the freed data.
Perhaps the best way to deal with this is a static buffer or a static
strdup() that is freed on the next iteration or something.  This gives
me headaches just thinking about this.

The new 'AJ' default for malloc() tripped this up.
2000-07-11 09:31:19 +00:00
Hajimu UMEMOTO
7487ef6243 Free chunks obtained by getaddrinfo(3).
Approved by:	des
2000-07-10 16:28:28 +00:00
Hajimu UMEMOTO
80fe4a43d1 Separate parsing code of 229 replies from the code for 227 and 228.
Don't assume 227 and 228 replies enclose remote address with parentheses.
2000-07-10 10:00:20 +00:00