Skip to content

Commit

Permalink
Close socket after a 204 with no content-length
Browse files Browse the repository at this point in the history
  • Loading branch information
bjasspa committed Aug 31, 2024
1 parent 6a4c968 commit 28627e2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions microemacs/src/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1796,7 +1796,11 @@ meSockHttpOpen(meIo *io, meUShort flags, meUByte *host, meInt port, meUByte *use
if(ffbuf[0] == '\0')
{
if((io->urlLen < 0) && (err == 204))
{
/* no return data but no content length, best to set length to zero and close connection */
io->urlLen = 0;
io->urlFlags |= meSOCKFLG_CLOSE;
}
if((io->urlFlags & meSOCKFLG_CHUNKED) && (io->urlLen >= 0))
{
if(io->urlOpts & meSOCKOPT_LOG_ERROR)
Expand Down

0 comments on commit 28627e2

Please sign in to comment.