24 Jan 2001 emk   » (Master)

XML-RPC: Hack, hack, hack.

I've added support for HTTP Basic Authentication to xmlrpc-c. This required refactoring the client library to use server objects (instead of just URLs). This enhancement turned into a nightmare debugging job, because the following software sucks more than strictly necessary:

  • PHP: Every time I write a non-trivial PHP program, I spend 15 minutes wondering why some variable is unset when it should contain data. Then I realize that I've left out a global declaration, and PHP has silently created an empty local variable shadowing some global.

  • w3c-libwww: Libwww has this weird, asynchronous callback model, and the API isn't especially well documented. Once you define a callback, libwww feels entitled to call it at the strangest of times--during some failed network operations (but not others), during library shutdown, and whenever you look at it cross-eyed. And sometimes libwww will pass you a "200 OK" when it hasn't even made a network connection, and your chunk pointer will mysteriously be NULL. So my code is now laced with incredibly paranoid assertions, and basically trusts nothing returned by the library.

And let's not even ask which festering ball of bugs was truncating five bytes off the bottom of every XML document. But at least everything now works, and passes my evil test suites once again.

Jade: While I'm ranting about broken tools, I should mention Jade (and JadeTex, and TeX, and all the other hairy DocBook tools). This stuff is impossible to set up. It's badly broken in RedHat 6.2. It requires you to edit TeX *.ini files.

If you're not careful, you'll start mumbling the following nonsense in your sleep:

pdftex -ini -progname=pdfjadetex pdflatex.ini
pdftex -ini -progname=pdfjadetex \&pdflatex pdfjadetex.ini
# restore the original pdflatex.fmt file:
pdftex -ini -progname=pdflatex pdflatex.ini

(Thanks to Adam Di Carlo for figuring this out.)

It's just unbelievable how bad this stuff is. TeX allocates everything in fixed size buffers, and hard-codes the buffer sizes into all of its format files. Jade spews out ASCII NULLs, causing JadeTex to cough up a lung. TeX fmtutil wants to have a little talk with you, and find out where JadeTeX hid all the *.sty files. And of course, let's not forget the joy inherent in editing SGML CATALOG files to work around RedHat typos.

But the resulting manuals are fairly pretty... :-)

Latest blog entries     Older blog 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!