Line 0
Link Here
|
|
|
1 |
--- uppsrc/Web/socket.cpp.orig Thu Oct 5 00:43:27 2006 |
2 |
+++ uppsrc/Web/socket.cpp Thu Oct 5 20:33:14 2006 |
3 |
@@ -12,6 +12,12 @@ |
4 |
{ |
5 |
NB_TIMEOUT = 30000, |
6 |
SOCKBUFSIZE = 65536, |
7 |
+ |
8 |
+#ifdef PLATFORM_WIN32 |
9 |
+ IS_BLOCKED = SOCKERR(EWOULDBLOCK), |
10 |
+#else |
11 |
+ IS_BLOCKED = SOCKERR(EINPROGRESS), |
12 |
+#endif |
13 |
}; |
14 |
|
15 |
static bool LogSocketFlag = false; |
16 |
@@ -202,7 +208,7 @@ |
17 |
return true; |
18 |
|
19 |
int err = GetLastError(); |
20 |
- if(err != SOCKERR(EWOULDBLOCK)) { |
21 |
+ if(err != IS_BLOCKED) { |
22 |
SetSockError(NFormat("connect(%s:%d)", host, port)); |
23 |
SLOG("Socket::Data::OpenClient -> connect error, returning false"); |
24 |
return false; |
25 |
@@ -274,7 +280,7 @@ |
26 |
#endif |
27 |
if(res == 0) |
28 |
is_eof = true; |
29 |
- else if(res < 0 && GetLastError() != SOCKERR(EWOULDBLOCK)) |
30 |
+ else if(res < 0 && GetLastError() != IS_BLOCKED) |
31 |
SetSockError("recv"); |
32 |
return res; |
33 |
} |
34 |
@@ -282,7 +288,7 @@ |
35 |
int Socket::Data::Write(const void *buf, int amount) |
36 |
{ |
37 |
int res = send(socket, (const char *)buf, amount, 0); |
38 |
- if(res == 0 || res < 0 && GetLastError() != SOCKERR(EWOULDBLOCK)) |
39 |
+ if(res == 0 || res < 0 && GetLastError() != IS_BLOCKED) |
40 |
SetSockError("send"); |
41 |
return res; |
42 |
} |