Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ WriteHeadersAsync()

async ValueTask System.Net.Http.HttpConnection.WriteHeadersAsync ( HttpHeaders headers,
string cookiesFromContainer,
bool async )
inlineprivate

Definition at line 1257 of file HttpConnection.cs.

1258 {
1259 if (headers.HeaderStore != null)
1260 {
1262 {
1263 if (header.Key.KnownHeader == null)
1264 {
1267 }
1268 else
1269 {
1270 await WriteBytesAsync(header.Key.KnownHeader.AsciiBytesWithColonSpace, async).ConfigureAwait(continueOnCapturedContext: false);
1271 }
1273 if (headerValuesCount > 0)
1274 {
1277 if (cookiesFromContainer != null && header.Key.KnownHeader == KnownHeaders.Cookie)
1278 {
1281 cookiesFromContainer = null;
1282 }
1283 if (headerValuesCount > 1)
1284 {
1285 HttpHeaderParser parser = header.Key.Parser;
1286 string separator = ", ";
1287 if (parser != null && parser.SupportsMultipleValues)
1288 {
1289 separator = parser.Separator;
1290 }
1291 for (int i = 1; i < headerValuesCount; i++)
1292 {
1295 }
1296 }
1297 }
1299 }
1300 }
1301 if (cookiesFromContainer != null)
1302 {
1308 }
1309 }
static int GetStoreValuesIntoStringArray(HeaderDescriptor descriptor, object sourceValues, [NotNull] ref string[] values)
static readonly KnownHeader Cookie
HeaderEncodingSelector< HttpRequestMessage > _requestHeaderEncodingSelector
Task WriteTwoBytesAsync(byte b1, byte b2, bool async)
Task WriteBytesAsync(byte[] bytes, bool async)
Task WriteAsciiStringAsync(string s, bool async)
Task WriteStringAsync(string s, bool async)
readonly HttpConnectionPool _pool
new ConfiguredTaskAwaitable< TResult > ConfigureAwait(bool continueOnCapturedContext)
Definition Task.cs:226

References System.Net.Http.HttpConnection._currentRequest, System.Net.Http.HttpConnection._headerValues, System.Net.Http.HttpConnection._pool, System.Net.Http.HttpConnectionSettings._requestHeaderEncodingSelector, System.Threading.Tasks.Task< TResult >.ConfigureAwait(), System.Net.Http.Headers.KnownHeaders.Cookie, System.Net.Http.Headers.HttpHeaders.GetStoreValuesIntoStringArray(), System.Net.Http.HttpConnectionPool.Settings, System.Net.Http.HttpConnection.WriteAsciiStringAsync(), System.Net.Http.HttpConnection.WriteBytesAsync(), System.Net.Http.HttpConnection.WriteStringAsync(), and System.Net.Http.HttpConnection.WriteTwoBytesAsync().

Referenced by System.Net.Http.HttpConnection.SendAsyncCore().