|
|
|
|
@ -1532,6 +1532,10 @@ void MySQL_Thread::listener_handle_new_connection(MySQL_Data_Stream *myds, unsig
|
|
|
|
|
struct sockaddr *addr=(struct sockaddr *)malloc(sizeof(struct sockaddr));
|
|
|
|
|
socklen_t addrlen=sizeof(struct sockaddr);
|
|
|
|
|
memset(addr, 0, sizeof(struct sockaddr));
|
|
|
|
|
if (GloMTH->num_threads > 1) {
|
|
|
|
|
// there are more than 1 thread . We pause for a little bit to avoid all connections to be handled by the same thread
|
|
|
|
|
usleep(50+rand()%50);
|
|
|
|
|
}
|
|
|
|
|
c=accept(myds->fd, addr, &addrlen);
|
|
|
|
|
if (c>-1) { // accept() succeeded
|
|
|
|
|
// create a new client connection
|
|
|
|
|
|