[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-server-cvs
Subject: [Server-cvs] engine/netio listenresp.cpp,1.7.4.1,1.7.4.2
From: svaidhya () helixcommunity ! org
Date: 2010-04-29 22:50:45
Message-ID: 201004292250.o3TMobFg027462 () mailer ! progressive-comp ! com
[Download RAW message or body]
Update of /cvsroot/server/engine/netio
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv16652
Modified Files:
Tag: SERVER_14_0
listenresp.cpp
Log Message:
Synopsis
========
Bug 260790: Changing a port value in the ports page gives a conflict error every \
time
Branches: HEAD, 14.1
Suggested Reviewer: Dean
Description
===========
When we tried to change a port from the Admin System the server always returned back \
an error saying Cannot bind to requested Port. This was happening becasue the server \
instead of binding to the new port was binding to the existing port and was getting \
"address already in use" error back, which was propogated to Admin System.
m_pAddr stores the current Address. InitSocket() creates a new Addr and binds to the \
new port only if m_pAddr is null.
Fix: To back-up m_pAddr and set it to NULL. So that InitSocket() binds to the new \
port.
If everything goes fine we just release the old address. If there was some \
error we release the new address and replace with the old one.
Files Affected
==============
./sds/session/daucplin.cpp
Testing Performed
=================
Unit Tests:
None
Integration Tests:
- Verified that a valid port change request is successful from te Admin system.
No error messages
After port change the server binds to new port as expected.
Leak Tests:
None
Performance Tests:
None
Platforms Tested:
RHEL5
QA Hints
===============
n/a
Index: listenresp.cpp
===================================================================
RCS file: /cvsroot/server/engine/netio/listenresp.cpp,v
retrieving revision 1.7.4.1
retrieving revision 1.7.4.2
diff -u -d -r1.7.4.1 -r1.7.4.2
--- listenresp.cpp 3 Mar 2010 04:59:32 -0000 1.7.4.1
+++ listenresp.cpp 29 Apr 2010 22:50:42 -0000 1.7.4.2
@@ -195,12 +195,32 @@
pResponse->SetActiveIntDone(HXR_OK, pName, ul, 0, 0);
return HXR_OK;
}
+
+ //PR 260790: If m_pAddr is not null, ::InitSocket() does not recognize it as a
+ //new port-change request and tries to listen to the existing port and fails.
+ //To avoid this I am setting m_pAddr to NULL so that we attempt to listen to the
+ //new port. In case the request fails we set the Old value back.
+
+ IHXSockAddr* pOldAddr = NULL;
+ pOldAddr = m_pAddr;
+ m_pAddr = NULL;
+
HX_RESULT res;
res = InitSocket((UINT16)ul, m_bSSL);
+
+ if (SUCCEEDED(res))
+ {
+ //We would have created a new m_pAddr. We dont need the old one any longer
+ HX_RELEASE(pOldAddr);
+ }
+
IHXBuffer* pBuf = NULL;
UINT32 uResCount = 0;
if (res != HXR_OK)
{
+ HX_RELEASE(m_pAddr);
+ m_pAddr = pOldAddr;
+
pBuf = new ServerBuffer(TRUE);
char errstr[256];
sprintf(errstr, "Cannot bind to port %lu", ul);
_______________________________________________
Server-cvs mailing list
Server-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/server-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic