public override IAsyncResult BeginGetRequestStream(AsyncCallback callback, object state)
{
GlobalLog.Enter("FileWebRequest::BeginGetRequestStream");
-
+ bool success = true;
try {
if (Aborted)
throw ExceptionHelper.RequestAbortedException;
m_ReadAResult = new LazyAsyncResult(this, state, callback);
ThreadPool.QueueUserWorkItem(s_GetRequestStreamCallback, m_ReadAResult);
} catch (Exception exception) {
+ success = false;
if(Logging.On)Logging.Exception(Logging.Web, this, "BeginGetRequestStream", exception);
throw;
} finally {
+ if (FrameworkEventSource.Log.IsEnabled()) {
+ LogBeginGetRequestStream(success, synchronous: false);
+ }
GlobalLog.Leave("FileWebRequest::BeginGetRequestSteam");
}
- string suri;
- if (FrameworkEventSource.Log.IsEnabled(EventLevel.Verbose, FrameworkEventSource.Keywords.NetClient))
- suri = this.RequestUri.ToString();
- else
- suri = this.RequestUri.OriginalString;
- if (FrameworkEventSource.Log.IsEnabled()) LogBeginGetRequestStream(suri);
-
return m_ReadAResult;
}
public override IAsyncResult BeginGetResponse(AsyncCallback callback, object state)
{
GlobalLog.Enter("FileWebRequest::BeginGetResponse");
+ bool success = true;
try {
if (Aborted)
m_WriteAResult = new LazyAsyncResult(this,state,callback);
ThreadPool.QueueUserWorkItem(s_GetResponseCallback,m_WriteAResult);
} catch (Exception exception) {
+ success = false;
if(Logging.On)Logging.Exception(Logging.Web, this, "BeginGetResponse", exception);
throw;
} finally {
+ if (FrameworkEventSource.Log.IsEnabled()) {
+ LogBeginGetResponse(success, synchronous: false);
+ }
GlobalLog.Leave("FileWebRequest::BeginGetResponse");
}
- string suri;
- if (FrameworkEventSource.Log.IsEnabled(EventLevel.Verbose, FrameworkEventSource.Keywords.NetClient))
- suri = this.RequestUri.ToString();
- else
- suri = this.RequestUri.OriginalString;
- if (FrameworkEventSource.Log.IsEnabled()) LogBeginGetResponse(suri);
-
return m_WriteAResult;
}
GlobalLog.Enter("FileWebRequest::EndGetRequestStream");
Stream stream;
+ bool success = false;
try {
LazyAsyncResult ar = asyncResult as LazyAsyncResult;
if (asyncResult == null || ar == null) {
}
stream = (Stream) result;
m_writePending = false;
+ success = true;
} catch (Exception exception) {
if(Logging.On)Logging.Exception(Logging.Web, this, "EndGetRequestStream", exception);
throw;
} finally {
GlobalLog.Leave("FileWebRequest::EndGetRequestStream");
+ if (FrameworkEventSource.Log.IsEnabled()) {
+ LogEndGetRequestStream(success, synchronous: false);
+ }
}
- if (FrameworkEventSource.Log.IsEnabled()) LogEndGetRequestStream();
-
return stream;
}
GlobalLog.Enter("FileWebRequest::EndGetResponse");
WebResponse response;
+ bool success = false;
try {
LazyAsyncResult ar = asyncResult as LazyAsyncResult;
if (asyncResult == null || ar == null) {
}
response = (WebResponse) result;
m_readPending = false;
+ success = true;
} catch (Exception exception) {
if(Logging.On)Logging.Exception(Logging.Web, this, "EndGetResponse", exception);
throw;
} finally {
GlobalLog.Leave("FileWebRequest::EndGetResponse");
- }
- if (FrameworkEventSource.Log.IsEnabled()) LogEndGetResponse();
+ // there is no statusCode in FileWebRequest object, defaulting it to zero.
+ if (FrameworkEventSource.Log.IsEnabled()) {
+ LogEndGetResponse(success, synchronous: false, statusCode: 0);
+ }
+ }
return response;
}