View Issue Details

IDProjectCategoryView StatusLast Update
0002859libmicrohttpdHTTPS (TLS)public2021-09-02 17:54
Reporterbulba Assigned ToChristian Grothoff  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.26 
Target Version0.9.28Fixed in Version0.9.28 
Summary0002859: Re issue 0002783
Descriptiongnutls_record_send() barfs with -50 on zero-length send.

if SSL connection enters NORMAL_BODY_READY state without data to send -> infinite select(for write) -> gnutls barf -50 -> select(for write) loop.

What worked for me (connection.c):
in NORMAL_BODY_READY
before calling connection->send_cls()
if zerolenght -> move to FOOTERS_SENT.
Steps To Reproducesame as 0002783
gnutls 3.1.5
TagsNo tags attached.

Activities

Christian Grothoff

2013-05-06 12:49

manager   ~0007089

As there might still be footers, we should transition to BODY_SENT, not FOOTERS_SENT. Patch is in SVN 27035, please let me know if this does not work for some reason.

Christian Grothoff

2013-05-09 13:48

manager   ~0007093

Actually, doing this breaks stuff for HTTP, undone patch in SVN HEAD, will need to look into this more.

bulba

2013-05-15 16:14

reporter   ~0007101

Not much time to help in solving this problem, but:

In MHD_connection_handle_idle():
1) We get here in state MHD_CONNECTION_HEADERS_SENT
2) Which gets us into: MHD_CONNECTION_NORMAL/CHUNKED_BODY_UNREADY
3) Then try_ready_normal/chunked_body returns YES if body available or zerolenght
4) if YES -> we get into MHD_CONNECTION_NORMAL/CHUNKED_BODY_READY

so, just before moving to state MHD_CONNECTION_NORMAL/CHUNKED_BODY_READY
a simple check if (0 == response->total_size) pushing state into MHD_CONNECTION_BODY_SENT && continue should do the job.

Christian Grothoff

2013-05-15 22:04

manager   ~0007102

Ok, I think I fixed it now in 27152. Tests now pass.

Christian Grothoff

2021-09-02 17:54

manager   ~0018211

Fix committed to master branch.

Related Changesets

libmicrohttpd: master a39c6c52

2013-05-16 00:04

Christian Grothoff


Details Diff
-2nd attempt to fix 0002859, this time things look much better Affected Issues
0002859
mod - ChangeLog Diff File
mod - src/microhttpd/connection.c Diff File

Issue History

Date Modified Username Field Change
2013-04-10 02:54 bulba New Issue
2013-05-06 12:49 Christian Grothoff Note Added: 0007089
2013-05-06 12:49 Christian Grothoff Status new => resolved
2013-05-06 12:49 Christian Grothoff Fixed in Version => Git master
2013-05-06 12:49 Christian Grothoff Resolution open => fixed
2013-05-06 12:49 Christian Grothoff Assigned To => Christian Grothoff
2013-05-06 12:52 Christian Grothoff Category SSL => HTTPS (SSL)
2013-05-09 13:48 Christian Grothoff Note Added: 0007093
2013-05-15 16:14 bulba Note Added: 0007101
2013-05-15 16:14 bulba Status resolved => feedback
2013-05-15 16:14 bulba Resolution fixed => reopened
2013-05-15 22:04 Christian Grothoff Note Added: 0007102
2013-05-15 22:04 Christian Grothoff Status feedback => resolved
2013-05-15 22:04 Christian Grothoff Fixed in Version Git master => 0.9.28
2013-05-15 22:04 Christian Grothoff Resolution reopened => fixed
2013-05-15 22:04 Christian Grothoff Target Version => 0.9.28
2013-07-19 13:36 Christian Grothoff Status resolved => closed
2021-09-02 17:54 Christian Grothoff Changeset attached => libmicrohttpd master a39c6c52
2021-09-02 17:54 Christian Grothoff Note Added: 0018211
2024-01-21 13:25 Christian Grothoff Category HTTPS (SSL) => HTTPS (TLS)