Skip to content

Byte error in transmission using "responses::FileContentResponse" #159

@squonk11

Description

@squonk11

Currently I am transmitting an XML file (size approx. 700kB) via responses::FileContentResponse from SDcard to the Browser using a REST request/response. In the Browser I process this file using DOMParser()).parseFromString(str, "text/xml"). Approx. every 3rd transmission I get an error message from this parser saying:

XML Parsing Error: not well-formed Location: http://localhost:8080/test Line Number 2977, Column 16:

I analyzed the wireshark trace on some malicious transmissions and found out that on arbitrary positions in this file a character is corrupted; example: in the word "protocol" the last "o" (hex: 0x6F) is being replaced by 0 (hex: 0x00).
Now I am asking myself where this problem comes from. Currently I see the following possibilities:

  1. Error in reading from the SD card
    The error might arise while reading the file from the SD card. Until now I did already many activities with reading files from the SD card and I never saw such an issue. So I think this root cause is not very likely.
  2. Error in processing of the data stream in Smooth
    I guess the responses::FileContentResponse is also being used when transmitting plain HTML pages. Since simple HTML pages seem to work quite well (until now I never saw a problem here), I think also this root cause is quite unlikely the reason.
  3. Error in lwip
    Since lwip is very widely used I don't consider any specific problem here.
  4. Error during TCP/IP transmission in my network
    AFAIK TCP/IP tranmission has integrated crc checks. Additionally I don't see any other issues in my local network. So I guess this also is not the problem.

Having these possible root causes in mind I currently don't know which one is more likely. Or do you see other possible root causes which I did not consider until now? Do you have a suggestion where I should investigate first?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions