Пример #1
0
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
/**
 * 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;
	}
}