Overview
Comment: | Allow thread-unsafe getaddrinfo() with locks
Before, getaddrinfo() would not be used at all if it is not thread-safe. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
fae85e954fc530d9f70b76a57fe051e3 |
User & Date: | js on 2014-02-27 22:40:33 |
Other Links: | manifest | tags |
Context
2014-02-28
| ||
00:38 | threading.h: Add of_once() check-in: ba5e756264 user: js tags: trunk | |
2014-02-27
| ||
22:40 | Allow thread-unsafe getaddrinfo() with locks check-in: fae85e954f user: js tags: trunk | |
2014-02-26
| ||
18:38 | Minor style change - no functional change check-in: e67130bd2d user: js tags: trunk | |
Changes
Modified src/resolver.m from [1037374b48] to [f6383b3c0c].
︙ | |||
55 56 57 58 59 60 61 | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | - + + + + + + | of_resolver_result_t** of_resolve_host(OFString *host, uint16_t port, int type) { of_resolver_result_t **ret, **retIter; of_resolver_result_t *results, *resultsIter; size_t count; |
︙ | |||
99 100 101 102 103 104 105 106 107 108 109 110 111 112 | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | + + + + + | resultsIter->addressLength = res->ai_addrlen; *retIter = resultsIter; } *retIter = NULL; ret[0]->private_ = res0; # if !defined(HAVE_THREADSAFE_GETADDRINFO) && defined(OF_HAVE_THREADS) if (!of_mutex_unlock(&mutex)) @throw [OFUnlockFailedException exception]; # endif #else struct hostent *he; in_addr_t s_addr; char **ip; struct sockaddr_in *addrs, *addrsIter; /* |
︙ |