File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -268,29 +268,31 @@ static void set_socket_options(memcached_server_st *server)
268268 }
269269
270270#ifdef HAVE_SNDTIMEO
271- if (server->root ->snd_timeout )
271+ if (server->root ->snd_timeout > 0 )
272272 {
273273 struct timeval waittime;
274274
275- waittime.tv_sec = 0 ;
276- waittime.tv_usec = server->root ->snd_timeout ;
275+ waittime.tv_sec = server-> root -> snd_timeout / 1000000 ;
276+ waittime.tv_usec = server->root ->snd_timeout % 1000000 ;
277277
278278 int error= setsockopt (server->fd , SOL_SOCKET, SO_SNDTIMEO,
279- &waittime, (socklen_t )sizeof (struct timeval ));
279+ (char *)&waittime, (socklen_t )sizeof (struct timeval ));
280+ (void )error;
280281 assert (error == 0 );
281282 }
282283#endif
283284
284285#ifdef HAVE_RCVTIMEO
285- if (server->root ->rcv_timeout )
286+ if (server->root ->rcv_timeout > 0 )
286287 {
287288 struct timeval waittime;
288289
289- waittime.tv_sec = 0 ;
290- waittime.tv_usec = server->root ->rcv_timeout ;
290+ waittime.tv_sec = server-> root -> rcv_timeout / 1000000 ;
291+ waittime.tv_usec = server->root ->rcv_timeout % 1000000 ;
291292
292293 int error= setsockopt (server->fd , SOL_SOCKET, SO_RCVTIMEO,
293- &waittime, (socklen_t )sizeof (struct timeval ));
294+ (char *)&waittime, (socklen_t )sizeof (struct timeval ));
295+ (void )(error);
294296 assert (error == 0 );
295297 }
296298#endif
You can’t perform that action at this time.
0 commit comments