[ofw] [PATCH] winverbs/nd: allow retrying connect() call
Sean Hefty
sean.hefty at intel.com
Fri Mar 5 14:05:48 PST 2010
The ND specification allows for retrying NDConnector:Connect()
calls. Add this support to the winverbs ND provider.
Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
This should be added to the 2.2 release. It passed all ND logo tests.
trunk/ulp/netdirect/user/nd_connect.cpp | 18 +++++++++---------
trunk/ulp/netdirect/user/nd_connect.h | 8 --------
2 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/trunk/ulp/netdirect/user/nd_connect.cpp b/trunk/ulp/netdirect/user/nd_connect.cpp
index 81d5f7b..ce25499 100644
--- a/trunk/ulp/netdirect/user/nd_connect.cpp
+++ b/trunk/ulp/netdirect/user/nd_connect.cpp
@@ -39,15 +39,6 @@ CNDConnector::CNDConnector(CNDAdapter *pAdapter)
m_pWvConnEp = NULL;
}
-STDMETHODIMP CNDConnector::
-Init(void)
-{
- HRESULT hr;
-
- hr = m_pAdapter->m_pWvProvider->CreateConnectEndpoint(&m_pWvConnEp);
- return NDConvertWVStatus(hr);
-}
-
CNDConnector::~CNDConnector()
{
if (m_pWvConnEp != NULL) {
@@ -132,6 +123,15 @@ Connect(INDEndpoint* pEndpoint,
IBAT_PATH_BLOB path;
HRESULT hr;
+ if (m_pWvConnEp != NULL) {
+ m_pWvConnEp->Release();
+ }
+
+ hr = m_pAdapter->m_pWvProvider->CreateConnectEndpoint(&m_pWvConnEp);
+ if (FAILED(hr)) {
+ goto out;
+ }
+
RtlCopyMemory(&addr, &m_pAdapter->m_Address, AddressLength);
if (addr.Sa.sa_family == AF_INET) {
addr.Sin.sin_port = LocalPort;
diff --git a/trunk/ulp/netdirect/user/nd_connect.h b/trunk/ulp/netdirect/user/nd_connect.h
index 2da2f22..ec38fb1 100644
--- a/trunk/ulp/netdirect/user/nd_connect.h
+++ b/trunk/ulp/netdirect/user/nd_connect.h
@@ -94,16 +94,9 @@ public:
goto err1;
}
- hr = conn->Init();
- if (FAILED(hr)) {
- goto err2;
- }
-
*ppConnector = conn;
return ND_SUCCESS;
- err2:
- conn->Release();
err1:
*ppConnector = NULL;
return hr;
@@ -113,7 +106,6 @@ public:
CNDAdapter *m_pAdapter;
protected:
- STDMETHODIMP Init();
};
#endif // _ND_CONNECTOR_H_
More information about the ofw
mailing list