MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / get_win32_connect_timeout

Function get_win32_connect_timeout

sql-common/client.c:173–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171*/
172
173static DWORD get_win32_connect_timeout(MYSQL *mysql)
174{
175 DWORD timeout_ms;
176 uint timeout_sec;
177
178 /*
179 A timeout of 0 means no timeout. Also, the connect_timeout
180 option value is in seconds, while WIN32 timeouts are in
181 milliseconds. Hence, check for a possible overflow. In case
182 of overflow, set to no timeout.
183 */
184 timeout_sec= mysql->options.connect_timeout;
185
186 if (!timeout_sec || (timeout_sec > INT_MAX/1000))
187 timeout_ms= INFINITE;
188 else
189 timeout_ms= (DWORD) (timeout_sec * 1000);
190
191 return timeout_ms;
192}
193
194#endif
195

Callers 1

client.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected