@@ -81,7 +81,7 @@ static int flb_proxy_input_cb_collect(struct flb_input_instance *ins,
81
81
#ifdef FLB_HAVE_PROXY_GO
82
82
if (ctx -> proxy -> def -> proxy == FLB_PROXY_GOLANG ) {
83
83
flb_trace ("[GO] entering go_collect()" );
84
- ret = proxy_go_input_collect (ctx -> proxy , & data , & len );
84
+ ret = proxy_go_input_collect (ctx , & data , & len );
85
85
86
86
if (len == 0 ) {
87
87
flb_trace ("[GO] No logs are ingested" );
@@ -95,7 +95,7 @@ static int flb_proxy_input_cb_collect(struct flb_input_instance *ins,
95
95
96
96
flb_input_log_append (ins , NULL , 0 , data , len );
97
97
98
- ret = proxy_go_input_cleanup (ctx -> proxy , data );
98
+ ret = proxy_go_input_cleanup (ctx , data );
99
99
if (ret == -1 ) {
100
100
flb_errno ();
101
101
return -1 ;
@@ -110,19 +110,10 @@ static int flb_proxy_input_cb_init(struct flb_input_instance *ins,
110
110
struct flb_config * config , void * data )
111
111
{
112
112
int ret = -1 ;
113
- struct flb_plugin_input_proxy_context * ctx ;
114
- struct flb_plugin_proxy_context * pc ;
115
-
116
- /* Allocate space for the configuration context */
117
- ctx = flb_malloc (sizeof (struct flb_plugin_input_proxy_context ));
118
- if (!ctx ) {
119
- flb_errno ();
120
- return -1 ;
121
- }
113
+ struct flb_plugin_input_proxy_context * pc ;
122
114
123
115
/* Before to initialize for proxy, set the proxy instance reference */
124
- pc = (struct flb_plugin_proxy_context * )(ins -> context );
125
- ctx -> proxy = pc -> proxy ;
116
+ pc = (struct flb_plugin_input_proxy_context * )(ins -> context );
126
117
127
118
/* Before to initialize, set the instance reference */
128
119
pc -> proxy -> instance = ins ;
@@ -147,7 +138,7 @@ static int flb_proxy_input_cb_init(struct flb_input_instance *ins,
147
138
}
148
139
149
140
/* Set the context */
150
- flb_input_set_context (ins , ctx );
141
+ flb_input_set_context (ins , pc );
151
142
152
143
/* Collect upon data available on timer */
153
144
ret = flb_input_set_collector_time (ins ,
@@ -159,12 +150,12 @@ static int flb_proxy_input_cb_init(struct flb_input_instance *ins,
159
150
flb_error ("Could not set collector for threaded proxy input plugin" );
160
151
goto init_error ;
161
152
}
162
- ctx -> coll_fd = ret ;
153
+ pc -> coll_fd = ret ;
163
154
164
155
return ret ;
165
156
166
157
init_error :
167
- flb_free (ctx );
158
+ flb_free (pc );
168
159
169
160
return -1 ;
170
161
}
@@ -311,10 +302,10 @@ static int flb_proxy_input_cb_pre_run(struct flb_input_instance *ins,
311
302
struct flb_config * config , void * data )
312
303
{
313
304
int ret = -1 ;
314
- struct flb_plugin_proxy_context * pc ;
305
+ struct flb_plugin_input_proxy_context * pc ;
315
306
struct flb_plugin_proxy * proxy ;
316
307
317
- pc = (struct flb_plugin_proxy_context * )(ins -> context );
308
+ pc = (struct flb_plugin_input_proxy_context * )(ins -> context );
318
309
proxy = pc -> proxy ;
319
310
320
311
/* pre_run */
0 commit comments