Skip to content

sftp client hang when exit in sftp server example #563

Closed

Description

@wwcd

cause this problem after fix #554,err == nil should be added

if err := server.Serve(); err == io.EOF {

Activity

  1. puellanivis commented on Nov 9, 2023

    @puellanivis
    Collaborator

    Hm… I would probably rework it to:

    if err := server.Serve(); err != nil {
    	if err != io.EOF {
    		log.Fatal("sftp server completed with error:", err)
    	}
    }
    server.Close()
    log.Print("sftp client exited session.")
    

    P.S.: Feel free to open a PR, it should be a short one, and we could get it all approved and merged quickly.

  2. wwcd commented on Nov 9, 2023

    @wwcd
    ContributorAuthor

    ok, my pleasure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions