GithubHelp home page GithubHelp logo

Comments (5)

mmellison avatar mmellison commented on June 3, 2024

Can you confirm the version of the library you are using?

This looks to be the same as #24 (which was fixed in #25).
If you are not using 0.4.1 or newer, I would suggest upgrading and seeing if the issue persists.

from govici.

enr0n avatar enr0n commented on June 3, 2024

Seeing as this sample code uses Session.Listen, which was changed to Subscribe in v0.4.0, the fix for this (c46d911) is not in your version of the package.

Please upgrade to at least v0.4.1 as @seglberg suggested.

from govici.

weixiaolan2019 avatar weixiaolan2019 commented on June 3, 2024

Thank you, I get it.

from govici.

weixiaolan2019 avatar weixiaolan2019 commented on June 3, 2024

I have another issue, this is the code:

func (t *transport) recv() (*packet, error) {
buf := make([]byte, headerLength)
t.conn.SetReadDeadline(time.Now().Add(time.Second * 20))
_, err := t.conn.Read(buf)
if err != nil {
if ne, ok := err.(net.Error); ok && ne.Timeout() {
return nil, ne
}
return nil, fmt.Errorf("%v: %v", errTransport, err)
}

================================================================
pl := binary.BigEndian.Uint32(buf)
//netbank.cn
need check the validity of buf length, because sometime the length may be a very very big number, I don't know why
if pl > 1024*10 {
fmt.Fprintf(os.Stderr, "vici recv len %v\n, %s", pl, debug.Stack())
return nil, fmt.Errorf("vici error: recv wrong data len %v", pl)
}
//netbank.cn

buf = make([]byte, int(pl))
_, err = t.conn.Read(buf)
if err != nil {
	return nil, fmt.Errorf("%v: %v", errTransport, err)
}

p := &packet{}
err = p.parse(buf)
if err != nil {
	return nil, err
}

return p, nil

}

from govici.

enr0n avatar enr0n commented on June 3, 2024

@weixiaolan2019 Please open a separate issue so we can keep things organized. 😄

from govici.

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.