aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2011-04-27 09:40:04 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-04-27 09:40:04 -0700
commit18f6d964cbee483106da5c96a8c067a948324da7 (patch)
treebcf730e2301860816597c7b5ff20e93a9e5a51a3
parent55537c347bb31d0e2b176ca2550d2054877f9d54 (diff)
parentf819d0233646668b06de36a787979e3b180d6c48 (diff)
downloadsystem_core-18f6d964cbee483106da5c96a8c067a948324da7.zip
system_core-18f6d964cbee483106da5c96a8c067a948324da7.tar.gz
system_core-18f6d964cbee483106da5c96a8c067a948324da7.tar.bz2
am f819d023: Merge "libsysutils: SocketListener: handle recv errors more gracefully."
* commit 'f819d0233646668b06de36a787979e3b180d6c48': libsysutils: SocketListener: handle recv errors more gracefully.
-rw-r--r--libsysutils/src/SocketListener.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libsysutils/src/SocketListener.cpp b/libsysutils/src/SocketListener.cpp
index 69ed79e..fcad624 100644
--- a/libsysutils/src/SocketListener.cpp
+++ b/libsysutils/src/SocketListener.cpp
@@ -213,8 +213,9 @@ void SocketListener::runListener() {
it = pendingList->begin();
SocketClient* c = *it;
pendingList->erase(it);
- /* Process it, if false is returned, remove and destroy it */
- if (!onDataAvailable(c)) {
+ /* Process it, if false is returned and our sockets are
+ * connection-based, remove and destroy it */
+ if (!onDataAvailable(c) && mListen) {
/* Remove the client from our array */
pthread_mutex_lock(&mClientsLock);
for (it = mClients->begin(); it != mClients->end(); ++it) {