From 7fab65f7c63488b60f650826ec977a3d321aaea0 Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Wed, 17 Feb 2010 14:55:53 -0800 Subject: [PATCH] Refresh of retry-ibat --- trunk/core/ibat/user/ibat.cpp | 12 +++++++----- trunk/inc/user/iba/ibat.h | 8 +++----- trunk/ulp/netdirect/user/nd_connect.cpp | 2 +- trunk/ulp/wsd/user/ibsp_ip.c | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/trunk/core/ibat/user/ibat.cpp b/trunk/core/ibat/user/ibat.cpp index ede0a5ee..f3c42893 100644 --- a/trunk/core/ibat/user/ibat.cpp +++ b/trunk/core/ibat/user/ibat.cpp @@ -366,18 +366,20 @@ ResolvePath( __in const struct sockaddr* pSrcAddr, __in const struct sockaddr* pDestAddr, __out IBAT_PATH_BLOB* pPath, - __in int Timeout) + __in DWORD Timeout) { + INT64 to; HRESULT hr; + to = (Timeout == INFINITE) ? 1 << 63 : (INT64) ((UINT64) Timeout); do { hr = Resolve(pSrcAddr, pDestAddr, pPath); - if( hr != E_PENDING || Timeout <= 0 ) + if( hr != E_PENDING || to <= 0 ) break; - Timeout -= 10; + to -= 10; Sleep(10); - } while( Timeout > 0 ); + } while( to > 0 ); return hr; } @@ -402,7 +404,7 @@ IbatResolvePath( __in const struct sockaddr* pSrcAddr, __in const struct sockaddr* pDestAddr, __out IBAT_PATH_BLOB* pPath, - __in const int Timeout) + __in DWORD Timeout) { return IBAT::ResolvePath(pSrcAddr, pDestAddr, pPath, Timeout); } diff --git a/trunk/inc/user/iba/ibat.h b/trunk/inc/user/iba/ibat.h index e7f2c06c..6e84486c 100644 --- a/trunk/inc/user/iba/ibat.h +++ b/trunk/inc/user/iba/ibat.h @@ -41,8 +41,6 @@ typedef struct _IBAT_PATH_BLOB } IBAT_PATH_BLOB; -#define IBAT_MAX_TIMEOUT 0x0FFFFFFF - #ifdef __cplusplus namespace IBAT { @@ -59,7 +57,7 @@ ResolvePath( __in const struct sockaddr* pSrcAddr, __in const struct sockaddr* pDestAddr, __out IBAT_PATH_BLOB* pPath, - __in int Timeout /* ms */ + __in DWORD Timeout /* ms */ ); } @@ -77,9 +75,9 @@ IbatResolvePath( __in const struct sockaddr* pSrcAddr, __in const struct sockaddr* pDestAddr, __out IBAT_PATH_BLOB* pPath, - __in int Timeout /* ms */ + __in DWORD Timeout /* ms */ ); #endif /* __cplusplus */ -#endif // _IBAT_H_ \ No newline at end of file +#endif // _IBAT_H_ diff --git a/trunk/ulp/netdirect/user/nd_connect.cpp b/trunk/ulp/netdirect/user/nd_connect.cpp index 6ee6fa0f..81d5f7bd 100644 --- a/trunk/ulp/netdirect/user/nd_connect.cpp +++ b/trunk/ulp/netdirect/user/nd_connect.cpp @@ -139,7 +139,7 @@ Connect(INDEndpoint* pEndpoint, addr.Sin6.sin6_port = LocalPort; } - hr = IBAT::ResolvePath(&addr.Sa, pAddress, &path, IBAT_MAX_TIMEOUT); + hr = IBAT::ResolvePath(&addr.Sa, pAddress, &path, INFINITE); if (FAILED(hr)) { goto out; } diff --git a/trunk/ulp/wsd/user/ibsp_ip.c b/trunk/ulp/wsd/user/ibsp_ip.c index 0da0c0e8..b0124bb4 100644 --- a/trunk/ulp/wsd/user/ibsp_ip.c +++ b/trunk/ulp/wsd/user/ibsp_ip.c @@ -271,7 +271,7 @@ query_guid_address( IBSP_ENTER( IBSP_DBG_HW ); hr = IbatResolvePath(p_src_addr, p_dest_addr, (IBAT_PATH_BLOB*)&path, - IBAT_MAX_TIMEOUT); + INFINITE); if( hr == S_OK ) { -- 2.46.0