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,
131
131
*/
132
132
flb_plg_debug (ins , "Retrieved port from ins->host.port: %d" , ins -> host .port );
133
133
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 ) {
139
135
ctx -> port = FLB_KINESIS_DEFAULT_HTTPS_PORT ;
140
136
flb_plg_debug (ins , "Port not set. Using default HTTPS port: %d" , ctx -> port );
141
137
}
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
+ }
142
141
else {
143
142
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 );
145
144
goto error ;
146
145
}
147
146
Original file line number Diff line number Diff line change 30
30
#define DEFAULT_TIME_KEY_FORMAT "%Y-%m-%dT%H:%M:%S"
31
31
32
32
#define FLB_KINESIS_DEFAULT_HTTPS_PORT 443
33
- #define FLB_KINESIS_MIN_PORT 1
34
- #define FLB_KINESIS_MAX_PORT 65535
35
33
36
34
/* buffers used for each flush */
37
35
struct flush {
@@ -91,7 +89,7 @@ struct flb_firehose {
91
89
const char * log_key ;
92
90
const char * external_id ;
93
91
char * sts_endpoint ;
94
- int port ;
92
+ uint16_t port ;
95
93
char * profile ;
96
94
int custom_endpoint ;
97
95
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,
127
127
* @param ctx The Kinesis output plugin context.
128
128
*/
129
129
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 ) {
136
132
ctx -> port = FLB_KINESIS_DEFAULT_HTTPS_PORT ;
137
133
flb_plg_debug (ins , "Port not set. Using default HTTPS port: %d" , ctx -> port );
138
134
}
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
+ }
139
138
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 );
142
141
goto error ;
143
142
}
144
143
Original file line number Diff line number Diff line change 30
30
#define DEFAULT_TIME_KEY_FORMAT "%Y-%m-%dT%H:%M:%S"
31
31
32
32
#define FLB_KINESIS_DEFAULT_HTTPS_PORT 443
33
- #define FLB_KINESIS_MIN_PORT 1
34
- #define FLB_KINESIS_MAX_PORT 65535
35
33
36
34
/* buffers used for each flush */
37
35
struct flush {
@@ -96,7 +94,7 @@ struct flb_kinesis {
96
94
int retry_requests ;
97
95
char * sts_endpoint ;
98
96
int custom_endpoint ;
99
- int port ;
97
+ uint16_t port ;
100
98
char * profile ;
101
99
102
100
/* 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