Coder Social home page Coder Social logo

Comments (6)

cowtowncoder avatar cowtowncoder commented on September 23, 2024

(note: hope to provide patch for this in a day or two)

from async-http-client.

rlubke avatar rlubke commented on September 23, 2024

I'm spending today working on my AHC issues.

Thanks for spotting this. It was a quick and dirty impl to get things going.

A better implementation would be:

final byte[] responseBodyBytes = new byte[responseBody.remaining()];
final int origPos = responseBody.position();
responseBody.get(responseBodyBytes);
responseBody.position(origPos);
return responseBodyBytes;

If you're fine with this as well, then I'll commit, otherwise let me know what you're thinking.

from async-http-client.

cowtowncoder avatar cowtowncoder commented on September 23, 2024

Hmmh. I am also working on patches, I hope I can merge things... there is LOTS of clutter, wrt replication on different impls. And grizzly is actually cleanest of them (this was about the only major thing I noticed).

How about I try merging in my changes, and you can add this patch (which is better than what I had)

from async-http-client.

cowtowncoder avatar cowtowncoder commented on September 23, 2024

Merged in my changes -- I'd appreciate if you have a look at what I did, since I didn't feel fully comfortable with most optimal changes wrt Buffer handling. So you can probably further improve code; and that'd be great overall.

from async-http-client.

rlubke avatar rlubke commented on September 23, 2024

Will review the changes on the master. I've implemented the change above in the 1.7.x branch.

from async-http-client.

rlubke avatar rlubke commented on September 23, 2024

I've made some small modifications on master and ported the getResponseBodyAsBytes().

Will close this issue out.

from async-http-client.

Related Issues (20)

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.