News:

Wondering if this will always be free?  See why free is better.

Main Menu

Problems with displaying attachments

Started by FxTest, October 05, 2023, 02:18:38 PM

Previous topic - Next topic

FxTest

Hi,
I've noticed a weird thing with 2.1.4 on Apache with HTTP2 enabled .

If you upload attachments they seem to be successfully written but when you access them you get a "Secure Connection Failed" error in Firefox. Stay with me, SSL is fine.

Digging deeper with curl you'll get

curl "https://example.org/index.php?action=dlattach;attach=123456" -H "Cookie: PHPSESSID=..."
 
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)! -
HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)
curl: (52) Empty reply from server

I've kinda narrowed it down to Sources/ShowAttachment.php:362ff (the HTTP_RANGE) stuff.

As I've no clue about the SMF code I just played around a bit and if I completely ignore the range code that loops through the chunks and just use the fopen/echo fread/flush part around line 412 it mostly works, so I don't think there is a general problem.

I've searched around in the forum and found a few promising threads[1] regarding attachments, but I think this is a new one and either a misconfiguration at the hoster (I don't think I can change Apache configs) or a real bug, just with HTTP/2.

Happy to help diagnose more if possible but this is shared hosting (not mine), I've just been called in to help troubleshoot.

JFTR; I ran "file" on the uploaded files and they don't seem to be corrupt, so the upload works.

[1]: https://www.simplemachines.org/community/index.php?topic=583502.msg4134610#msg4134610 I thought this was related but apparently there were some bigger changes after this.

Advertisement: