Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
HttpGeneralHeaders.cs
Go to the documentation of this file.
2
3internal sealed class HttpGeneralHeaders
4{
6
8
10
12
14
16
18
19 private readonly HttpHeaders _parent;
20
22
23 private bool _connectionCloseSet;
24
36
38
39 public bool? ConnectionClose
40 {
41 get
42 {
43 return GetConnectionClose(_parent, this);
44 }
45 set
46 {
47 if (value == true)
48 {
51 }
52 else
53 {
54 _connectionCloseSet = value.HasValue;
56 }
57 }
58 }
59
61 {
62 get
63 {
65 }
66 set
67 {
69 }
70 }
71
73 {
74 get
75 {
76 if (_pragma == null)
77 {
79 }
80 return _pragma;
81 }
82 }
83
85 {
86 get
87 {
88 if (_trailer == null)
89 {
91 }
92 return _trailer;
93 }
94 }
95
97
99 {
100 get
101 {
103 }
104 set
105 {
106 if (value == true)
107 {
109 TransferEncodingCore.SetSpecialValue();
110 }
111 else
112 {
114 TransferEncodingCore.RemoveSpecialValue();
115 }
116 }
117 }
118
120 {
121 get
122 {
123 if (_upgrade == null)
124 {
126 }
127 return _upgrade;
128 }
129 }
130
132 {
133 get
134 {
135 if (_via == null)
136 {
138 }
139 return _via;
140 }
141 }
142
144 {
145 get
146 {
147 if (_warning == null)
148 {
150 }
151 return _warning;
152 }
153 }
154
156 {
157 get
158 {
159 if (_connection == null)
160 {
162 }
163 return _connection;
164 }
165 }
166
178
179 internal static bool? GetConnectionClose(HttpHeaders parent, HttpGeneralHeaders headers)
180 {
181 if (headers?._connection != null)
182 {
183 if (headers._connection.IsSpecialValueSet)
184 {
185 return true;
186 }
187 }
188 else if (parent.ContainsParsedValue(KnownHeaders.Connection.Descriptor, "close"))
189 {
190 return true;
191 }
192 if (headers != null && headers._connectionCloseSet)
193 {
194 return false;
195 }
196 return null;
197 }
198
199 internal static bool? GetTransferEncodingChunked(HttpHeaders parent, HttpGeneralHeaders headers)
200 {
201 if (headers?._transferEncoding != null)
202 {
203 if (headers._transferEncoding.IsSpecialValueSet)
204 {
205 return true;
206 }
207 }
209 {
210 return true;
211 }
212 if (headers != null && headers._transferEncodingChunkedSet)
213 {
214 return false;
215 }
216 return null;
217 }
218
220 {
221 _parent = parent;
222 }
223
224 internal void AddSpecialsFrom(HttpGeneralHeaders sourceHeaders)
225 {
226 if (!TransferEncodingChunked.HasValue)
227 {
229 }
230 if (!ConnectionClose.HasValue)
231 {
232 ConnectionClose = sourceHeaders.ConnectionClose;
233 }
234 }
235}
static readonly Action< HttpHeaderValueCollection< string >, string > TokenValidator
static ? DateTimeOffset GetDateTimeOffsetValue(HeaderDescriptor descriptor, HttpHeaders store, DateTimeOffset? defaultValue=null)
static readonly TransferCodingHeaderValue TransferEncodingChunked
HttpHeaderValueCollection< WarningHeaderValue > Warning
HttpHeaderValueCollection< TransferCodingHeaderValue > _transferEncoding
static ? bool GetConnectionClose(HttpHeaders parent, HttpGeneralHeaders headers)
HttpHeaderValueCollection< TransferCodingHeaderValue > TransferEncodingCore
HttpHeaderValueCollection< WarningHeaderValue > _warning
HttpHeaderValueCollection< ProductHeaderValue > Upgrade
static ? bool GetTransferEncodingChunked(HttpHeaders parent, HttpGeneralHeaders headers)
HttpHeaderValueCollection< string > Trailer
HttpHeaderValueCollection< string > _trailer
HttpHeaderValueCollection< NameValueHeaderValue > Pragma
HttpHeaderValueCollection< ViaHeaderValue > Via
HttpHeaderValueCollection< NameValueHeaderValue > _pragma
void AddSpecialsFrom(HttpGeneralHeaders sourceHeaders)
HttpHeaderValueCollection< ViaHeaderValue > _via
HttpHeaderValueCollection< string > _connection
HttpHeaderValueCollection< ProductHeaderValue > _upgrade
HttpHeaderValueCollection< string > ConnectionCore
HttpHeaderValueCollection< string > Connection
bool ContainsParsedValue(HeaderDescriptor descriptor, object value)
void SetOrRemoveParsedValue(HeaderDescriptor descriptor, object value)
object GetParsedValues(HeaderDescriptor descriptor)
static readonly KnownHeader Date
static readonly KnownHeader TransferEncoding
static readonly KnownHeader Trailer
static readonly KnownHeader Connection
static readonly KnownHeader CacheControl
static readonly KnownHeader Warning
static readonly KnownHeader Upgrade
static readonly KnownHeader Pragma
static readonly KnownHeader Via