/[rdesktop]/sourceforge.net/trunk/rdesktop/rdpdr.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/rdpdr.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 672 by astrand, Sat Apr 17 06:58:30 2004 UTC revision 673 by astrand, Mon Apr 19 08:24:54 2004 UTC
# Line 60  extern DEVICE_FNS printer_fns; Line 60  extern DEVICE_FNS printer_fns;
60  extern DEVICE_FNS parallel_fns;  extern DEVICE_FNS parallel_fns;
61  extern DEVICE_FNS disk_fns;  extern DEVICE_FNS disk_fns;
62  extern FILEINFO g_fileinfo[];  extern FILEINFO g_fileinfo[];
63    
64  static VCHANNEL *rdpdr_channel;  static VCHANNEL *rdpdr_channel;
65    
66  /* If select() times out, the request for the device with handle g_min_timeout_fd is aborted */  /* If select() times out, the request for the device with handle g_min_timeout_fd is aborted */
# Line 814  rdpdr_add_fds(int *n, fd_set * rfds, fd_ Line 814  rdpdr_add_fds(int *n, fd_set * rfds, fd_
814          iorq = g_iorequest;          iorq = g_iorequest;
815          while (iorq != NULL)          while (iorq != NULL)
816          {          {
817                  /* We need to test that the fd is still valid */                  if (iorq->fd != 0)
                 if ((iorq->fd != 0) && (read(iorq->fd, &c, 0) == 0))  
818                  {                  {
819                          switch (iorq->major)                          switch (iorq->major)
820                          {                          {
821                                  case IRP_MJ_READ:                                  case IRP_MJ_READ:
822                                            /* Is this FD valid? FDs will
823                                               be invalid when
824                                               reconnecting. FIXME: Real
825                                               support for reconnects. */
826    
827                                            if (read(iorq->fd, &c, 0) != 0)
828                                                    break;
829    
830                                          FD_SET(iorq->fd, rfds);                                          FD_SET(iorq->fd, rfds);
831                                            *n = MAX(*n, iorq->fd);
832    
833                                          // Check if io request timeout is smaller than current (but not 0).                                          // Check if io request timeout is smaller than current (but not 0).
834                                          if (iorq->timeout                                          if (iorq->timeout
# Line 835  rdpdr_add_fds(int *n, fd_set * rfds, fd_ Line 842  rdpdr_add_fds(int *n, fd_set * rfds, fd_
842                                                  tv->tv_usec = (select_timeout % 1000) * 1000;                                                  tv->tv_usec = (select_timeout % 1000) * 1000;
843                                                  *timeout = True;                                                  *timeout = True;
844                                          }                                          }
845    
846                                          break;                                          break;
847    
848                                  case IRP_MJ_WRITE:                                  case IRP_MJ_WRITE:
849                                            /* FD still valid? See above. */
850                                            if (write(iorq->fd, &c, 0) != 0)
851                                                    break;
852    
853                                          FD_SET(iorq->fd, wfds);                                          FD_SET(iorq->fd, wfds);
854                                            *n = MAX(*n, iorq->fd);
855                                          break;                                          break;
856    
857                          }                          }
858                          *n = MAX(*n, iorq->fd);  
859                  }                  }
860    
861                  iorq = iorq->next;                  iorq = iorq->next;

Legend:
Removed from v.672  
changed lines
  Added in v.673

  ViewVC Help
Powered by ViewVC 1.1.26