Coder Social home page Coder Social logo

Comments (11)

nightshade427 avatar nightshade427 commented on July 24, 2024

Its almost as if when calling the parser "(funcall parser data)" returned by "fast-http:make-parser" that it expects all data for all chunks to already be in the stream, which i dont think they arent as its streamed in pieces with cl-async?

It looks like "parse-chunked-body" in fast-http reads the chunk size, then the body, then tries to read the next chunk size right away, which I dont think is there yet from cl-async?

Maybe carrier has to read all the chunked responses first, then call " (funcall parser data)"?

from carrier.

nightshade427 avatar nightshade427 commented on July 24, 2024

It looks like maybe fast-http is calling the "message-complete" callback when done reading each chunk.

So what happens is it fast-http reads the first chunk it was sent by carrier, then fast-http calls "message-complete" after it finishes reading the first chunk, which calls carrier's "our-finish-callback" which finishes the request. Maybe?

from carrier.

orthecreedence avatar orthecreedence commented on July 24, 2024

Yeah, maybe something weird is going on with fast-http. I'll run a few tests...do you have a simple test case you're been using (like a URL you're requesting)? If not I'll try to reproduce via wookie.

from carrier.

nightshade427 avatar nightshade427 commented on July 24, 2024

No sadly, the only uri I have that is even does chunked (and only sometimes) is our authentication system. I googled around to see if I could find a public one that used chunking and couldn't find one.

Let me know what you find out or if I can be of any help ;)

from carrier.

orthecreedence avatar orthecreedence commented on July 24, 2024

I made a simple chunked test in wookie, and i'm able to reproduce. Looks like a fast-http bug.

from carrier.

orthecreedence avatar orthecreedence commented on July 24, 2024

Indeed, I wrote a simple test case and it appears to be a fast-http bug: fukamachi/fast-http#10.

from carrier.

orthecreedence avatar orthecreedence commented on July 24, 2024

Ok, this should be fixed in the latest fast-http, be sure to do a pull there. Let me know if you have problems. Leaving open until I hear back!

from carrier.

nightshade427 avatar nightshade427 commented on July 24, 2024

Thanks again for all the help.

Im getting this error now, here is the code:

(as:with-event-loop ()                                                                                                                                                   
     (asf:alet ((mine (carrier:request "http://localhost:8888/test/test_es.docx" :return-body t)))                                                                          
        (format t "~%mine: ~s~&" mine)))
Expectation failed: NIL                                                                                                                                                           
   [Condition of type FAST-HTTP.PARSER::EXPECT-FAILED]                                                                                                                            

Restarts:                                                                                                                                                                         
 0: [RETRY] Retry SLIME REPL evaluation request.                                                                                                                                  
 1: [*ABORT] Return to SLIME's top level.                                                                                                                                         
 2: [ABORT] Abort thread (#<THREAD "new-repl-thread" RUNNING {1008A85003}>)                                                                                                       

Backtrace:                                                                                                                                                                        
  0: (FAST-HTTP.PARSER::PARSE-CHUNKED-BODY #<unavailable argument> #<unavailable argument> #<unavailable argument> #<unavailable argument> #<unavailable argument>)               
  1: (FAST-HTTP.PARSER:PARSE-RESPONSE #<unavailable argument> #<unavailable argument> #<unavailable argument> :START #<unavailable argument> :END #<unavailable argument>)

But, this works

(as:with-event-loop ()                                                                                                                                                   
     (asf:alet ((mine (carrier:request "http://localhost:8888/test/test_es.txt" :return-body t)))                                                                          
        (format t "~%mine: ~s~&" mine)))

Both appear to be chunked.

from carrier.

fukamachi avatar fukamachi commented on July 24, 2024

It may be fixed at fukamachi/fast-http#11. Could you try it again with the latest fast-http?

from carrier.

nightshade427 avatar nightshade427 commented on July 24, 2024

yep that fixed it ;)

from carrier.

orthecreedence avatar orthecreedence commented on July 24, 2024

👍

from carrier.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.