File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ STATUS signAwsRequestInfoQueryParam(PRequestInfo pRequestInfo)
235
235
(UINT32 )((pRequestInfo -> pAwsCredentials -> expiration - pRequestInfo -> currentTime ) / HUNDREDS_OF_NANOS_IN_A_SECOND ));
236
236
expirationInSeconds = MAX (MIN_AWS_SIGV4_CREDENTIALS_EXPIRATION_IN_SECONDS , expirationInSeconds );
237
237
238
- #if 0 // Get the required size for the signedURL
238
+ #if USE_DYNAMIC_URL // Get the required size for the signedURL
239
239
UINT32 signedUrlLen = 0 ;
240
240
{
241
241
UINT32 encodedReqLen = 0 ;
@@ -276,9 +276,6 @@ STATUS signAwsRequestInfoQueryParam(PRequestInfo pRequestInfo)
276
276
strlen (SIGNATURE_PARAM_TEMPLATE ), NULL , & encodedReqLen ));
277
277
signedUrlLen += encodedReqLen ;
278
278
signedUrlLen += KVS_MAX_HMAC_SIZE ; // Hex signature value size;
279
-
280
- // + 200 lumpsum bytes to encode other extra requirements (&, =)
281
- // signedUrlLen += 200;
282
279
}
283
280
284
281
// Replace the URL with the larger buffer which could hold signed URL
Original file line number Diff line number Diff line change @@ -832,6 +832,8 @@ struct __RequestHeader {
832
832
};
833
833
typedef struct __RequestHeader * PRequestHeader ;
834
834
835
+ #define USE_DYNAMIC_URL 1
836
+
835
837
/**
836
838
* @brief Request info structure
837
839
*/
@@ -843,7 +845,11 @@ struct __RequestInfo {
843
845
//!< NOTE: In streaming mode the body will be NULL
844
846
//!< NOTE: The body will follow the main struct
845
847
UINT32 bodySize ; //!< Size of the body in bytes
848
+ #if USE_DYNAMIC_URL
849
+ PCHAR url ; //!< The URL for the request
850
+ #else
846
851
CHAR url [MAX_URI_CHAR_LEN + 1 ]; //!< The URL for the request
852
+ #endif
847
853
CHAR certPath [MAX_PATH_LEN + 1 ]; //!< CA Certificate path to use - optional
848
854
CHAR sslCertPath [MAX_PATH_LEN + 1 ]; //!< SSL Certificate file path to use - optional
849
855
CHAR sslPrivateKeyPath [MAX_PATH_LEN + 1 ]; //!< SSL Certificate private key file path to use - optional
Original file line number Diff line number Diff line change @@ -112,16 +112,16 @@ PUBLIC_API STATUS createRequestInfo
112
112
pRequestInfo -> currentTime = GETTIME ();
113
113
pRequestInfo -> callAfter = pRequestInfo -> currentTime ;
114
114
STRNCPY (pRequestInfo -> region , region , MAX_REGION_NAME_LEN );
115
- #if 1
116
- STRNCPY (pRequestInfo -> url , url , MAX_URI_CHAR_LEN );
117
- #else
115
+ #if USE_DYNAMIC_URL
118
116
UINT32 urlLen = strlen (url );
119
117
pRequestInfo -> url = MEMALLOC (urlLen + 1 );
120
118
if (pRequestInfo -> url ) {
121
119
// if allocation was not successful, user function of url will abort
122
120
pRequestInfo -> url [urlLen ] = '\0' ;
123
121
MEMCPY (pRequestInfo -> url , url , urlLen );
124
122
}
123
+ #else
124
+ STRNCPY (pRequestInfo -> url , url , MAX_URI_CHAR_LEN );
125
125
#endif
126
126
if (certPath != NULL ) {
127
127
STRNCPY (pRequestInfo -> certPath , certPath , MAX_PATH_LEN );
@@ -189,8 +189,10 @@ PUBLIC_API STATUS freeRequestInfo(PRequestInfo* ppRequestInfo)
189
189
// Free the header list itself
190
190
singleListFree (pRequestInfo -> pRequestHeaders );
191
191
192
+ #if USE_DYNAMIC_URL
192
193
// Release the url
193
- // SAFE_MEMFREE(pRequestInfo->url);
194
+ SAFE_MEMFREE (pRequestInfo -> url );
195
+ #endif
194
196
195
197
// Release the object
196
198
MEMFREE (pRequestInfo );
You can’t perform that action at this time.
0 commit comments