public bool checkTryAutoAuth() { if (!SessionPackMgr.getAccount().isValid()) { Log.e("Network", "cannot auto-auth without valid account."); this.closeSender(); return(false); } if (mRetryAuthLeft <= 0) { if (mRetryAuthLeft == 0) { Log.e("Network", " autoAuth no retry left"); mRetryAuthLeft = -1; } return(false); } SessionPackMgr.getPackEx(delegate(SessionPack pack) { if (pack.mCacheBodyBuffer != null) { Log.i("Network", "clearn cache body before autoauth, cmdUri = " + pack.mCmdUri); pack.mCacheBodyBuffer = null; } return(true); }); Log.i("Network", "CMD need autoauth, autoAuthLeft:" + mRetryAuthLeft); mRetryAuthLeft--; SessionPackMgr.putToHead(AuthPack.makeAutoAuthPack(2)); return(true); }
public bool sendAutoAuthPack() { SessionPack sessionPack = AuthPack.makeAutoAuthPack(2); return(this.sendPack(sessionPack)); }