Skip to content

Commit

Permalink
Fix incorrect internal header include introduced by upload-to-blob re…
Browse files Browse the repository at this point in the history
…factoring (#2510)

Internal headers must not be referenced by any public header.
The recent u2b changes caused iothub_client_core_ll.h to
include internal/iothub_client_ll_uploadtoblob.h, which is incorrect.
This fix removes this include directive from iothub_client_core_ll.h and
moves the type IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE into
iothub_client_core_common.h, solving the need for both client layer and
upload-to-blob modules to reference this type.
  • Loading branch information
ewertons authored Jul 25, 2023
1 parent f14ea55 commit 900f8ae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
10 changes: 0 additions & 10 deletions iothub_client/inc/internal/iothub_client_ll_uploadtoblob.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@ extern "C"

typedef struct IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE_DATA* IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE;

/*
* @remark `struct IOTHUB_CLIENT_LL_UPLOADTOBLOB_CONTEXT_STRUCT` contains information specifically
* related to an individual upload request currently active in Azure IoT Hub, mainly
* the correlation-id and Azure Blob SAS URI provided by the Azure IoT Hub when a new
* upload is started. The `struct IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE_DATA` on the other hand
* holds common information (independent from individual upload requests) that is used for
* upload-to-blob Rest API calls to Azure IoT Hub.
*/
typedef struct IOTHUB_CLIENT_LL_UPLOADTOBLOB_CONTEXT_STRUCT* IOTHUB_CLIENT_LL_UPLOADTOBLOB_CONTEXT_HANDLE;

MOCKABLE_FUNCTION(, IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE, IoTHubClient_LL_UploadToBlob_Create, const IOTHUB_CLIENT_CONFIG*, config, IOTHUB_AUTHORIZATION_HANDLE, auth_handle);

/*
Expand Down
9 changes: 9 additions & 0 deletions iothub_client/inc/iothub_client_core_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ extern "C"
*/
typedef void(*IOTHUB_CLIENT_FILE_UPLOAD_CALLBACK)(IOTHUB_CLIENT_FILE_UPLOAD_RESULT result, void* userContextCallback);

/** @remark `struct IOTHUB_CLIENT_LL_UPLOADTOBLOB_CONTEXT_STRUCT` contains information specifically
* related to an individual upload request currently active in Azure IoT Hub, mainly
* the correlation-id and Azure Blob SAS URI provided by the Azure IoT Hub when a new
* upload is started. The `struct IOTHUB_CLIENT_LL_UPLOADTOBLOB_HANDLE_DATA` on the other hand
* holds common information (independent from individual upload requests) that is used for
* upload-to-blob Rest API calls to Azure IoT Hub.
*/
typedef struct IOTHUB_CLIENT_LL_UPLOADTOBLOB_CONTEXT_STRUCT* IOTHUB_CLIENT_LL_UPLOADTOBLOB_CONTEXT_HANDLE;

#define IOTHUB_CLIENT_RESULT_VALUES \
IOTHUB_CLIENT_OK, \
IOTHUB_CLIENT_INVALID_ARG, \
Expand Down
3 changes: 0 additions & 3 deletions iothub_client/inc/iothub_client_core_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ typedef struct IOTHUB_CLIENT_CORE_LL_HANDLE_DATA_TAG* IOTHUB_CLIENT_CORE_LL_HAND
#include "umock_c/umock_c_prod.h"
#include "iothub_transport_ll.h"
#include "iothub_client_core_common.h"
#ifndef DONT_USE_UPLOADTOBLOB
#include "internal/iothub_client_ll_uploadtoblob.h"
#endif

#ifdef __cplusplus
extern "C"
Expand Down

0 comments on commit 900f8ae

Please sign in to comment.