internal void SetHeaders(byte [] buffer, int offset, int size)
{
if (headersSent)
{
return;
}
if (!allowBuffering || sendChunked)
{
headersSent = true;
if (!cnc.Connected)
{
throw new WebException("Not connected", null, WebExceptionStatus.SendFailure, null);
}
if (!cnc.Write(buffer, offset, size))
{
throw new WebException("Error writing request.", null, WebExceptionStatus.SendFailure, null);
}
if (!initRead)
{
initRead = true;
WebConnection.InitRead(cnc);
}
}
else
{
headers = new byte [size];
Buffer.BlockCopy(buffer, offset, headers, 0, size);
}
}