示例#1
0
文件: net.c 项目: boompig/chromium
int __copy_of_crMothershipReadResponse( CRConnection *conn, void *buf )
{
	char codestr[4];
	int code;

	crNetSingleRecv( conn, codestr, 4 );
	crNetReadline( conn, buf );

	code = crStrToInt( codestr );
	return (code == 200);
}
示例#2
0
文件: client.c 项目: alown/chromium
/**
 * Get response string from mothership.
 * \return 1 if OK, 0 if error
 */
int crMothershipReadResponse( CRConnection *conn, void *buf )
{
	/* The connection may be already broken if we're called via the
	 * crMothershipExit() function.
	 */
	if (conn->type != CR_NO_CONNECTION) {
		char codestr[4];
		int code;
		crNetSingleRecv( conn, codestr, 4 );
		crNetReadline( conn, buf );
		code = crStrToInt( codestr );
		return (code == 200);
	}
	else {
		return 0;
	}
}