示例#1
0
文件: pal.cpp 项目: 499940913/moon
void
MoonInstallerService::downloader_stopped (EventObject *sender, EventArgs *args, gpointer user_data)
{
	HttpRequestStoppedEventArgs *ea = (HttpRequestStoppedEventArgs *) args;
	if (ea->IsSuccess ()) {
		((MoonInstallerService *) user_data)->UpdaterCompleted ();
	} else {
		((MoonInstallerService *) user_data)->UpdaterFailed (ea->GetErrorMessage ());
	}
}
示例#2
0
static void
application_downloader_stopped (EventObject *sender, EventArgs *calldata, gpointer closure)
{
	HttpRequestStoppedEventArgs *args = (HttpRequestStoppedEventArgs *) calldata;
	NotifyCtx *ctx = (NotifyCtx *) closure;
	if (ctx->notify_cb)
		ctx->notify_cb (args->IsSuccess () ? NotifyCompleted : NotifyFailed, GPOINTER_TO_INT (NULL), ctx->user_data);
	ctx->request->RemoveAllHandlers (ctx);
	ctx->request->unref ();
	g_free (ctx);
}