dillo-browser / dillo

Dillo, a multi-platform graphical web browser
https://dillo-browser.github.io/
GNU General Public License v3.0
572 stars 30 forks source link

Avoid expensive boundary search inside file #256

Closed rodarima closed 2 months ago

rodarima commented 2 months ago

Prevents Dillo from checking if the boundary collides with the file by making the boundary have 70 random characters which have an extremely low probability of collision.

XaviDCR92 commented 2 months ago

Since the two later commits are modifying things implemented by the first commit on the PR, feel free to squash all of them into a single commit.

rodarima commented 2 months ago

Since the two later commits are modifying things implemented by the first commit on the PR, feel free to squash all of them into a single commit.

I think for this time I'm going to leave it in different commits, as they show the history of how we came with the current implementation and they also build fine.

Could you test it with slcl?

XaviDCR92 commented 2 months ago

Please take into account that the boundary string would still be quoted if no further changes are made. It might be a sensible idea to add an extra commit that removes the quoting from the boundary.

Could you test it with slcl?

I have just tested this branch with slcl and it worked as expected, receiving boundary=u6ngno8jWSmEjUQbfDwOpL8Wb4CWoPkJLyNWKK3usgYzYDA44UIjvE3wyvgLaqiJMVwktn from Dillo.

rodarima commented 2 months ago

Please take into account that the boundary string would still be quoted if no further changes are made. It might be a sensible idea to add an extra commit that removes the quoting from the boundary.

Yes, I'm aware. It looks all major browsers as well as curl do it without quotes, so it should be fairly safe to change it, but let's address it in another PR. There is also another potential problem, as Dillo doesn't finish the last boundary delimiter with CRLF, although the RFC doesn't seem to state that it must be placed there.

I have just tested this branch with slcl and it worked as expected, receiving boundary=u6ngno8jWSmEjUQbfDwOpL8Wb4CWoPkJLyNWKK3usgYzYDA44UIjvE3wyvgLaqiJMVwktn from Dillo.

Thanks!, I'll add it to the ChangeLog and merge it.