@@ -47,7 +47,7 @@ func newHttpHostEmulator() *httpHostEmulator {
47
47
return host
48
48
}
49
49
50
- // impl host rawhostcall.ProxyWASMHost: delegated from hostEmulator
50
+ // impl rawhostcall.ProxyWASMHost: delegated from hostEmulator
51
51
func (h * httpHostEmulator ) httpHostEmulatorProxyGetBufferBytes (bt types.BufferType , start int , maxSize int ,
52
52
returnBufferData * * byte , returnBufferSize * int ) types.Status {
53
53
active := proxywasm .VMStateGetActiveContextID ()
@@ -76,7 +76,7 @@ func (h *httpHostEmulator) httpHostEmulatorProxyGetBufferBytes(bt types.BufferTy
76
76
return types .StatusOK
77
77
}
78
78
79
- // impl host rawhostcall.ProxyWASMHost: delegated from hostEmulator
79
+ // impl rawhostcall.ProxyWASMHost: delegated from hostEmulator
80
80
func (h * httpHostEmulator ) httpHostEmulatorProxyGetHeaderMapValue (mapType types.MapType , keyData * byte ,
81
81
keySize int , returnValueData * * byte , returnValueSize * int ) types.Status {
82
82
key := proxywasm .RawBytePtrToString (keyData , keySize )
@@ -109,7 +109,7 @@ func (h *httpHostEmulator) httpHostEmulatorProxyGetHeaderMapValue(mapType types.
109
109
return types .StatusNotFound
110
110
}
111
111
112
- // impl host rawhostcall.ProxyWASMHost
112
+ // impl rawhostcall.ProxyWASMHost
113
113
func (h * httpHostEmulator ) ProxyAddHeaderMapValue (mapType types.MapType , keyData * byte ,
114
114
keySize int , valueData * byte , valueSize int ) types.Status {
115
115
@@ -145,7 +145,7 @@ func addMapValue(base [][2]string, key, value string) [][2]string {
145
145
return append (base , [2 ]string {key , value })
146
146
}
147
147
148
- // impl host rawhostcall.ProxyWASMHost
148
+ // impl rawhostcall.ProxyWASMHost
149
149
func (h * httpHostEmulator ) ProxyReplaceHeaderMapValue (mapType types.MapType , keyData * byte ,
150
150
keySize int , valueData * byte , valueSize int ) types.Status {
151
151
key := proxywasm .RawBytePtrToString (keyData , keySize )
@@ -168,7 +168,7 @@ func (h *httpHostEmulator) ProxyReplaceHeaderMapValue(mapType types.MapType, key
168
168
return types .StatusOK
169
169
}
170
170
171
- // impl host rawhostcall.ProxyWASMHost
171
+ // impl rawhostcall.ProxyWASMHost
172
172
func replaceMapValue (base [][2 ]string , key , value string ) [][2 ]string {
173
173
for i , h := range base {
174
174
if h [0 ] == key {
@@ -180,7 +180,7 @@ func replaceMapValue(base [][2]string, key, value string) [][2]string {
180
180
return append (base , [2 ]string {key , value })
181
181
}
182
182
183
- // impl host rawhostcall.ProxyWASMHost
183
+ // impl rawhostcall.ProxyWASMHost
184
184
func (h * httpHostEmulator ) ProxyRemoveHeaderMapValue (mapType types.MapType , keyData * byte , keySize int ) types.Status {
185
185
key := proxywasm .RawBytePtrToString (keyData , keySize )
186
186
active := proxywasm .VMStateGetActiveContextID ()
@@ -214,7 +214,7 @@ func removeHeaderMapValue(base [][2]string, key string) [][2]string {
214
214
return base
215
215
}
216
216
217
- // impl host rawhostcall.ProxyWASMHost: delegated from hostEmulator
217
+ // impl rawhostcall.ProxyWASMHost: delegated from hostEmulator
218
218
func (h * httpHostEmulator ) httpHostEmulatorProxyGetHeaderMapPairs (mapType types.MapType , returnValueData * * byte ,
219
219
returnValueSize * int ) types.Status {
220
220
active := proxywasm .VMStateGetActiveContextID ()
@@ -239,7 +239,7 @@ func (h *httpHostEmulator) httpHostEmulatorProxyGetHeaderMapPairs(mapType types.
239
239
return types .StatusOK
240
240
}
241
241
242
- // impl host rawhostcall.ProxyWASMHost
242
+ // impl rawhostcall.ProxyWASMHost
243
243
func (h * httpHostEmulator ) ProxySetHeaderMapPairs (mapType types.MapType , mapData * byte , mapSize int ) types.Status {
244
244
m := proxywasm .DeserializeMap (proxywasm .RawBytePtrToByteSlice (mapData , mapSize ))
245
245
active := proxywasm .VMStateGetActiveContextID ()
@@ -260,15 +260,15 @@ func (h *httpHostEmulator) ProxySetHeaderMapPairs(mapType types.MapType, mapData
260
260
return types .StatusOK
261
261
}
262
262
263
- // impl host rawhostcall.ProxyWASMHost
263
+ // impl rawhostcall.ProxyWASMHost
264
264
func (h * httpHostEmulator ) ProxyContinueStream (types.StreamType ) types.Status {
265
265
active := proxywasm .VMStateGetActiveContextID ()
266
266
stream := h .httpStreams [active ]
267
267
stream .action = types .ActionContinue
268
268
return types .StatusOK
269
269
}
270
270
271
- // impl host rawhostcall.ProxyWASMHost
271
+ // impl rawhostcall.ProxyWASMHost
272
272
func (h * httpHostEmulator ) ProxySendLocalResponse (statusCode uint32 ,
273
273
statusCodeDetailData * byte , statusCodeDetailsSize int , bodyData * byte , bodySize int ,
274
274
headersData * byte , headersSize int , grpcStatus int32 ) types.Status {
@@ -284,15 +284,15 @@ func (h *httpHostEmulator) ProxySendLocalResponse(statusCode uint32,
284
284
return types .StatusOK
285
285
}
286
286
287
- // impl host HostEmulator
287
+ // impl HostEmulator
288
288
func (h * httpHostEmulator ) HttpFilterInitContext () (contextID uint32 ) {
289
289
contextID = getNextContextID ()
290
290
proxywasm .ProxyOnContextCreate (contextID , rootContextID )
291
291
h .httpStreams [contextID ] = & httpStreamState {action : types .ActionContinue }
292
292
return
293
293
}
294
294
295
- // impl host HostEmulator
295
+ // impl HostEmulator
296
296
func (h * httpHostEmulator ) HttpFilterPutRequestHeaders (contextID uint32 , headers [][2 ]string ) {
297
297
cs , ok := h .httpStreams [contextID ]
298
298
if ! ok {
@@ -304,7 +304,7 @@ func (h *httpHostEmulator) HttpFilterPutRequestHeaders(contextID uint32, headers
304
304
len (headers ), false ) // TODO: allow for specifying end_of_stream
305
305
}
306
306
307
- // impl host HostEmulator
307
+ // impl HostEmulator
308
308
func (h * httpHostEmulator ) HttpFilterPutResponseHeaders (contextID uint32 , headers [][2 ]string ) {
309
309
cs , ok := h .httpStreams [contextID ]
310
310
if ! ok {
@@ -317,7 +317,7 @@ func (h *httpHostEmulator) HttpFilterPutResponseHeaders(contextID uint32, header
317
317
len (headers ), false ) // TODO: allow for specifying end_of_stream
318
318
}
319
319
320
- // impl host HostEmulator
320
+ // impl HostEmulator
321
321
func (h * httpHostEmulator ) HttpFilterPutRequestTrailers (contextID uint32 , headers [][2 ]string ) {
322
322
cs , ok := h .httpStreams [contextID ]
323
323
if ! ok {
@@ -328,7 +328,7 @@ func (h *httpHostEmulator) HttpFilterPutRequestTrailers(contextID uint32, header
328
328
cs .action = proxywasm .ProxyOnRequestTrailers (contextID , len (headers ))
329
329
}
330
330
331
- // impl host HostEmulator
331
+ // impl HostEmulator
332
332
func (h * httpHostEmulator ) HttpFilterPutResponseTrailers (contextID uint32 , headers [][2 ]string ) {
333
333
cs , ok := h .httpStreams [contextID ]
334
334
if ! ok {
@@ -339,7 +339,7 @@ func (h *httpHostEmulator) HttpFilterPutResponseTrailers(contextID uint32, heade
339
339
cs .action = proxywasm .ProxyOnResponseTrailers (contextID , len (headers ))
340
340
}
341
341
342
- // impl host HostEmulator
342
+ // impl HostEmulator
343
343
func (h * httpHostEmulator ) HttpFilterPutRequestBody (contextID uint32 , body []byte ) {
344
344
cs , ok := h .httpStreams [contextID ]
345
345
if ! ok {
@@ -351,7 +351,7 @@ func (h *httpHostEmulator) HttpFilterPutRequestBody(contextID uint32, body []byt
351
351
len (body ), false ) // TODO: allow for specifying end_of_stream
352
352
}
353
353
354
- // impl host HostEmulator
354
+ // impl HostEmulator
355
355
func (h * httpHostEmulator ) HttpFilterPutResponseBody (contextID uint32 , body []byte ) {
356
356
cs , ok := h .httpStreams [contextID ]
357
357
if ! ok {
@@ -363,12 +363,12 @@ func (h *httpHostEmulator) HttpFilterPutResponseBody(contextID uint32, body []by
363
363
len (body ), false ) // TODO: allow for specifying end_of_stream
364
364
}
365
365
366
- // impl host HostEmulator
366
+ // impl HostEmulator
367
367
func (h * httpHostEmulator ) HttpFilterCompleteHttpStream (contextID uint32 ) {
368
368
proxywasm .ProxyOnDone (contextID )
369
369
}
370
370
371
- // impl host HostEmulator
371
+ // impl HostEmulator
372
372
func (h * httpHostEmulator ) HttpFilterGetCurrentStreamAction (contextID uint32 ) types.Action {
373
373
stream , ok := h .httpStreams [contextID ]
374
374
if ! ok {
@@ -377,7 +377,7 @@ func (h *httpHostEmulator) HttpFilterGetCurrentStreamAction(contextID uint32) ty
377
377
return stream .action
378
378
}
379
379
380
- // impl host HostEmulator
380
+ // impl HostEmulator
381
381
func (h * httpHostEmulator ) HttpFilterGetSentLocalResponse (contextID uint32 ) * LocalHttpResponse {
382
382
return h .httpStreams [contextID ].sentLocalResponse
383
383
}
0 commit comments