1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 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 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
| $ diff -r mosquitto-1.4.11 mosquitto-1.4.11-lcy-changed Only in mosquitto-1.4.11-lcy-changed: build diff -r mosquitto-1.4.11/config.mk mosquitto-1.4.11-lcy-changed/config.mk 68c68 < WITH_WEBSOCKETS:=no --- > WITH_WEBSOCKETS:=yes diff -r mosquitto-1.4.11/lib/CMakeLists.txt mosquitto-1.4.11-lcy-changed/lib/CMakeLists.txt 7,8c7,12 < set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x86\\pthreadVC2.lib) < set (PTHREAD_INCLUDE_DIR C:\\pthreads\\Pre-built.2\\include) --- > if (MINGW) > set (PTHREAD_LIBRARIES -lpthread) > else ( MINGW) > set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x86\\pthreadVC2.lib) > set (PTHREAD_INCLUDE_DIR C:\\pthreads\\Pre-built.2\\include) > endif (MINGW) diff -r mosquitto-1.4.11/lib/mosquitto_internal.h mosquitto-1.4.11-lcy-changed/lib/mosquitto_internal.h 20a21 > diff -r mosquitto-1.4.11/lib/net_mosq.c mosquitto-1.4.11-lcy-changed/lib/net_mosq.c 29a30 > diff -r mosquitto-1.4.11/lib/time_mosq.c mosquitto-1.4.11-lcy-changed/lib/time_mosq.c 45,47c45,48 < if(vi.dwMajorVersion > 5){ < tick64 = true; < } --- > if(vi.dwMajorVersion > 5 ) > { > tick64 = true; > } 56c57 < return GetTickCount64()/1000; --- > return GetTickCount()/1000; diff -r mosquitto-1.4.11/lib/tls_mosq.c mosquitto-1.4.11-lcy-changed/lib/tls_mosq.c 21a22 > 118,119c119,128 < ipv6_ok = InetPton(AF_INET6, hostname, &ipv6_addr); < ipv4_ok = InetPton(AF_INET, hostname, &ipv4_addr); --- > typedef INT (WSAAPI *ptrInetPton)( INT Family, PCTSTR pszAddrString, PVOID pAddrBuf); > HMODULE h = LoadLibrary(L"ws2_32.dll"); > ptrInetPton func = (ptrInetPton)GetProcAddress(h,"InetPtonW"); > > ipv6_ok = func(AF_INET6, hostname, &ipv6_addr); > ipv4_ok = func(AF_INET, hostname, &ipv4_addr); > FreeLibrary(h); h = NULL; > > //ipv6_ok = InetPton(AF_INET6, hostname, &ipv6_addr); > //ipv4_ok = InetPton(AF_INET, hostname, &ipv4_addr); diff -r mosquitto-1.4.11/src/conf.c mosquitto-1.4.11-lcy-changed/src/conf.c 33a34 > diff -r mosquitto-1.4.11/src/loop.c mosquitto-1.4.11-lcy-changed/src/loop.c 27a28,107 > > > > > > > > > > > > > > > > > struct pollfd { > SOCKET fd; > short events; > short revents; > }; > > > int mingw_poll(struct pollfd *fds, unsigned int nfds, int timo) > { > struct timeval timeout, *toptr; > fd_set ifds, ofds, efds, *ip, *op; > int i, rc; > > /* Set up the file-descriptor sets in ifds, ofds and efds. */ > FD_ZERO(&ifds); > FD_ZERO(&ofds); > FD_ZERO(&efds); > for (i = 0, op = ip = 0; i < nfds; ++i) { > fds[i].revents = 0; > if(fds[i].events & (POLLIN|POLLPRI)) { > ip = &ifds; > FD_SET(fds[i].fd, ip); > } > if(fds[i].events & POLLOUT) { > op = &ofds; > FD_SET(fds[i].fd, op); > } > FD_SET(fds[i].fd, &efds); > } > > /* Set up the timeval structure for the timeout parameter */ > if(timo < 0) { > toptr = 0; > } else { > toptr = &timeout; > timeout.tv_sec = timo / 1000; > timeout.tv_usec = (timo - timeout.tv_sec * 1000) * 1000; > } > > //kWarning()<<QString("Entering select() sec=%1 usec=%2 ip=%3 op=%4").arg(timeout.tv_sec).arg(timeout.tv_usec).arg((long)ip).arg((long)op); > > rc = select(0, ip, op, &efds, toptr); > > //kWarning()<<"Exiting select rc="<<rc; > > if(rc <= 0) > return rc; > > if(rc > 0) { > for (i = 0; i < nfds; ++i) { > int fd = fds[i].fd; > if(fds[i].events & (POLLIN|POLLPRI) && FD_ISSET(fd, &ifds)) > fds[i].revents |= POLLIN; > if(fds[i].events & POLLOUT && FD_ISSET(fd, &ofds)) > fds[i].revents |= POLLOUT; > if(FD_ISSET(fd, &efds)) > /* Some error was detected ... should be some way to know. */ > fds[i].revents |= POLLHUP; > //kWarning()<<QString("%1 %2 %3 revent = %4").arg(FD_ISSET(fd, &ifds)).arg(FD_ISSET(fd, &ofds)).arg(FD_ISSET(fd, &efds)).arg(fds[i].revents); > } > } > return rc; > } > 354c434,435 < fdcount = WSAPoll(pollfds, pollfd_index, 100); --- > //fdcount = WSAPoll(pollfds, pollfd_index, 100); > fdcount = mingw_poll(pollfds, pollfd_index, 100); diff -r mosquitto-1.4.11/src/net.c mosquitto-1.4.11-lcy-changed/src/net.c 26a27 > 516a518,523 > > > typedef PCTSTR (WSAAPI *ptrInetNtop)( INT Family, PVOID pAddr, PTSTR pStringBuf, size_t StringBufSize); > HMODULE h = LoadLibrary(L"ws2_32.dll"); > ptrInetNtop func = (ptrInetNtop)GetProcAddress(h,"InetNtop"); > 520a528,531 > > if(func(AF_INET, &((struct sockaddr_in *)&addr)->sin_addr.s_addr, buf, len)){ > return 0; > 522a534 > 524a537,540 > > if(func(AF_INET6, &((struct sockaddr_in6 *)&addr)->sin6_addr.s6_addr, buf, len)){ > return 0; > 526a543 > 529a547,549 > > FreeLibrary(h);
|