3
A brief file description
5
@section license License
7
Licensed to the Apache Software Foundation (ASF) under one
8
or more contributor license agreements. See the NOTICE file
9
distributed with this work for additional information
10
regarding copyright ownership. The ASF licenses this file
11
to you under the Apache License, Version 2.0 (the
12
"License"); you may not use this file except in compliance
13
with the License. You may obtain a copy of the License at
15
http://www.apache.org/licenses/LICENSE-2.0
17
Unless required by applicable law or agreed to in writing, software
18
distributed under the License is distributed on an "AS IS" BASIS,
19
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
See the License for the specific language governing permissions and
21
limitations under the License.
24
#ifndef __TRANSFORM_INTERNAL_H__
25
#define __TRANSFORM_INTERNAL_H__
30
#include "Transform.h"
31
#include "P_EventSystem.h"
34
class TransformVConnection;
37
class TransformTerminus:public VConnection
40
TransformTerminus(TransformVConnection * tvc);
42
int handle_event(int event, void *edata);
44
VIO *do_io_read(Continuation * c, int64_t nbytes, MIOBuffer * buf);
45
VIO *do_io_write(Continuation * c, int64_t nbytes, IOBufferReader * buf, bool owner = false);
46
void do_io_close(int lerrno = -1);
47
void do_io_shutdown(ShutdownHowTo_t howto);
49
void reenable(VIO * vio);
52
TransformVConnection * m_tvc;
55
volatile int m_event_count;
56
volatile int m_deletable;
57
volatile int m_closed;
62
class TransformVConnection:public VConnection
65
TransformVConnection(Continuation * cont, APIHook * hooks);
66
~TransformVConnection();
68
int handle_event(int event, void *edata);
70
VIO *do_io_read(Continuation * c, int64_t nbytes, MIOBuffer * buf);
71
VIO *do_io_write(Continuation * c, int64_t nbytes, IOBufferReader * buf, bool owner = false);
72
void do_io_close(int lerrno = -1);
73
void do_io_shutdown(ShutdownHowTo_t howto);
75
void reenable(VIO * vio);
78
VConnection * m_transform;
80
TransformTerminus m_terminus;
81
volatile int m_closed;
85
class TransformControl:public Continuation
90
int handle_event(int event, void *edata);
95
IOBufferReader *m_read_buf;
96
MIOBuffer *m_write_buf;
100
class NullTransform:public INKVConnInternal
103
NullTransform(ProxyMutex * mutex);
106
int handle_event(int event, void *edata);
109
MIOBuffer * m_output_buf;
110
IOBufferReader *m_output_reader;
115
class RangeTransform:public INKVConnInternal
118
RangeTransform(ProxyMutex * mutex, MIMEField * range_field, HTTPInfo * cache_obj, HTTPHdr * transform_resp);
121
void parse_range_and_compare();
122
int handle_event(int event, void *edata);
124
void transform_to_range();
125
void add_boundary(bool end);
126
void add_sub_header(int index);
127
void change_response_header();
128
void calculate_output_cl();
129
bool is_this_range_not_handled()
131
return m_not_handle_range;
133
bool is_range_unsatisfiable()
135
return m_unsatisfiable_range;
138
typedef struct _RangeRecord
141
_start(-1), _end(-1), _done_byte(-1)
150
MIOBuffer * m_output_buf;
151
IOBufferReader *m_output_reader;
152
MIMEField *m_range_field;
153
HTTPHdr *m_transform_resp;
155
bool m_unsatisfiable_range;
156
bool m_not_handle_range;
157
int64_t m_content_length;
158
int m_num_chars_for_cl;
159
int m_num_range_fields;
161
const char *m_content_type;
162
int m_content_type_len;
163
RangeRecord *m_ranges;
170
class PrefetchProcessor
176
extern PrefetchProcessor prefetchProcessor;
179
#endif /* __TRANSFORM_INTERNAL_H__ */