File tree Expand file tree Collapse file tree 4 files changed +14
-20
lines changed Expand file tree Collapse file tree 4 files changed +14
-20
lines changed Original file line number Diff line number Diff line change @@ -131,17 +131,16 @@ static int cb_firehose_init(struct flb_output_instance *ins,
131131 */
132132 flb_plg_debug (ins , "Retrieved port from ins->host.port: %d" , ins -> host .port );
133133
134- if (ins -> host .port >= FLB_KINESIS_MIN_PORT && ins -> host .port <= FLB_KINESIS_MAX_PORT ) {
135- ctx -> port = ins -> host .port ;
136- flb_plg_debug (ins , "Setting port to: %d" , ctx -> port );
137- }
138- else if (ins -> host .port == 0 ) {
134+ if (ins -> host .port == 0 ) {
139135 ctx -> port = FLB_KINESIS_DEFAULT_HTTPS_PORT ;
140136 flb_plg_debug (ins , "Port not set. Using default HTTPS port: %d" , ctx -> port );
141137 }
138+ else if (ins -> host .port == (ctx -> port = (uint16_t )ins -> host .port )) {
139+ flb_plg_debug (ins , "Setting port to: %d" , ctx -> port );
140+ }
142141 else {
143142 flb_plg_error (ins , "Invalid port number: %d. Must be between %d and %d" ,
144- ins -> host .port , FLB_KINESIS_MIN_PORT , FLB_KINESIS_MAX_PORT );
143+ ins -> host .port , 0 , ( uint16_t ) -1 );
145144 goto error ;
146145 }
147146
Original file line number Diff line number Diff line change 3030#define DEFAULT_TIME_KEY_FORMAT "%Y-%m-%dT%H:%M:%S"
3131
3232#define FLB_KINESIS_DEFAULT_HTTPS_PORT 443
33- #define FLB_KINESIS_MIN_PORT 1
34- #define FLB_KINESIS_MAX_PORT 65535
3533
3634/* buffers used for each flush */
3735struct flush {
@@ -91,7 +89,7 @@ struct flb_firehose {
9189 const char * log_key ;
9290 const char * external_id ;
9391 char * sts_endpoint ;
94- int port ;
92+ uint16_t port ;
9593 char * profile ;
9694 int custom_endpoint ;
9795 int retry_requests ;
Original file line number Diff line number Diff line change @@ -127,18 +127,17 @@ static int cb_kinesis_init(struct flb_output_instance *ins,
127127 * @param ctx The Kinesis output plugin context.
128128 */
129129 flb_plg_debug (ins , "Retrieved port from ins->host.port: %d" , ins -> host .port );
130-
131- if (ins -> host .port >= FLB_KINESIS_MIN_PORT && ins -> host .port <= FLB_KINESIS_MAX_PORT ) {
132- ctx -> port = ins -> host .port ;
133- flb_plg_debug (ins , "Setting port to: %d" , ctx -> port );
134- }
135- else if (ins -> host .port == 0 ) {
130+
131+ if (ins -> host .port == 0 ) {
136132 ctx -> port = FLB_KINESIS_DEFAULT_HTTPS_PORT ;
137133 flb_plg_debug (ins , "Port not set. Using default HTTPS port: %d" , ctx -> port );
138134 }
135+ else if (ins -> host .port == (ctx -> port = (uint16_t )ins -> host .port )) {
136+ flb_plg_debug (ins , "Setting port to: %d" , ctx -> port );
137+ }
139138 else {
140- flb_plg_error (ins , "Invalid port number: %d. Must be between %d and %d" ,
141- ins -> host .port , FLB_KINESIS_MIN_PORT , FLB_KINESIS_MAX_PORT );
139+ flb_plg_error (ins , "Invalid port number: %d. Must be between %d and %d" ,
140+ ins -> host .port , 0 , ( uint16_t ) -1 );
142141 goto error ;
143142 }
144143
Original file line number Diff line number Diff line change 3030#define DEFAULT_TIME_KEY_FORMAT "%Y-%m-%dT%H:%M:%S"
3131
3232#define FLB_KINESIS_DEFAULT_HTTPS_PORT 443
33- #define FLB_KINESIS_MIN_PORT 1
34- #define FLB_KINESIS_MAX_PORT 65535
3533
3634/* buffers used for each flush */
3735struct flush {
@@ -96,7 +94,7 @@ struct flb_kinesis {
9694 int retry_requests ;
9795 char * sts_endpoint ;
9896 int custom_endpoint ;
99- int port ;
97+ uint16_t port ;
10098 char * profile ;
10199
102100 /* in this plugin the 'random' partition key is a uuid + fluent tag + timestamp */
You can’t perform that action at this time.
0 commit comments