void Downloader::SendInternal () { LOG_DOWNLOADER ("Downloader::SendInternal ()\n"); g_return_if_fail (request != NULL); if (!send_queued) return; send_queued = false; if (completed) { // Consumer is re-sending a request which finished successfully. NotifyFinished (); return; } if (failed_msg != NULL) { if (HasHandlers (DownloadFailedEvent)) { // Consumer is re-sending a request which failed. Emit (DownloadFailedEvent, new ErrorEventArgs (this, DownloadError, MoonError (MoonError::EXCEPTION, 4001, failed_msg))); } return; } started = true; aborted = false; g_return_if_fail (request != NULL); request->Send (); }
void BitmapImage::DownloaderFailed () { //Uri *uri = GetUriSource (); //printf ("\tBitmapImage::DownloaderFailed() for %s\n", uri ? uri->ToString () : "null?"); Abort (); if (HasHandlers (ImageFailedEvent)) Emit (ImageFailedEvent, new ImageErrorEventArgs (MoonError (MoonError::EXCEPTION, 4001, "downloader failed"))); }
void Downloader::NotifyFailed (const char *msg) { LOG_DOWNLOADER ("Downloader::NotifyFailed (%s)\n", msg); /* if we've already been notified of failure, no-op */ if (failed_msg) return; // SetStatus (400); // For some reason the status is 0, not updated on errors? if (HasHandlers (DownloadFailedEvent)) Emit (DownloadFailedEvent, new ErrorEventArgs (this, DownloadError, MoonError (MoonError::EXCEPTION, 4001, msg))); failed_msg = g_strdup (msg); }