Example #1
0
GLDEF_C void AcceptUnzippedBlock(TZipInfo& aInfo, TUint8*& aOutPtr, TInt aError)
	{
	if (aError!=KErrNone)
		{
		PrintToScreen(_L("Error!\r\n"));
		BOOT_FAULT();
		}
#ifdef __SUPPORT_FLASH_REPRO__
	if (LoadToFlash)
		{
		// signal flash programming thread
		TInt got=(TInt)((TLinAddr)aOutPtr-(TLinAddr)DestinationAddress());
		NotifyDataAvailable(got);
		}
#endif
	}
Example #2
0
std::string Socket::ToString() const
{
	sockaddr_in addr;
	socklen_t namelen = sizeof(addr);
	int peerRet = getpeername(connectSocket, (sockaddr*)&addr, &namelen); // Note: This works only if family==INETv4
	EndPoint peerName = EndPoint::FromSockAddrIn(addr);

	int sockRet = getsockname(connectSocket, (sockaddr*)&addr, &namelen); // Note: This works only if family==INETv4
	EndPoint sockName = EndPoint::FromSockAddrIn(addr);

	char str[256];
	sprintf(str, "%s:%d (%s, connected=%s, readOpen: %s, writeOpen: %s, maxSendSize=%d, sock: %s, peer: %s, socket: %d, this: %p)", 
		DestinationAddress(), (int)DestinationPort(), 
		(transport == SocketOverTCP) ? "TCP" : (IsUDPServerSocket() ? "UDP server" : (IsUDPSlaveSocket() ? "UDP Slave" : "UDP")), 
		Connected() ? "true" : "false", readOpen ? "true" : "false", writeOpen ? "true" : "false",
		(int)maxSendSize, sockRet == 0 ? sockName.ToString().c_str() : "(-)", 
		peerRet == 0 ? peerName.ToString().c_str() : "(-)", (int)connectSocket,
		this);

	return std::string(str);
}
Example #3
0
void ProcessHeader(TZipInfo& a)
	{
	FileName=a.iName;
	LoadSize=a.iUncompressedSize;
	TInt size_mod_4k=LoadSize & 0xfff;
	if (size_mod_4k==0)
		ImageHeaderPresent=EFalse;
	else if (size_mod_4k==256)
		ImageHeaderPresent=ETrue;
	else
		{
		PrintToScreen(_L("\r\n\r\nInvalid size\r\n"));
		BOOT_FAULT();
		}
	ImageSize=ImageHeaderPresent ? LoadSize-256 : LoadSize;

	PrintToScreen(_L("Unzip %lS, size %d\r\n"),&FileName,LoadSize);

#ifdef __SUPPORT_FLASH_REPRO__
	if (LoadToFlash)
		{
		TInt r=InitFlashWrite();
		if (r!=KErrNone)
			{
			PrintToScreen(_L("InitFlashWrite returned %d\r\n"),r);
			BOOT_FAULT();
			}
		}
#endif

	a.iOutBuf=(TUint8*)DestinationAddress();

	a.iHeaderDone=2;
	TRequestStatus* pS=&a.iProcessedHeader;

	
	RThread t;
	t.SetHandle(a.iThreadHandle);
	t.RequestComplete(pS,0);
	}