Skip to content

server crashes with certain image/media payloads #46

@mattfeury

Description

@mattfeury

hi! thanks for this server. it is really impressive and helpful.

i'm trying to set it up to send some media data to a device via a POST. i'm able to make an empty file of X bytes and send it successfully:

$ mkfile -n 76369 76369.txt
$ curl -X POST -v --data-binary @76369.txt  "http://192.168.7.58:9000/"
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 192.168.7.58...
* TCP_NODELAY set
* Connected to 192.168.7.58 (192.168.7.58) port 9000 (#0)
> POST / HTTP/1.1
> Host: 192.168.7.58:9000
> User-Agent: curl/7.64.1
> Accept: */*
> Content-Length: 76369
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue
> 
* Done waiting for 100-continue
* We are completely uploaded and fine
< HTTP/1.1 200 OK
< Date: Mon, 21 Sep 2020 16:53:30 GMT
< Connection: keep-alive
< Content-Type: text/plain
< Content-Length: 13
< 
* Connection #0 to host 192.168.7.58 left intact
Hello, World!* Closing connection 0

however. when i try to do this same request with a .png, .jpeg, .mkv, etc, i will often see failures. below is a file of the same size:

$ curl -X POST -v --data-binary @image.jpg  "http://192.168.7.58:9000/"
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 192.168.7.58...
* TCP_NODELAY set
* Connected to 192.168.7.58 (192.168.7.58) port 9000 (#0)
> POST / HTTP/1.1
> Host: 192.168.7.58:9000
> User-Agent: curl/7.64.1
> Accept: */*
> Content-Length: 76369
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue
> 
* Done waiting for 100-continue
* We are completely uploaded and fine
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer

any thoughts as to why this is happening and how i can fix? maybe a character encoding issue?

thanks!

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