Repository

Merge branch 'master' of git://piggledy.org/libldsw

Parent commits : d0bd5417dcbc40c99dbe230a79b6ca538ee78e5a, 7173ff1da0859e633181f4a69cf0c295270cc254,
Children commits :

By lds on 2009-07-24 11:55:34
Merge branch 'master' of git://piggledy.org/libldsw

Difference with parent commit d0bd5417dcbc40c99dbe230a79b6ca538ee78e5a
Files modified:
src/engine/thread_obj.cpp
--- 
+++ 
@@ -16,7 +16,7 @@
 std::map<pthread_t, ThreadObj*> thread_map;
 
 ThreadObj::ThreadObj(std::string n) : lock(RECURSIVE_MUTEX), 
-	ask_stop(false), stopped(true), thread_running(false), id(0)
+	has_started(false), ask_stop(false), stopped(true), thread_running(false), id(0)
 {
 	lock.Lock();
 	name = n;
@@ -55,6 +55,7 @@
 	thr->lock.Lock();
 	thr->stopped = false;
 	thr->ask_stop = false;
+	thr->has_started = true;
 	thr->lock.Unlock();
 
 	thr->Main();
@@ -116,7 +117,7 @@
 bool ThreadObj::GetStopped()
 {
 	lock.Lock();
-	bool ret = stopped;
+	bool ret = stopped && has_started;
 	lock.Unlock();
 	return ret;
 }

src/engine/thread_obj.h
--- 
+++ 
@@ -9,6 +9,7 @@
 {
 	Mutex lock;
 
+	bool has_started;
 	bool ask_stop;
 	bool stopped;
 

src/net/client_common.cpp
--- 
+++ 
@@ -79,6 +79,11 @@
 
 void ClientCommon::Send(const std::string & str)
 {
+	if(str.size() == 0)
+	{
+		log(LogError, "Trying to send an empty string to host %s", GetAddress().c_str());
+		return;
+	}
 	Send(str.c_str(), str.size());
 }
 

Difference with parent commit 7173ff1da0859e633181f4a69cf0c295270cc254
Files modified:
src/net/packet.cpp
--- 
+++ 
@@ -65,7 +65,7 @@
 	if(!buf)
 	{
 		log(LogError, "Empty packet while trying to read binary data");
-		return "";
+		return NULL;
 	}
 
 	_len = PopUInt();