OK, I am back after a couple of days, spent partially in struggle to reanimate my pathetic Win98.
Anyway, I inserted into download.c, for diagnostic purposes, brute-force dumping of content received (via readbyte function) to standard error. The upload now works. I am at total loss to explain why. Inserting those writes slows the program down considerably, so I could understand that it
ceases to work because it misses some responses from empeg, but it
starts working instead.
This was with logo. I'll see now whether it works with kernel, as well.
UPDATE: It does! So, now I have a very ugly version of download which should not work, but does anyway. Ah, well...