Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App doesn't use HTTP keep-alive #145

Open
rthellend opened this issue Jul 12, 2023 · 2 comments
Open

App doesn't use HTTP keep-alive #145

rthellend opened this issue Jul 12, 2023 · 2 comments
Assignees
Labels
feature New feature or request

Comments

@rthellend
Copy link
Contributor

rthellend commented Jul 12, 2023

The android app creates a new TCP connection for every request to the server. By default, HttpsURLConnection enables HTTP keep-alive, but something in the app's code makes it so that the TCP connections cannot be reused.

This means that every HTTPS request requires a TLS handshake, and the underlying TCP connection stays open until the keep-alive timeout is reached.

A quick google search on java HttpsURLConnection not using http keep-alive seems to indicate that the problem might be:

https://github.com/stingle/stingle-photos-android/blob/master/StinglePhotos/src/main/java/org/stingle/photos/Net/HttpsClient.java#L82

			conn.setSSLSocketFactory(sc.getSocketFactory());

The return value of sc.getSocketFactory() would need to be reused between requests

@rthellend rthellend changed the title pp doesn't use HTTP keep-alive App doesn't use HTTP keep-alive Jul 12, 2023
@alexamiryan
Copy link
Contributor

Thanks for the report

@alexamiryan alexamiryan self-assigned this Jul 12, 2023
@alexamiryan alexamiryan added the feature New feature or request label Jul 12, 2023
@n00b42
Copy link
Contributor

n00b42 commented Dec 4, 2023

I use a private DNS server on my phone (dnsforge.de), and when I enable it, I sometimes have issues when uploading several (larger) files at once. (The upload requests fail)
rthellend gave me the tipp that this might be related to this issue, as there might be the possibility that each request does its own dns lookup and therefore might trigger a ratelimit or something alike.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants