Git Product home page Git Product logo

Comments (4)

emersion avatar emersion commented on August 25, 2024

Please open issues about actual bugs, not about a list of things you would've done differently.

errors.Is(err, net.ErrClosed)

Is this about #563?

Also use fmt.Errorf with %w directive, so that underlying error remains in error chain
— that way consumers can also check for net.ErrClosed

No: using %w makes the underlying errors part of the API. This should only be done on a case by case basis.

instead of using locks, one can use a clever set of atomics and single-invocation-enforcing atomic.Bool

No: I prefer simple over clever.

I would also refrain from deferred function literals

No, I don't believe that's the case.

You’d be well served to separate socket management from socket use, ie. separate tcp Listen from imap Login

Doesn't make sense to me.

from go-imap.

resolutecake avatar resolutecake commented on August 25, 2024

It is not the same issue. It is during login. imapclient appears to be closing the socket while it is writing resulting in short write

I wrote a stub imap client that logs in just fine with the exact same login request

  • OK Gimap ready for requests…

I am looking into it.

This would be simpler if each request had its own struct type with fields containing all possible parameters
then a single method that sends serialized data to Write. Like Google did with route message: https://cs.opensource.google/go/x/net/+/refs/tags/v0.19.0:route/route.go;l=72

from go-imap.

emersion avatar emersion commented on August 25, 2024

each request had its own struct type

This would disallow streaming of literals.

from go-imap.

resolutecake avatar resolutecake commented on August 25, 2024

I verified that the issue is not that the socket is closed

There are 4 copies of the socket, and somewhere in that, bufio encounters a short write although the socket is OK
— gmail fails
— my own imap server works but the short write error is visible in the logs

I’m thinking I can catch it with the debugger

I’ll have it figured by tomorrow

Writing functional chaining can make you feel good
It is not a common way to write Go code
Go is a language of structs. If you have more than one value, you use a struct or will eventually have to refactor

I return read-to-end sockets for Android using that Google architecture
What I realized was that people who don’t use that package still use the struct because it can configure routes on any operating system. They put things in the struct, get the byte-stream and use it for something else

Baseless assertions isn’t gong to change that Google has shown us how to do things

Another new language feature is those locks used to retrieve multiple fields could be atomic.Pointer returning an updatable read-only struct of any number of fields thread-safe at once without a lock

What has happened is that any field written after the new function often becomes atomic.Pointer

Anyway, I just need this imapclient to work, and right now it doesn’t

from go-imap.

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.