mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Fix windows compilation
svn:r4543
This commit is contained in:
parent
70002930b9
commit
278bac421f
@ -160,7 +160,7 @@ tor_memmem(const void *_haystack, size_t hlen, const void *_needle, size_t nlen)
|
|||||||
end = haystack + hlen;
|
end = haystack + hlen;
|
||||||
first = *(const char*)needle;
|
first = *(const char*)needle;
|
||||||
while ((p = memchr(p, first, end-p))) {
|
while ((p = memchr(p, first, end-p))) {
|
||||||
if (end-p >= nlen)
|
if (p+nlen >= end)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (!memcmp(p, needle, nlen))
|
if (!memcmp(p, needle, nlen))
|
||||||
return p;
|
return p;
|
||||||
@ -340,7 +340,11 @@ tor_socketpair(int family, int type, int protocol, int fd[2])
|
|||||||
if (!SOCKET_IS_POLLABLE(listener)) {
|
if (!SOCKET_IS_POLLABLE(listener)) {
|
||||||
log_fn(LOG_WARN, "Too many connections; can't open socketpair");
|
log_fn(LOG_WARN, "Too many connections; can't open socketpair");
|
||||||
tor_close_socket(listener);
|
tor_close_socket(listener);
|
||||||
|
#ifdef MS_WINDOWS
|
||||||
|
return -ENFILE;
|
||||||
|
#else
|
||||||
return -ENCONN;
|
return -ENCONN;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
memset(&listen_addr, 0, sizeof(listen_addr));
|
memset(&listen_addr, 0, sizeof(listen_addr));
|
||||||
listen_addr.sin_family = AF_INET;
|
listen_addr.sin_family = AF_INET;
|
||||||
|
Loading…
Reference in New Issue
Block a user