Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hidden network error on AzureIoTHTTP_RequestSize #315

Open
2 tasks done
gfurtadoalmeida opened this issue May 22, 2023 · 0 comments
Open
2 tasks done

Hidden network error on AzureIoTHTTP_RequestSize #315

gfurtadoalmeida opened this issue May 22, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@gfurtadoalmeida
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Version

1.1.0

Description of the issue

Context

The AzureIoTHTTP_RequestSize function is used to get a resource size before downloading it. Its return value is the resource size or -1 on error.

Issue

When a network error occurs, especially the HTTPStatus::HTTPNoResponse one, there is no way to know and take a remediating action, like retrying the call.

Suggestions

A) Change the function contract to return a HTTPStatus and add an out parameter to return the resource size.
Downside: breaking change.

HTTPStatus_t AzureIoTHTTP_RequestSize( AzureIoTHTTPHandle_t xHTTPHandle,
                                       char * pucDataBuffer,
                                       uint32_t ulDataBufferLength,
                                       int32_t *lSize )

B) Add a int32_t lLastError field on the AzureIoTHTTPHandle_t structure and create an AzureIoTHTTP_GetLastError function.
Downside: 4 bytes and instrumenting all functions to set the error field with the last error received.

HTTPStatus_t AzureIoTHTTP_GetLastError( AzureIoTHTTPHandle_t xHTTPHandle )

Expected behavior

Know what error occurred with the AzureIoTHTTP_RequestSize function.

Steps to reproduce the issue

No response

Relevant log output

E (31646) AZ_SDK: Response not received: Zero returned from transport recv: totalReceived=0

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ericwolz ericwolz added the enhancement New feature or request label Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants