Changeset 8088 for code/trunk/src/external/enet/patches
- Timestamp:
- Mar 18, 2011, 12:08:44 AM (14 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/external/enet/patches/0001-Add-IPv6-support-to-Enet.patch
r8079 r8088 1 From 68e3ac1c2876aedb62a77fdc7ba71e4983a6b99dMon Sep 17 00:00:00 20011 From 7a7274dad3f90d206e91c0712ea0d2599850b24e Mon Sep 17 00:00:00 2001 2 2 From: Adrian Friedli <adi@koalatux.ch> 3 3 Date: Thu, 2 Sep 2010 14:26:42 +0200 4 Subject: [PATCH] IPv6 support4 Subject: [PATCH] Add IPv6 support to Enet 5 5 6 6 --- 7 7 host.c | 57 +++++++--- 8 8 include/enet/enet.h | 64 ++++++++--- 9 include/enet/win32.h | 5+9 include/enet/win32.h | 4 + 10 10 protocol.c | 73 ++++++++++-- 11 11 unix.c | 312 ++++++++++++++++++++++++++++++-------------------- 12 win32.c | 245 ++++++++++++++++++++++++++-------------- 13 6 files changed, 506 insertions(+), 250 deletions(-) 12 win32.c | 247 ++++++++++++++++++++++++++-------------- 13 6 files changed, 507 insertions(+), 250 deletions(-) 14 mode change 100755 => 100644 Doxyfile 15 mode change 100755 => 100644 docs/FAQ.dox 16 mode change 100755 => 100644 docs/design.dox 17 mode change 100755 => 100644 docs/install.dox 18 mode change 100755 => 100644 docs/license.dox 19 mode change 100755 => 100644 docs/mainpage.dox 20 mode change 100755 => 100644 docs/tutorial.dox 21 mode change 100755 => 100644 enet.dsp 14 22 23 diff --git a/Doxyfile b/Doxyfile 24 old mode 100755 25 new mode 100644 26 diff --git a/docs/FAQ.dox b/docs/FAQ.dox 27 old mode 100755 28 new mode 100644 29 diff --git a/docs/design.dox b/docs/design.dox 30 old mode 100755 31 new mode 100644 32 diff --git a/docs/install.dox b/docs/install.dox 33 old mode 100755 34 new mode 100644 35 diff --git a/docs/license.dox b/docs/license.dox 36 old mode 100755 37 new mode 100644 38 diff --git a/docs/mainpage.dox b/docs/mainpage.dox 39 old mode 100755 40 new mode 100644 41 diff --git a/docs/tutorial.dox b/docs/tutorial.dox 42 old mode 100755 43 new mode 100644 44 diff --git a/enet.dsp b/enet.dsp 45 old mode 100755 46 new mode 100644 15 47 diff --git a/host.c b/host.c 16 48 index 8bb2433..a9d157b 100644 … … 107 139 currentPeer < & host -> peers [host -> peerCount]; 108 140 diff --git a/include/enet/enet.h b/include/enet/enet.h 109 index 2f656d6..7b468a0100644141 index b572590..8351166 100644 110 142 --- a/include/enet/enet.h 111 143 +++ b/include/enet/enet.h … … 216 248 ENET_API ENetPacket * enet_packet_create (const void *, size_t, enet_uint32); 217 249 diff --git a/include/enet/win32.h b/include/enet/win32.h 218 index 0e1cf0c.. 53a7ff7100644250 index 0e1cf0c..6145851 100644 219 251 --- a/include/enet/win32.h 220 252 +++ b/include/enet/win32.h 221 @@ -14,6 +14,7 @@ 222 223 #include <stdlib.h> 224 #include <winsock2.h> 225 +#include <ws2tcpip.h> 226 227 typedef SOCKET ENetSocket; 228 229 @@ -53,6 +54,10 @@ typedef fd_set ENetSocketSet; 253 @@ -53,6 +53,10 @@ typedef fd_set ENetSocketSet; 230 254 #define ENET_SOCKETSET_REMOVE(sockset, socket) FD_CLEAR (socket, & (sockset)) 231 255 #define ENET_SOCKETSET_CHECK(sockset, socket) FD_ISSET (socket, & (sockset)) … … 239 263 240 264 diff --git a/protocol.c b/protocol.c 241 index 8e26dfb..cfef646100644265 index 2237ba8..7205d1b 100644 242 266 --- a/protocol.c 243 267 +++ b/protocol.c … … 265 289 enet_protocol_command_size (enet_uint8 commandNumber) 266 290 { 267 @@ -26 2,9 +278,9 @@ enet_protocol_handle_connect (ENetHost * host, ENetProtocolHeader * header, ENet291 @@ -266,9 +282,9 @@ enet_protocol_handle_connect (ENetHost * host, ENetProtocolHeader * header, ENet 268 292 ++ currentPeer) 269 293 { … … 277 301 } 278 302 279 @@ -8 48,10 +864,11 @@ enet_protocol_handle_incoming_commands (ENetHost * host, ENetEvent * event)303 @@ -852,10 +868,11 @@ enet_protocol_handle_incoming_commands (ENetHost * host, ENetEvent * event) 280 304 281 305 if (peer -> state == ENET_PEER_STATE_DISCONNECTED || … … 292 316 } 293 317 294 @@ -89 1,8 +908,7 @@ enet_protocol_handle_incoming_commands (ENetHost * host, ENetEvent * event)318 @@ -895,8 +912,7 @@ enet_protocol_handle_incoming_commands (ENetHost * host, ENetEvent * event) 295 319 296 320 if (peer != NULL) … … 302 326 } 303 327 304 @@ -102 1,7 +1037,7 @@ commandError:328 @@ -1025,7 +1041,7 @@ commandError: 305 329 } 306 330 … … 311 335 for (;;) 312 336 { 313 @@ -103 1,10 +1047,11 @@ enet_protocol_receive_incoming_commands (ENetHost * host, ENetEvent * event)337 @@ -1035,10 +1051,11 @@ enet_protocol_receive_incoming_commands (ENetHost * host, ENetEvent * event) 314 338 buffer.data = host -> packetData [0]; 315 339 buffer.dataLength = sizeof (host -> packetData [0]); … … 325 349 if (receivedLength < 0) 326 350 return -1; 327 @@ -104 2,6 +1059,9 @@ enet_protocol_receive_incoming_commands (ENetHost * host, ENetEvent * event)351 @@ -1046,6 +1063,9 @@ enet_protocol_receive_incoming_commands (ENetHost * host, ENetEvent * event) 328 352 if (receivedLength == 0) 329 353 return 0; … … 335 359 host -> receivedDataLength = receivedLength; 336 360 337 @@ -13 73,6 +1393,9 @@ enet_protocol_send_outgoing_commands (ENetHost * host, ENetEvent * event, int ch361 @@ -1397,6 +1417,9 @@ enet_protocol_send_outgoing_commands (ENetHost * host, ENetEvent * event, int ch 338 362 currentPeer < & host -> peers [host -> peerCount]; 339 363 ++ currentPeer) … … 345 369 currentPeer -> state == ENET_PEER_STATE_ZOMBIE) 346 370 continue; 347 @@ -1 497,7 +1520,15 @@ enet_protocol_send_outgoing_commands (ENetHost * host, ENetEvent * event, int ch371 @@ -1520,7 +1543,15 @@ enet_protocol_send_outgoing_commands (ENetHost * host, ENetEvent * event, int ch 348 372 349 373 currentPeer -> lastSendTime = host -> serviceTime; … … 362 386 enet_protocol_remove_sent_unreliable_commands (currentPeer); 363 387 364 @@ -16 08,7 +1639,23 @@ enet_host_service (ENetHost * host, ENetEvent * event, enet_uint32 timeout)388 @@ -1631,7 +1662,23 @@ enet_host_service (ENetHost * host, ENetEvent * event, enet_uint32 timeout) 365 389 break; 366 390 } … … 387 411 case 1: 388 412 return 1; 389 @@ -16 60,7 +1707,7 @@ enet_host_service (ENetHost * host, ENetEvent * event, enet_uint32 timeout)413 @@ -1683,7 +1730,7 @@ enet_host_service (ENetHost * host, ENetEvent * event, enet_uint32 timeout) 390 414 391 415 waitCondition = ENET_SOCKET_WAIT_RECEIVE; … … 874 898 #endif 875 899 diff --git a/win32.c b/win32.c 876 index e1fae23.. 2607160100644900 index e1fae23..15b9888 100644 877 901 --- a/win32.c 878 902 +++ b/win32.c 879 @@ -4, 6 +4,8@@903 @@ -4,23 +4,27 @@ 880 904 */ 881 905 #ifdef WIN32 … … 884 908 + 885 909 #include <time.h> 910 +#include <ws2tcpip.h> 886 911 #define ENET_BUILDING_LIB 1 887 912 #include "enet/enet.h" 888 @@ -13,14 +15,14 @@ static enet_uint32 timeBase = 0; 913 +#include <ws2tcpip.h> 914 915 static enet_uint32 timeBase = 0; 916 889 917 int 890 918 enet_initialize (void) … … 904 932 WSACleanup (); 905 933 906 @@ -52,77 +5 4,139 @@ enet_time_set (enet_uint32 newTimeBase)934 @@ -52,77 +56,139 @@ enet_time_set (enet_uint32 newTimeBase) 907 935 timeBase = (enet_uint32) timeGetTime () - newTimeBase; 908 936 } … … 1084 1112 1085 1113 int 1086 @@ -132,9 +19 6,10 @@ enet_socket_listen (ENetSocket socket, int backlog)1114 @@ -132,9 +198,10 @@ enet_socket_listen (ENetSocket socket, int backlog) 1087 1115 } 1088 1116 … … 1097 1125 1098 1126 int 1099 @@ -173,28 +2 38,23 @@ enet_socket_set_option (ENetSocket socket, ENetSocketOption option, int value)1127 @@ -173,28 +240,23 @@ enet_socket_set_option (ENetSocket socket, ENetSocketOption option, int value) 1100 1128 } 1101 1129 … … 1134 1162 1135 1163 if (result == INVALID_SOCKET) 1136 @@ -202,8 +26 2,7 @@ enet_socket_accept (ENetSocket socket, ENetAddress * address)1164 @@ -202,8 +264,7 @@ enet_socket_accept (ENetSocket socket, ENetAddress * address) 1137 1165 1138 1166 if (address != NULL) … … 1144 1172 1145 1173 return result; 1146 @@ -219,18 +2 78,15 @@ int1174 @@ -219,18 +280,15 @@ int 1147 1175 enet_socket_send (ENetSocket socket, 1148 1176 const ENetAddress * address, … … 1167 1195 1168 1196 if (WSASendTo (socket, 1169 @@ -239,7 +29 5,7 @@ enet_socket_send (ENetSocket socket,1197 @@ -239,7 +297,7 @@ enet_socket_send (ENetSocket socket, 1170 1198 & sentLength, 1171 1199 0, … … 1176 1204 NULL) == SOCKET_ERROR) 1177 1205 { 1178 @@ -256,12 +31 2,13 @@ int1206 @@ -256,12 +314,13 @@ int 1179 1207 enet_socket_receive (ENetSocket socket, 1180 1208 ENetAddress * address, … … 1193 1221 if (WSARecvFrom (socket, 1194 1222 (LPWSABUF) buffers, 1195 @@ -288,8 +34 5,7 @@ enet_socket_receive (ENetSocket socket,1223 @@ -288,8 +347,7 @@ enet_socket_receive (ENetSocket socket, 1196 1224 1197 1225 if (address != NULL) … … 1203 1231 1204 1232 return (int) recvLength; 1205 @@ -307,25 +36 3,42 @@ enet_socketset_select (ENetSocket maxSocket, ENetSocketSet * readSet, ENetSocket1233 @@ -307,25 +365,42 @@ enet_socketset_select (ENetSocket maxSocket, ENetSocketSet * readSet, ENetSocket 1206 1234 } 1207 1235 … … 1252 1280 if (selectCount < 0) 1253 1281 return -1; 1254 @@ -335,14 +4 08,16 @@ enet_socket_wait (ENetSocket socket, enet_uint32 * condition, enet_uint32 timeou1282 @@ -335,14 +410,16 @@ enet_socket_wait (ENetSocket socket, enet_uint32 * condition, enet_uint32 timeou 1255 1283 if (selectCount == 0) 1256 1284 return 0; … … 1276 1304 1277 1305 -- 1278 1.7. 11306 1.7.4.1 1279 1307
Note: See TracChangeset
for help on using the changeset viewer.