[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src network_worker.cpp
From: |
Jon Daniel |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src network_worker.cpp |
Date: |
Tue, 13 Sep 2005 14:26:24 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Jon Daniel <address@hidden> 05/09/13 18:26:24
Modified files:
src : network_worker.cpp
Log message:
Fix BeOS send_buf()
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/network_worker.cpp.diff?tr1=1.52&tr2=1.53&r1=text&r2=text
Patches:
Index: wesnoth/src/network_worker.cpp
diff -u wesnoth/src/network_worker.cpp:1.52 wesnoth/src/network_worker.cpp:1.53
--- wesnoth/src/network_worker.cpp:1.52 Tue Sep 6 17:16:04 2005
+++ wesnoth/src/network_worker.cpp Tue Sep 13 18:26:23 2005
@@ -1,4 +1,4 @@
-/* $Id: network_worker.cpp,v 1.52 2005/09/06 17:16:04 j_daniel Exp $ */
+/* $Id: network_worker.cpp,v 1.53 2005/09/13 18:26:23 j_daniel Exp $ */
/*
Copyright (C) 2003-5 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -105,14 +105,20 @@
std::vector<threading::thread*> threads;
SOCKET_STATE send_buf(TCPsocket sock, std::vector<char>& buf) {
+#ifdef __BEOS__
+ int timeout = 15000;
+#endif
size_t upto = 0;
size_t size = buf.size();
{
const threading::lock lock(*global_mutex);
transfer_stats[sock].first.fresh_current(size);
}
-
+#ifdef __BEOS__
+ while(upto < size && timeout > 0) {
+#else
while(upto < size) {
+#endif
{
// check if the socket is still locked
const threading::lock lock(*global_mutex);
@@ -140,7 +146,7 @@
if(poll_res > 0)
continue;
}
-#elif defined(USE_SELECT)
+#elif defined(USE_SELECT) && !defined(__BEOS__)
fd_set writefds;
FD_ZERO(&writefds);
FD_SET(((_TCPsocket*)sock)->channel, &writefds);
@@ -157,10 +163,16 @@
continue;
}
#else
+ SDL_Delay(10);
+ timeout -= 10;
+ continue;
}
#endif
return SOCKET_ERROR;
}
+#ifdef __BEOS__
+ timeout = 15000;
+#endif
upto += static_cast<size_t>(res);
{
const threading::lock lock(*global_mutex);
- [Wesnoth-cvs-commits] wesnoth/src network_worker.cpp, David White, 2005/09/03
- [Wesnoth-cvs-commits] wesnoth/src network_worker.cpp, David White, 2005/09/05
- [Wesnoth-cvs-commits] wesnoth/src network_worker.cpp, Jon Daniel, 2005/09/05
- [Wesnoth-cvs-commits] wesnoth/src network_worker.cpp, Jon Daniel, 2005/09/05
- [Wesnoth-cvs-commits] wesnoth/src network_worker.cpp, Jon Daniel, 2005/09/05
- [Wesnoth-cvs-commits] wesnoth/src network_worker.cpp, Jon Daniel, 2005/09/06
- [Wesnoth-cvs-commits] wesnoth/src network_worker.cpp, Jon Daniel, 2005/09/06
- [Wesnoth-cvs-commits] wesnoth/src network_worker.cpp,
Jon Daniel <=
- [Wesnoth-cvs-commits] wesnoth/src network_worker.cpp, Jon Daniel, 2005/09/13
- [Wesnoth-cvs-commits] wesnoth/src network_worker.cpp, Jon Daniel, 2005/09/17