itsjunetime / smserver

An app to allow Jailbroken iPhones to send texts & attachments from their browser
GNU General Public License v3.0
157 stars 26 forks source link

Issue Regarding Large Message Threads #108

Closed da-bacon closed 3 years ago

da-bacon commented 3 years ago

Device Model: iPhone XR Jailbreak: Unc0ver iOS Version: 13.5 How you installed the app: deb file via Zebra A detailed description of what failed: Server fails to return complete text log for large message threads (7,000+ texts). When requesting all texts via the API ("https://ip:port/requests?messages=phone_number&num_messages=0"), the server closes the connection before all the data has been sent. I'm not sure if this is relevant, but it seems that the server closes the connection at roughly 6 seconds every time. This results in an error similar to this requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(1891 bytes read, 8349 more expected)', IncompleteRead(1891 bytes read, 8349 more expected)) in Python (using requests) and an invalid JSON object in Postman or a browser. SMServer & libsmserver version: SMServer - 0.7.4, libsmserver - 0.6.4 Crash log: N/A

itsjunetime commented 3 years ago

Thanks for bringing this up — turns out that the HTTP Server Framework I was using had a default timeout of 7-15 seconds (depending on the situation), so it was timing out and closing the connection prematurely, before processing all the data. I've fixed that (set the timeout to 10 minutes) so this shouldn't be an issue in the next update.

If you'd like to resolve it right now on your own device, though, you can edit the Info.plist file for SMServer (should be located at /Applications/SMServer.app/Info.plist) and add the following keys and values:

CRConnectionKeepAliveTimeout = 600
CRConnectionReadTimeoutKey = 600
CRHTTPConnectionReadHeaderTimeout = 600
CRHTTPConnectionReadBodyTimeout = 600
da-bacon commented 3 years ago

Thanks, love the tweak! I'll test it out soon.

itsjunetime commented 3 years ago

This issue has been fixed in version 0.8.0. Closing.