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

detach_get_error return non NULL value regardless of error #307

Open
bibble235 opened this issue Aug 21, 2019 · 0 comments
Open

detach_get_error return non NULL value regardless of error #307

bibble235 opened this issue Aug 21, 2019 · 0 comments

Comments

@bibble235
Copy link

            if (detach_get_error(detach, &error) != 0)
            {
                error = NULL;
            }
            remove_all_pending_deliveries(link_instance, true);
            // signal link detach received in order to handle cases like redirect
            if (link_instance->on_link_detach_received_event_subscription.on_link_detach_received != NULL)
            {
                link_instance->on_link_detach_received_event_subscription.on_link_detach_received(link_instance->on_link_detach_received_event_subscription.context, error);
            }

            if (error != NULL)
            {
                set_link_state(link_instance, LINK_STATE_ERROR);
                error_destroy(error);
            }
            else
            {
                set_link_state(link_instance, LINK_STATE_DETACHED);
            }

In the code above when the function returns detach_get_error returns 0 but the error is not null. Therefore the link state is set to LINK_STATE_ERROR. This is when building on Ubuntu disco. In my case this causes azure-iot-sdk-c to fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant