[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [leafnode-list] [ANNOUNCE] First Leafnode-2.0 beta version

krasel@xxxxxxxxxxxxxxxxxxxxxxxxxxxx (Cornelius Krasel) writes:

> Matthias Andree wrote:
> > krasel@xxxxxxxxxxxxxxxxxxxxxxxxxxxx (Cornelius Krasel) writes:
> > 
> > > /fetchnews.c:1422: warning: variable `msgid' might be clobbered by `longjmp' or `vfork'
> > > 
> > > I have no idea how to fix this. It also occurs under Linux.
> > 
> > It's a GLOBAL variable (miscutil.c), that's why it breaks.
> "msgid" is not a global variable. It is defined in the header of
> fetchnews.c::main().

Oh, it shadows the global declaration? Even worse.

> I am not satisfied with the code for timeouts altogether. One reason is
> that it doesn't work very well; another reason is that it is very clumsy.
> I have no idea what the optimal solution is, though.

I haven't yet looked where timeouts are handled, but I can surely
provide a solution that's based on select. It will be more portable,
nicer, but require to rework leafnode to use UNIX-level I/O, not
ANSI-level I/O. Switching the level will also allow to get a fast and
reliable getaline() even on systems that don't have getline, without
working around. It may later allow to use fast I/O; at least, sendfile()
(on Linux and FreeBSD) may offer a significant reduction in overhead.
Note you will have to set up a small own buffering system, or just take
Dan J. Bernstein's, but that's not BSD-ish.

The dark side is that stdio stuff usually uses 0 for failure, while
UNIX-level usually uses return values < 0 to indicate failure, so
switching will take some care.

Note that this is the last chance in a long time you will ever be able
to switch that since NOW is a cut. Once 2.0 is released, you will not be
able to switch.

I ask you to consider to switch; I have a presentation on Nov. 2nd and
have time to care for that (based on 2.0b4 or b5 or whatever is current

I'd like to do other changes at that time. These changes would aim at
stability, performance, simplification, reusability and portability, I'd
also like to rip miscutil.c apart to "one function per file" to reduce
the number of unused functions linked in (already mentioned in private
mail), and possibly rework things. The fragments of miscutil would be
linked into a library (libeafnode.a - with missing l to allow for
linking with -leafnode ;) - or something).

Note that the linker will always link the ENTIRE miscutil.c, even if it
just uses a single function, that's the reason why the object files
should be small. Don't tell me "RAM is cheap", people might run leafnode
on their 486SLC25 that can only have 8 or 16 MB.

And while major rework is being done, again, I'd like to suggest that
the current gory "manual" Makefile system is changed, it takes a lot of
work to change anything. The automake scheme in 1.9.17ma3 is working for
the people that have tested it.

[strftime warning shut off in 1.9.17ma3]
> It seems to break RFC977 by doing so. There is a reason why I stick to
> the two-digit year format: it is not because I am so glad about these
> warnings, but it is the proper format for NEWGROUPS as described in that
> RFC.

No, it uses %Y, and then discards the first two characters it has got
back. This way, while gcc shuts up since you're using %Y, the server is
still properly sent NEWGROUPS YYMMDD... as required by RFC-977.

(That's what I meant in my other mails here. Fix, don't work around.)

You sent a private piece of mail mentioning that you discovered the
elegance of that solution, so I assume you already know that; I'm
mentioning this here for the public.

Matthias Andree

leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list