Your comments
Hi Jaehyun,
thanks again for the detailed report and for the test account. I could take a detailed look at the network traffic and found a workaround.
What’s going on
Typical WebDAV servers (Apache mod_dav, Nextcloud/SabreDAV, nginx-dav, Microsoft IIS WebDAV, and so on) keep the same TCP connection open (keep-alive): once you’ve connected to the server, all subsequent requests go through that same connection without having to authenticate again.
cPanel’s Web Disk daemon, cpdavd, on the other hand always adds "Connection: close" and shuts the socket down after every response. (It looks like this is a quirk of cpdavd and that behavior cannot be changed.)
Because of that, Textastic has to open a totally new connection for the next upload. On this fresh connection, iOS hasn’t sent the user name and password yet, so the server rejects the first attempt (returning "401 Unauthorized") and Textastic has to start the upload a second time.
Because Textastic didn’t hand iOS a fresh copy of the upload stream for that retry, the transfer aborted with "request body stream exhausted".
What’s changing
The next Textastic update hands iOS a new stream whenever cpdavd forces that retry. The upload now succeeds – although, due to the server’s behaviour, the file still travels over the wire twice on cPanel Web Disk servers.
For typical source-code-sized files the overhead is negligible, but the error message is gone and the upload completes.
Thanks for helping me track this down! If you run into anything else, just let me know.
Sure, I'll let you know. Is it ok if you keep the account active for a few days? Not sure if I have time to work on it on the weekend.
Thank you! I received the email with the test account credentials. I could login and can reproduce the error.
I'll try to find out what's going on. I'll get back to you when I know more.
A test account would be great.
Update: I have tried to reproduce the problem by uploading a file to my Synology Diskstation's WebDAV server and uploading an existing file worked without problems, so it may be a problem specific to your WebDAV server software.
Ok, thanks for trying it out.
Since I don't currently have a cPanel server:
Would it be possible to give me a test account on the server so I can try to reproduce it with your WebDAV server?
You can send the login details to support@textasticapp.com so it isn't shown on the public feedback forum.
Thanks a lot for the video.
This is not the expected behavior. But in this case, the problem might actually be that you are trying to upload a file with a size of 0 bytes. Please try if uploading a non-empty file works.
I'll try to reproduce the problem. Maybe there is a bug when uploading empty files over WebDAV.
It's great to hear that it works now!
Customer support service by UserEcho
Would you be interested in trying a TestFlight version that includes the fix? I could prepare a TestFlight build tomorrow.
Also, I'm just reading up about the HTTP "Expect: 100-continue" header I could send which has the potential to eliminate the duplicate upload I mentioned earlier. If you could keep the test account running a little longer, I could also test this tomorrow.