Azure / azure-c-shared-utility

Azure C SDKs common code
Other
111 stars 203 forks source link

remove invalid xio_close #569

Closed jlaliMohamed closed 2 years ago

jlaliMohamed commented 2 years ago

remove invalid xio_close when using http_compact, mbedtls and proxy

danewalton commented 2 years ago

Hi @jlaliMohamed can you give more details on why you think this is invalid?

jlaliMohamed commented 2 years ago

Hi @danewalton, The problem is produced when using http_compact, tlsio mbedtls and proxy. After sending a successful http request (using mebdtls as a TLS layer and proxy) we receive a log like this:

[... httpapi_compact.c:774 ] Waiting for TLS connection
[... httpapi_compact.c:774 ] Waiting for TLS connection
[... httpapi_compact.c:774 ] Waiting for TLS connection
[... http_proxy_io.c:785 ] Invalid tlsio_state. Expected state is HTTP_PROXY_IO_STATE_OPEN.

when closing the io socket, the tls (for mbdtls) does the closing, then in the destroy tlsio_mbedtls_destroy function it calls the xio_close again. To resume is a double call of xio_close ()

danewalton commented 2 years ago

I have a repro. Looking into it to double check this is the right solution.

danewalton commented 2 years ago

/azp run

azure-pipelines[bot] commented 2 years ago
Azure Pipelines successfully started running 1 pipeline(s).
danewalton commented 2 years ago

fixed ut in #572