@@ -322,9 +322,9 @@ void net_socket_send(TExecutor *exec)
322
322
void net_socket_select (TExecutor * exec )
323
323
{
324
324
Number timeout_seconds = top (exec -> stack )-> number ; pop (exec -> stack );
325
- Cell * error = peek (exec -> stack , 0 )-> address ;
326
- Cell * write = peek (exec -> stack , 1 )-> address ;
327
- Cell * read = peek (exec -> stack , 2 )-> address ;
325
+ Cell * error = top (exec -> stack )-> address ; pop ( exec -> stack ) ;
326
+ Cell * write = top (exec -> stack )-> address ; pop ( exec -> stack ) ;
327
+ Cell * read = top (exec -> stack )-> address ; pop ( exec -> stack ) ;
328
328
329
329
fd_set rfds , wfds , efds ;
330
330
FD_ZERO (& rfds );
@@ -410,7 +410,7 @@ void net_socket_select(TExecutor *exec)
410
410
for (size_t i = 0 ; i < write -> array -> size ; ) {
411
411
SOCKET * ps = check_socket (exec , write -> array -> data [i ].array -> data [0 ].object );
412
412
SOCKET fd = * ps ;
413
- if (FD_ISSET (fd , & rfds )) {
413
+ if (FD_ISSET (fd , & wfds )) {
414
414
++ i ;
415
415
} else {
416
416
array_removeItem (write -> array , i );
@@ -420,7 +420,7 @@ void net_socket_select(TExecutor *exec)
420
420
for (size_t i = 0 ; i < error -> array -> size ; ) {
421
421
SOCKET * ps = check_socket (exec , error -> array -> data [i ].array -> data [0 ].object );
422
422
SOCKET fd = * ps ;
423
- if (FD_ISSET (fd , & rfds )) {
423
+ if (FD_ISSET (fd , & efds )) {
424
424
++ i ;
425
425
} else {
426
426
array_removeItem (error -> array , i );
0 commit comments