we can recurse when loading dependencies and that the kstack is limited
to something like 6 or 7KB. Having a single dependency caused an instant
double panic, and I stronly suspect some of the other strange "events"
that I have seen are possibly as a result of taking a couple of interrupts
with a large chunk of the stack already in use.
While here, fix a minor logic hiccup in a sanity check.
I don't have access to a BSD/OS machine to check the veracity of the
magic number. However, no harm will be done by the commit and since
someone was motivated enough to file a PR, I'm committing the change.
PR: 7629
Submitted by: Jos Backus <jbackus@plex.nl>
alphabetical order:
Makefile:
Add common.c to SRCS.
Make debugging easier by making 'CFLAGS += -DNDEBUG' conditional on DEBUG
Don't declare struct {ftp,http}err in {ftp,http}err.c; use struct fetcherr
instead.
README:
Remove the todo list, which is out of date anyway.
common.c: (new file)
Gather utility functions in this file.
Merge the error reporting functions intp _fetch_errstring(),
_fetch_seterr() and _fetch_syserr().
Set fetchLastErrCode and fetchLastErrText appropriately when fetchConnect
fails.
common.h: (new file)
Gather internal prototypes and structures in this files.
fetch.3:
Undocument fetchFreeURL().
Document a few more known bugs.
Document fetchLastErrCode and fetchLastErrText.
fetch.c:
Add descriptive comments to all functions that lacked them.
Move fetchConnect() to common.c.
Obviate the need for fetchFreeURL(), and remove it.
fetch.h:
Modify struct url_t so the document part is at the end.
ftp.c:
Remove code that is duplicated elsewhere.
http.c:
Remove code that is duplicated elsewhere.
Prompted by: jkh
file to a stream socket. sendfile(2) is similar to implementations in
HP-UX, Linux, and other systems, but the API is more extensive and
addresses many of the complaints that the Apache Group and others have
had with those other implementations. Thanks to Marc Slemko of the
Apache Group for helping me work out the best API for this.
Anyway, this has the "net" result of speeding up sends of files over
TCP/IP sockets by about 10X (that is to say, uses 1/10th of the CPU
cycles) when compared to a traditional read/write loop.
o Add fexists word to check for the presence of a file
o make fexists and fload immediate words which DTRT both interpreted
and compiled (doh!)
o add an init word which gets run at bootstrapping time to do extra
post-coldload initialization (in the default implementation, we
look for /boot/boot.4th and load it if found).