/* receive file_info from server. This operation is patched for the compatibility with ameba.  */
u32 recv_file_info_from_server(u8 *Recvbuf, u32 len, int socket)
/* receive file_info from server. This operation is patched for the compatibility with ameba.  */
u32 recv_file_info_from_server(u8 *Recvbuf, u32 len, int socket)
{
	int read_bytes = 0;
	u32 TempLen;
	u8 * buf;
	buf = Recvbuf;
	TempLen = len;
	while(TempLen > 0) {
		read_bytes = lwip_read(socket, buf, TempLen);
		if(read_bytes < 0){
			printf("\n\r[%s] read socket failed\n", __FUNCTION__);
			goto error;
		}
		if(read_bytes == 0) {
			break;
		}
		TempLen -= read_bytes;
		buf += read_bytes;
	}
	return 1;
error:
	return 0;
}