Hacker News new | ask | show | jobs
by aboardRat4 77 days ago
>Everyone use HTTP upload nowadays, it works all the time

No it doesn't. Firstly, an out-of-band upload is ridiculous. Secondly, it doesn't support upload resumption in case the network is bad.

2 comments

>Firstly, an out-of-band upload is ridiculous

It is a bit, true, but the alternatives are worse. XEP-0231 (Bits of Binary) Base64-encoded data inside the text message is more ridiculous idea. Direct P2P connections, which were widely used before HTTP upload, are mostly not working in our day.

>it doesn't support upload resumption in case the network is bad.

There's a draft for HTTP for it: https://httpwg.org/http-extensions/draft-ietf-httpbis-resuma...

Re: P2P, it's kind of making an impromptu comeback. If you want some trivia, IIRC, the developer of Conversations was on some trans-continental flight few months ago and realized that XMPP works just fine on the free onboard internet plan (being considered by the firewall as legitimate "social-usage"), except for HTTP upload. So now, when your HTTP upload fails, Conversations asks if you want to try again with P2P, so you can send your images for free from the plane :-)
>but the alternatives are worse

It's not that "alternatives are worse, it's that xmpp is a broken protocol, which doesn't include support for anything, even such a basic thing"

>There's a draft

LOOOOOOOOL

XMPP was not designed for human chat only, and XMPP foundation promotes it as an IoT communication protocol, like MQTT. Thanks to Daniel, the author of this post, we now have communication profiles which the IM-oriented servers and clients follow.
>XMPP foundation promotes it as an IoT communication protocol, like MQTT

Which means that it will never work for human messaging, due to all the IoT cruft.

>Thanks to Daniel, the author of this post, we now have communication profiles which the IM-oriented servers and clients follow.

LOL, he only implemented p2p transfers when it bit himself in the tail on a plane flight.

Conversations is the best of them all, but it doesn't mean that it is good.

I use XMPP almost exclusively for the last 10 years and don't see any major issues, not with the protocol, not with the clients. Everything is pretty reliable and works fine.
Yeah, me too. Even my mom agrees to use it, because she loves me. But it's a "worksforme" fallacy.
Having media out of band causes some problems but eases others. Having a separate tcp window for media and messages is pretty valuable. Additionally, if media is separate, you might run it in different locations than chat.

HTTP may not have native resumption, but it's not hard to do partial upload and resumption over HTTP, you just need agreement on parameters / a protocol to determine where to resume from.

>Having a separate tcp window for media and messages is pretty valuable

What for?

>t's not hard to

LOOOOOOOOL

>>t's not hard to

> LOOOOOOOOL

? I've done it a few times. It worked fine on Nokia S40 and the version of J2ME they run can't even seek backwards in files.

It's a three part recipe:

a) send a request to upload with whatever auth you need, some stable identifier for the file and the file size. Ideally a nice checksum to confirm the file was not corrupted in transit; TLS should protect you, but I've seen things, a 32-byte sha256 checksum offers protection from a lot of things.

b) if the upload is unfinished, you'll get a url (or whatever) to post to and a starting offset (0 on the first time); if the upload is complete, you'll get a download url to send to your correspondent. (or an error like file too big, try again later, go away, whatever)

c) upload the file to the url. Maybe get a status if the upload finishes and you're still online to receive it. Status could indicate error or a download url. If you timeout or get a retriable error, go back to part a.

It's not rocket science or anything. Maybe it would be hard to get done in the XMPP ecosystem, but it's simple enough to do with any stack that's got big enough media that resuming uploads is relevant.

yeah, yeah, yeah.

Now tell your girlfriend's mother to do the same.

>What for?

To prevent head-of-line blocking.

>To prevent head-of-line blocking.

Of course using TCP has nothing to do with head-of-line blocking.

Only if you blindly do write(socket, fileptr, sizeof(file)), it starts to matter, but, you know, people did not start writing for TCP/IP yesterday.

If you have a decent protocol, it splits files (and texts as well) into chunks, and sends them in prioritized order, text chunks having higher priority than binary chunks. The server re-assembles the chunks then.

The fact that such a simple way of multiplexing data is a discovery for XMPP fanboys is very revealing.

You can certainly chunk things and interleave/multiplex interactive and bulk data.

But it's easy to end up with low throughput, because you limit how much unacked bulk data you send, because you don't want to overqueue bulk data and not be able to immediately write interactive messages.

And it's easy to end up with high latency, because despite the limits above, you queued too much and interactive messages need to wait. Or you sent bulk data and there was a burst of packet loss and new data can't be received until the missing packets are resent and received.

> people did not start writing for TCP/IP yesterday.

And yet you find resuming uploads over http to be too hard?

>But it's easy to end up with low throughput,

>And it's easy to end up with high latency,

And yet the OS is doing just that when you open two TCP streams. It packs them into ethernet frames and keeps track of the acks. Only the OS does not know the context, so it prioritises both streams equally. (Unless some evil magic is involved.)

>And yet you find resuming uploads over http to be too hard?

Me? No. Xmpp developers? Apparently yes, as it's neither in any of the XEPs nor in any of the clients.