Older blog entries for uweo (starting at number 27)

A bug report for ftpcopy came in today: ftpcopy doesn't work over socks5 using runsocks. After a little bit of investigating it turned out that the socks5 library includes a wrapper for select(). This wrapper sets some flag if a non-blocking socket is connected now. Later this flag is needed inside the getpeername() wrapper.
Now there's no such wrapper for poll. Impact: Bang. Connect failed. No, not really, but ftpcopy couldn't tell.

I'll include some way to turn of the usage of poll at compiletime. The clean solution would be to fix socks5, but i don't really like the nec peoples copyright, and i don't like the code. Somebody forgot KISS.
Besides, what's socks good for? Isn't it just an excuse for not using the right firewall?

I wrote:

I'm quite confident that it's stable
Proofreading is better. It wasn't stable, of course. I wrote a buffer to a place on the disk instead of reading it. Quite stupid, but _hard_ to detect. I couldn't believe it when i looked into the code.

I wrote some code in the mean time. I also wait for the next fatal bug report for ftpcopy, but nobody seems to have found it by now. Oh well.

The new code is a caching library with some command line tools around it. Nothing complicated, just a kind of "put this into the cache and if there's not enough space then throw away the oldest entries", but it took me some days to get the bugs out. I'm quite confident that it's stable by now.

Now i want to package it up and release it to the world, hoping that somebody else will not have to reinvent the wheel. But coding for me is one thing, coding for others is completely different. I mean, it hurts to say "you are an idiot and this code doesn't work reliably" to yourself - but it hurts even more if someone else tells this truth to you.
So i better make sure ... what? That's there the problem starts.

  • Documentation. There be a manual page? Sorry, have to write this myself. But i hate writing documentation.
    This time i'm going to not use POD but tmac.an, and try to get something readable from groff -Thtml.
  • Code quality. There's a big difference between "works for me" and "works or does something reasonable in every situation". "works for me" usually means "breaks on machines with different endian or alignment requirements". Think of possible overflows everywhere. What about strange input values or a corrupted cache? I've to re-read the whole stuff. It's _so_ boring.
  • What hidden limitations do the functions have? Remove or document them (the problem is the "hidden" part).
  • Simplicity: make sure that the code is so simple that at least i don't have problems to understand it in 17 months from now. This possibly means to rewrite the function to enter something into the cache. Not funny.

  • Library API: make sure the API is consistent. I tend to not even notice "f(char *buf, bufsize)" against "g(bufsize, buf)". Make sure the functions, constants, ... have reasonable names.
  • Command line API: make sure the tools options and arguments are consistent.
  • Locking: Did i _really_ correctly document the locking requirements? I don't think i'll get it right the first time ...
That's _work_. Boring work. Stuff for some evenings.

And it's summer now. For that kind of stuff winter has been invented, i think.

Sick, including, but not limited to, headaches. Not funny.

Am i just unable to think or is this paragraph of 6.16 of the usefor draft starting with

Whenever an Xref header is created by an agent for an article which includes a Replaces header with "disposition=revise" or "disposition=repost" (6.15), it SHOULD include, within the location field of each newsgroup in the Newsgroups header of whichever of the old articles referenced in that Replaces header is still current, a corresponding "revise:<old-article-locator>" or "repost:<old-article-locator>" for the oldest article known to be replaced, where <oldest-article-locator> is the article-locator under which that oldest article was filed.
not really clear?
I had a hard time understanding this sentence, but if i understood correctly then the chance that this will be implemented in the more important servers is nil.

The new built house is being painted ... but there's no sign that the work on the old one will continue this month.

Junta was the next game, and a funny one, again.

Continued to work on the news server today. Work? Rewrite of almost anything. Fixed a few bugs, added a few test cases. Spent most of the time thinking about some major design problems (like how to get a moderately fast history without needing lots of memory). No conclusion yet, but a few ideas:

  1. move the history to an own daemon process.This should take care of the ever-changing API problem :-)
  2. leave the group index as it is for now.
    can use a daemon for that, too, but later ...
  3. the history stuff will be accessible through a udp socket, just the commands will have to go through a pipe or unix daemon socket.
  4. not having an overview is fine, except for performance. Possible speedup: move the article header caches from the nntps daemons to a cache daemon.
    Is it worth the pain? (not that performance is _so_ bad, but the whole stuff is slower than i like it. The parsing isn't the problem, it's the article read time.)

Apart from that: i'm not feeling well. Am i catching a cold or is it because i didn't sleep enough? (the later is true, anyway)

Gaming evening. And today is the first time in all the long years that i'm certainly not going to win britannia.
That's what you get if everybody else allies against you. Should i get the lowest number of points i'll choose Junta for the next game.

Since the last diary entry i've worked on ftpcopy (0.3.7 released - a bugfix release only), which now has a test suite. I've spent about 16 hours or so on that, including fixes for the bugs i found during that. The time was well invested.

I also worked on upgpverify. It already had a test suite (yes, i took this project serious). The 0.3.3 version adds the ability to deal with signed news using the X-PGP-Sig header.

Junta will almost certainly be the next game.

Work wasn't funny this week (it wasn't since i came back from vacation).

fefe found another bug in ftpcopy.

And i wasn't even surprised when i saw his mail. In fact i had a bad feeling about the last changes in the handle of the primary target. I wasn't comfortable with initialentity() (too much "magic"), and thought about rewriting it, but then all my tests passed, and i told myself "new code is worse than working code".

Right. Too bad that there was no working code.

Regarding testing: I really need to automate the tests.

5 Apr 2001 (updated 5 Apr 2001 at 14:02 UTC) »
mrorganic: i love you merkins. If you don't know how to fly an airplane or to protect your valuable espionage machines then be quiet, but don't call for more military action. (killing a chinese pilot certainly _is_ military action)

A war because you lost your espionage toy? Get real. The world will be a safer place without it.
The chinese usually don't kill foreigners, but war is quite likely to.

End of flame.

olandgren wrote:

It's really surprising how easy life becomes when you realize that you are competent, can get stuff done, and are not something completely worthless. It's very interesting how the positive feedback cycle works.
Yes, but never forget that lesson. And don't forget to help others to get competent, for your own sake.
Q: What happens with this code:
sockfd=accept(fd, (struct sockaddr *)&sin, &sinl);
if (sin.sin_family==AF_INET6) 
  if (sinl<sizeof(struct sockaddr_in6))
   return ERROR;
/* ok */
if it happens to meet a glibc-2.2 / linux-2.2.18 system?

A: The kernel sets sinl to 24. sizeof(struct sockaddr_in6), if taken from netinet/in.h, is 28.

Things like this aren't likely to make me happy.

18 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!