Media uploads block forever when provided and actual media sizes differ #2

Open
opened 2025-06-18 20:21:20 +02:00 by snit · 0 comments
Owner

When a user uploads some piece of media, the Titan URL requires a size component to be provided, which is the size of the file in bytes. When the provided size and the file's actual size are the same, everything works as expected, but when they differ, reading from the port will block forever.

It seems the port doesn't actually return eof-object? when the media's done uploading like I'd expect it to, so as far as the read function is concerned, the client's implying that it still intends to send more data. My best guess at the moment is that this has something to do with the fact that the port is wrapped in a TLS layer. I'm not sure whether you're even supposed to be able to get eof-object? when it literally isn't the end of the file (it still has to do more TLS stuff after the data we actually care for).

In any case, I have zero clue how to solve this issue. The best thing I can currently think of is to have some sort of timeout, so that it just kills itself if it takes too long, but that's a really stupid bandage fix, and I'd prefer to actually solve the core issue, if possible.

When a user uploads some piece of media, the Titan URL requires a `size` component to be provided, which is the size of the file in bytes. When the provided `size` and the file's actual size are the same, everything works as expected, but when they differ, reading from the port will block forever. It seems the port doesn't actually return `eof-object?` when the media's done uploading like I'd expect it to, so as far as the read function is concerned, the client's implying that it still intends to send more data. My best guess at the moment is that this has something to do with the fact that the port is wrapped in a TLS layer. I'm not sure whether you're even supposed to be able to get `eof-object?` when it literally isn't the end of the file (it still has to do more TLS stuff after the data we actually care for). In any case, I have zero clue how to solve this issue. The best thing I can currently think of is to have some sort of timeout, so that it just kills itself if it takes too long, but that's a really stupid bandage fix, and I'd prefer to actually solve the core issue, if possible.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: snit/gembooru#2
No description provided.