Giter Site home page Giter Site logo

Few bugs to fix about pipelines.websockets HOT 6 CLOSED

mgravell avatar mgravell commented on August 16, 2024
Few bugs to fix

from pipelines.websockets.

Comments (6)

mgravell avatar mgravell commented on August 16, 2024
  • Over disposing

the first is not over-disposed; see just before the return in the success case where it nukes the things (having transferred disposal ownership to result:

            Method = Path = HttpVersion = default(ReadableBuffer);
            Headers = null;
  • Copying data into a readable buffer

                if ((len + WebSocketKeySuffixBytes.Length) > buffer.Length) throw new ArgumentException("Oversized key", nameof(key));
    

(note that the buffer is initialized with an Alloc that gives it more than enough than we need for this scratch area)

  • Should this be more graceful

Yes

  • GetRaw and GetInt32

Nice; will do

  • Dispose the HttpRequest after making the socket object

No; I use it in CompleteHandshakeAsync, and (oops) it should be available in OnAuthenticateAsync . It is already disposed via using when I am done with it.

from pipelines.websockets.

mgravell avatar mgravell commented on August 16, 2024

Note: a method called uint GetInt32() sounds... wrong. GetUInt32() ?

from pipelines.websockets.

davidfowl avatar davidfowl commented on August 16, 2024

the first is not over-disposed; see just before the return in the success case where it nukes the things (having transferred disposal ownership to result:

Ah! subtle...

(note that the buffer is initialized with an Alloc that gives it more than enough than we need for this scratch area)

The danger is that blocks are shared and you don't want to write into a slice of data you don't own. This is an interesting scenario though. Need to think through this one...

Note: a method called uint GetInt32() sounds... wrong. GetUInt32() ?

Yea it should be Uint32 😄 .

from pipelines.websockets.

mgravell avatar mgravell commented on August 16, 2024

But surely if I'm writing into a chunk that I obtained via Alloc with a minimum size, I know I'm OK as long as I don't screw up the offsets? I do check that we have enough in the span from the Alloc - am I missing something?

from pipelines.websockets.

mgravell avatar mgravell commented on August 16, 2024

if the issue is that I need to call Ensure(), I can do that - but I thought that was implicit from an Alloc with minimum size

from pipelines.websockets.

davidfowl avatar davidfowl commented on August 16, 2024

Wait, I'm blind. I thought you were writing into the ReadableBuffer this is fine. 😄

from pipelines.websockets.

Related Issues (3)

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.