Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stop the IdHTTP.Post stream upload without closing the connection
#6
(01-27-2019, 02:32 AM)rlebeau Wrote: I don't know if tus allows HTTP-style chunked uploads. Nothing in the tus protocol spec describes that.
Unless you are referring to sending your own "chunks" using separate PATCH requests?  Which is documented.
Yes, after reading some more, what they mean by chunk upload is not the HTTP chunked transfer mode. Just a series of independent patch requests, reusing the connection. So just a misunderstanding on my part.

May I use this thread to ask you something else.

I use an SSL IOhandler. The main Post and Patch calls are executed in a thread. When I want to interrupt them and terminate the thread I called HTTP.Disconnect from the main thread, which causes AVs almost every time. The call stack shows that probably some SSL object was being freed by the disconnect, while still being used.
A search showed me that this is an old problem, e.g. https://stackoverflow.com/questions/5278...n-aborting


In the above SO answer you recommend using Socket.Binding.CloseSocket, instead of Disconnect. Is that still the recommended workaround, considering that the connection might be in a different state (e.g. trying to connect, or transferring)?
Something like

Code:
  if Assigned(fHTTP.Socket.Binding) then
    fHTTP.Socket.Binding.CloseSocket;

This works, but raises EIdSocketError 10053, and I'm not sure whether its safe to ignore those.
Or maybe EIdNotASocket, if I close it before it has connected.
Reply


Messages In This Thread
RE: Stop the IdHTTP.Post stream upload without closing the connection - by vladimir - 01-27-2019, 12:07 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)