Skip to content

Device hangs when client disconnects while file upload #8618

Open
@PaSaSaP

Description

@PaSaSaP

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: Wemos D1 Mini PRO (ESP8266)
  • Core Version: 3.0.2 (official release), Jul 27, 2021
  • Development Env: Arduino IDE
  • Operating System: MacOS

Settings in IDE

  • Module: LOLIN (WEMOS) D1 mini pro (esp8266)
  • Flash Mode: -
  • Flash Size: 16MB (FS: 14MB, OTA:~1019KB)
  • lwip Variant: v2 Higher Bandwidth
  • Reset Method: -
  • Flash Frequency: -
  • CPU Frequency: 80Mhz
  • Upload Using: SERIAL
  • Upload Speed: 3000000

Problem Description

I have checked it on Wemos D1 mini pro and on ESP-01 (default setting + debug messages) and behavior is the same.

Listening socket is not closed when client uploads file to HTTP Server and while uploading client disconnects from WiFi.

To reproduce it on PC with WiFi:

Device need to be restarted manually to "fix" it by hand.
To fix it for now for myself I have introduced timeout (the simplest solution?): master...PaSaSaP:uploadReadByte-timeout but I think that client should be disconnected in similar way just like when socket is closed on client side (which works).

I will try to reproduce it in latest git revision.

MCVE Sketch

Simple sketch available at: https://github.com/PaSaSaP/ESP8266_upload_file_issue

Debug Messages

All serial output with enabled all debug messages available at: https://github.com/PaSaSaP/ESP8266_upload_file_issue/blob/master/serial-output.log

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