2013/1/23 silvioprog <silviop...@gmail.com> > 2013/1/23 silvioprog <silviop...@gmail.com> > >> Hello, >> >> First, sorry for my various requests. I'm contributing to improves this >> beautiful class. >> >> So, how to show a download progress? >> >> I think that the method "ReadResponse" should have two callbacks, like as >> "AContentLenght" and "AContentPosition". What do you think? >> >> Thank you! >> > > Hm... If you change this internal funcion to a class method ...: > > Function Transfer(LB : Integer) : Integer; > begin > Result:=FSocket.Read(FBuffer[1],LB); > If Result<0 then > Raise EHTTPClient.Create(SErrReadingSocket); > if (Result>0) then > Stream.Write(FBuffer[1],Result); > end; > > ... the progress of download will be possible, getting the currenty stream > size (or position?). :) > > ps. i don't tested with chuncked content. :/ >
What do you think about implementa this method?: (...) public procedure ReadingResponse(const ASize, APosition: Int64); virtual; (...) Called internally by ReadResponse. (triggered by normal and chunked reading) -- Silvio Clécio My public projects - github.com/silvioprog
-- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus