/[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 590 by n-ki, Thu Jan 29 12:27:21 2004 UTC revision 646 by forsberg, Fri Apr 2 15:34:38 2004 UTC
# Line 1  Line 1 
1  #include <unistd.h>  #include <unistd.h>
2  #include <sys/types.h>  #include <sys/types.h>
3    #include <sys/time.h>
4    #include <dirent.h>             /* opendir, closedir, readdir */
5  #include <time.h>  #include <time.h>
6  #include "rdesktop.h"  #include "rdesktop.h"
7    
# Line 22  Line 24 
24  #define IRP_MN_QUERY_DIRECTORY          0x01  #define IRP_MN_QUERY_DIRECTORY          0x01
25  #define IRP_MN_NOTIFY_CHANGE_DIRECTORY  0x02  #define IRP_MN_NOTIFY_CHANGE_DIRECTORY  0x02
26    
 //#define MAX_ASYNC_IO_REQUESTS   10  
   
27  extern char hostname[16];  extern char hostname[16];
28  extern DEVICE_FNS serial_fns;  extern DEVICE_FNS serial_fns;
29  extern DEVICE_FNS printer_fns;  extern DEVICE_FNS printer_fns;
30  extern DEVICE_FNS parallel_fns;  extern DEVICE_FNS parallel_fns;
31  extern DEVICE_FNS disk_fns;  extern DEVICE_FNS disk_fns;
32    extern FILEINFO g_fileinfo[];
33    
34  static VCHANNEL *rdpdr_channel;  static VCHANNEL *rdpdr_channel;
35    
# Line 39  uint32 g_num_devices; Line 39  uint32 g_num_devices;
39    
40  /* Table with information about rdpdr devices */  /* Table with information about rdpdr devices */
41  RDPDR_DEVICE g_rdpdr_device[RDPDR_MAX_DEVICES];  RDPDR_DEVICE g_rdpdr_device[RDPDR_MAX_DEVICES];
42    char * g_rdpdr_clientname = NULL;
43    
 #if 0  
44  /* Used to store incoming io request, until they are ready to be completed */  /* Used to store incoming io request, until they are ready to be completed */
45    /* using a linked list ensures that they are processed in the right order, */
46    /* if multiple ios are being done on the same fd */
47  struct async_iorequest  struct async_iorequest
48  {  {
49          uint32 fd, major, minor, offset, device, id, length;          uint32 fd, major, minor, offset, device, id, length, partial_len;
50          long timeout,           /* Total timeout */          long timeout,           /* Total timeout */
51            itv_timeout;          /* Interval timeout (between serial characters) */            itv_timeout;          /* Interval timeout (between serial characters) */
52          uint8 *buffer;          uint8 *buffer;
53          DEVICE_FNS *fns;          DEVICE_FNS *fns;
54  } g_iorequest[MAX_ASYNC_IO_REQUESTS];  
55  #endif          struct async_iorequest *next;   /* next element in list */
56    };
57    
58    struct async_iorequest *g_iorequest;
59    
60  /* Return device_id for a given handle */  /* Return device_id for a given handle */
61  int  int
# Line 77  convert_to_unix_filename(char *filename) Line 82  convert_to_unix_filename(char *filename)
82          }          }
83  }  }
84    
85  #if 0  BOOL
86    rdpdr_handle_ok(int device, int handle)
87    {
88            switch (g_rdpdr_device[device].device_type)
89            {
90                    case DEVICE_TYPE_PARALLEL:
91                    case DEVICE_TYPE_SERIAL:
92                    case DEVICE_TYPE_PRINTER:
93                    case DEVICE_TYPE_SCARD:
94                            if (g_rdpdr_device[device].handle != handle)
95                                    return False;
96                            break;
97                    case DEVICE_TYPE_DISK:
98                            if (g_fileinfo[handle].device_id != device)
99                                    return False;
100                            break;
101            }
102            return True;
103    }
104    
105  /* Add a new io request to the table containing pending io requests so it won't block rdesktop */  /* Add a new io request to the table containing pending io requests so it won't block rdesktop */
106  BOOL  BOOL
107  add_async_iorequest(uint32 device, uint32 file, uint32 id, uint32 major, uint32 length,  add_async_iorequest(uint32 device, uint32 file, uint32 id, uint32 major, uint32 length,
108                      DEVICE_FNS * fns, long total_timeout, long interval_timeout, uint8 * buffer)                      DEVICE_FNS * fns, uint32 total_timeout, uint32 interval_timeout, uint8 * buffer,
109                        uint32 offset)
110  {  {
         int i;  
111          struct async_iorequest *iorq;          struct async_iorequest *iorq;
112    
113          for (i = 0; i < MAX_ASYNC_IO_REQUESTS; i++)          if (g_iorequest == NULL)
114          {          {
115                  iorq = &g_iorequest[i];                  g_iorequest = (struct async_iorequest *) xmalloc(sizeof(struct async_iorequest));
116                    if (!g_iorequest)
117                  if (iorq->fd == 0)                          return False;
118                  {                  g_iorequest->fd = 0;
119                          iorq->device = device;                  g_iorequest->next = NULL;
120                          iorq->fd = file;          }
121                          iorq->id = id;  
122                          iorq->major = major;          iorq = g_iorequest;
123                          iorq->length = length;  
124                          iorq->fns = fns;          while (iorq->fd != 0)
125                          iorq->timeout = total_timeout;          {
126                          iorq->itv_timeout = interval_timeout;                  // create new element if needed
127                          iorq->buffer = buffer;                  if (iorq->next == NULL)
128                          return True;                  {
129                  }                          iorq->next =
130          }                                  (struct async_iorequest *) xmalloc(sizeof(struct async_iorequest));
131          error("IO request table full. Increase MAX_ASYNC_IO_REQUESTS in rdpdr.c!\n");                          if (!iorq->next)
132          return False;                                  return False;
133                            iorq->next->fd = 0;
134                            iorq->next->next = NULL;
135                    }
136                    iorq = iorq->next;
137            }
138            iorq->device = device;
139            iorq->fd = file;
140            iorq->id = id;
141            iorq->major = major;
142            iorq->length = length;
143            iorq->partial_len = 0;
144            iorq->fns = fns;
145            iorq->timeout = total_timeout;
146            iorq->itv_timeout = interval_timeout;
147            iorq->buffer = buffer;
148            iorq->offset = offset;
149            return True;
150  }  }
 #endif  
151    
152  void  void
153  rdpdr_send_connect(void)  rdpdr_send_connect(void)
# Line 129  void Line 169  void
169  rdpdr_send_name(void)  rdpdr_send_name(void)
170  {  {
171          uint8 magic[4] = "rDNC";          uint8 magic[4] = "rDNC";
172          uint32 hostlen = (strlen(hostname) + 1) * 2;          if (NULL == g_rdpdr_clientname) {
173              g_rdpdr_clientname = hostname;
174            }
175            uint32 hostlen = (strlen(g_rdpdr_clientname) + 1) * 2;
176          STREAM s;          STREAM s;
177    
178          s = channel_init(rdpdr_channel, 16 + hostlen);          s = channel_init(rdpdr_channel, 16 + hostlen);
# Line 138  rdpdr_send_name(void) Line 181  rdpdr_send_name(void)
181          out_uint16_le(s, 0x72);          out_uint16_le(s, 0x72);
182          out_uint32(s, 0);          out_uint32(s, 0);
183          out_uint32_le(s, hostlen);          out_uint32_le(s, hostlen);
184          rdp_out_unistr(s, hostname, hostlen - 2);          rdp_out_unistr(s, g_rdpdr_clientname, hostlen - 2);
185          s_mark_end(s);          s_mark_end(s);
186          channel_send(s, rdpdr_channel);          channel_send(s, rdpdr_channel);
187  }  }
# Line 210  rdpdr_send_available(void) Line 253  rdpdr_send_available(void)
253                                  rdp_out_unistr(s, printerinfo->printer, printerlen - 2);                                  rdp_out_unistr(s, printerinfo->printer, printerlen - 2);
254                                  out_uint8a(s, printerinfo->blob, bloblen);                                  out_uint8a(s, printerinfo->blob, bloblen);
255    
256                                  xfree(printerinfo->blob);       /* Blob is sent twice if reconnecting */                                  if (printerinfo->blob)
257                                            xfree(printerinfo->blob);       /* Blob is sent twice if reconnecting */
258                                  break;                                  break;
259                          default:                          default:
260                                  out_uint32(s, 0);                                  out_uint32(s, 0);
# Line 290  rdpdr_process_irp(STREAM s) Line 334  rdpdr_process_irp(STREAM s)
334                  case DEVICE_TYPE_SERIAL:                  case DEVICE_TYPE_SERIAL:
335    
336                          fns = &serial_fns;                          fns = &serial_fns;
337                          /* should be async when aio is finished */                          rw_blocking = False;
                         /*rw_blocking = False; */  
338                          break;                          break;
339    
340                  case DEVICE_TYPE_PARALLEL:                  case DEVICE_TYPE_PARALLEL:
341    
342                          fns = &parallel_fns;                          fns = &parallel_fns;
343                          /* should be async when aio is finished */                          rw_blocking = False;
                         /*rw_blocking = False;*/  
344                          break;                          break;
345    
346                  case DEVICE_TYPE_PRINTER:                  case DEVICE_TYPE_PRINTER:
# Line 309  rdpdr_process_irp(STREAM s) Line 351  rdpdr_process_irp(STREAM s)
351                  case DEVICE_TYPE_DISK:                  case DEVICE_TYPE_DISK:
352    
353                          fns = &disk_fns;                          fns = &disk_fns;
354                            rw_blocking = False;
355                          break;                          break;
356    
357                  case DEVICE_TYPE_SCARD:                  case DEVICE_TYPE_SCARD:
# Line 374  rdpdr_process_irp(STREAM s) Line 417  rdpdr_process_irp(STREAM s)
417  #if WITH_DEBUG_RDP5  #if WITH_DEBUG_RDP5
418                          DEBUG(("RDPDR IRP Read (length: %d, offset: %d)\n", length, offset));                          DEBUG(("RDPDR IRP Read (length: %d, offset: %d)\n", length, offset));
419  #endif  #endif
420  //                      if (rw_blocking)        // Complete read immediately                          if (!rdpdr_handle_ok(device, file))
421  //                      {                          {
422                                    status = STATUS_INVALID_HANDLE;
423                                    break;
424                            }
425    
426                            if (rw_blocking)        // Complete read immediately
427                            {
428                                  buffer = (uint8 *) xrealloc((void *) buffer, length);                                  buffer = (uint8 *) xrealloc((void *) buffer, length);
429                                    if (!buffer)
430                                    {
431                                            status = STATUS_CANCELLED;
432                                            break;
433                                    }
434                                  status = fns->read(file, buffer, length, offset, &result);                                  status = fns->read(file, buffer, length, offset, &result);
435                                  buffer_len = result;                                  buffer_len = result;
436                                  break;                                  break;
437  //                      }                          }
438    
 #if 0  
439                          // Add request to table                          // Add request to table
440                          pst_buf = (uint8 *) xmalloc(length);                          pst_buf = (uint8 *) xmalloc(length);
441                            if (!pst_buf)
442                            {
443                                    status = STATUS_CANCELLED;
444                                    break;
445                            }
446                          serial_get_timeout(file, length, &total_timeout, &interval_timeout);                          serial_get_timeout(file, length, &total_timeout, &interval_timeout);
447                          if (add_async_iorequest                          if (add_async_iorequest
448                              (device, file, id, major, length, fns, total_timeout, interval_timeout,                              (device, file, id, major, length, fns, total_timeout, interval_timeout,
449                               pst_buf))                               pst_buf, offset))
450                          {                          {
451                                  status = STATUS_PENDING;                                  status = STATUS_PENDING;
452                                  break;                                  break;
# Line 396  rdpdr_process_irp(STREAM s) Line 454  rdpdr_process_irp(STREAM s)
454    
455                          status = STATUS_CANCELLED;                          status = STATUS_CANCELLED;
456                          break;                          break;
 #endif  
457                  case IRP_MJ_WRITE:                  case IRP_MJ_WRITE:
458    
459                          buffer_len = 1;                          buffer_len = 1;
# Line 413  rdpdr_process_irp(STREAM s) Line 470  rdpdr_process_irp(STREAM s)
470  #if WITH_DEBUG_RDP5  #if WITH_DEBUG_RDP5
471                          DEBUG(("RDPDR IRP Write (length: %d)\n", result));                          DEBUG(("RDPDR IRP Write (length: %d)\n", result));
472  #endif  #endif
473  //                      if (rw_blocking)        // Complete immediately                          if (!rdpdr_handle_ok(device, file))
474  //                      {                          {
475                                    status = STATUS_INVALID_HANDLE;
476                                    break;
477                            }
478    
479                            if (rw_blocking)        // Complete immediately
480                            {
481                                  status = fns->write(file, s->p, length, offset, &result);                                  status = fns->write(file, s->p, length, offset, &result);
482                                  break;                                  break;
483  //                      }                          }
484  #if 0  
485                          // Add to table                          // Add to table
486                          pst_buf = (uint8 *) xmalloc(length);                          pst_buf = (uint8 *) xmalloc(length);
487                            if (!pst_buf)
488                            {
489                                    status = STATUS_CANCELLED;
490                                    break;
491                            }
492    
493                          in_uint8a(s, pst_buf, length);                          in_uint8a(s, pst_buf, length);
494    
495                          if (add_async_iorequest                          if (add_async_iorequest
496                              (device, file, id, major, length, fns, 0, 0, pst_buf))                              (device, file, id, major, length, fns, 0, 0, pst_buf, offset))
497                          {                          {
498                                  status = STATUS_PENDING;                                  status = STATUS_PENDING;
499                                  break;                                  break;
# Line 432  rdpdr_process_irp(STREAM s) Line 501  rdpdr_process_irp(STREAM s)
501    
502                          status = STATUS_CANCELLED;                          status = STATUS_CANCELLED;
503                          break;                          break;
 #endif  
504    
505                  case IRP_MJ_QUERY_INFORMATION:                  case IRP_MJ_QUERY_INFORMATION:
506    
# Line 545  rdpdr_process_irp(STREAM s) Line 613  rdpdr_process_irp(STREAM s)
613                          in_uint8s(s, 0x14);                          in_uint8s(s, 0x14);
614    
615                          buffer = (uint8 *) xrealloc((void *) buffer, bytes_out + 0x14);                          buffer = (uint8 *) xrealloc((void *) buffer, bytes_out + 0x14);
616                            if (!buffer)
617                            {
618                                    status = STATUS_CANCELLED;
619                                    break;
620                            }
621    
622                          out.data = out.p = buffer;                          out.data = out.p = buffer;
623                          out.size = sizeof(buffer);                          out.size = sizeof(buffer);
624                          status = fns->device_control(file, request, s, &out);                          status = fns->device_control(file, request, s, &out);
# Line 560  rdpdr_process_irp(STREAM s) Line 634  rdpdr_process_irp(STREAM s)
634          {          {
635                  rdpdr_send_completion(device, id, status, result, buffer, buffer_len);                  rdpdr_send_completion(device, id, status, result, buffer, buffer_len);
636          }          }
637          xfree(buffer);          if (buffer)
638                    xfree(buffer);
639            buffer = NULL;
640  }  }
641    
642  void  void
# Line 676  rdpdr_init() Line 751  rdpdr_init()
751          return (rdpdr_channel != NULL);          return (rdpdr_channel != NULL);
752  }  }
753    
 #if 0  
754  /* Add file descriptors of pending io request to select() */  /* Add file descriptors of pending io request to select() */
755  void  void
756  rdpdr_add_fds(int *n, fd_set * rfds, fd_set * wfds, struct timeval *tv, BOOL * timeout)  rdpdr_add_fds(int *n, fd_set * rfds, fd_set * wfds, struct timeval *tv, BOOL * timeout)
757  {  {
758          int i;          uint32 select_timeout = 0;      // Timeout value to be used for select() (in millisecons).
         long select_timeout = 0;        // Timeout value to be used for select() (in millisecons).  
759          struct async_iorequest *iorq;          struct async_iorequest *iorq;
760    
761          for (i = 0; i < MAX_ASYNC_IO_REQUESTS; i++)          iorq = g_iorequest;
762            while (iorq != NULL)
763          {          {
764                  iorq = &g_iorequest[i];                  if (iorq->fd != 0)
   
                 if (iorq->fd != 0)      // Found a pending io request  
765                  {                  {
766                          switch (iorq->major)                          switch (iorq->major)
767                          {                          {
# Line 712  rdpdr_add_fds(int *n, fd_set * rfds, fd_ Line 784  rdpdr_add_fds(int *n, fd_set * rfds, fd_
784                                          break;                                          break;
785    
786                                  case IRP_MJ_WRITE:                                  case IRP_MJ_WRITE:
   
787                                          FD_SET(iorq->fd, wfds);                                          FD_SET(iorq->fd, wfds);
788                                          break;                                          break;
789    
790                          }                          }
791                          *n = MAX(*n, iorq->fd);                          *n = MAX(*n, iorq->fd);
792                  }                  }
793    
794                    iorq = iorq->next;
795          }          }
796  }  }
797    
798    struct async_iorequest *
799    rdpdr_remove_iorequest(struct async_iorequest *prev, struct async_iorequest *iorq)
800    {
801            if (!iorq)
802                    return NULL;
803    
804            if (iorq->buffer)
805                    xfree(iorq->buffer);
806            if (prev)
807            {
808                    prev->next = iorq->next;
809                    xfree(iorq);
810                    iorq = prev->next;
811            }
812            else
813            {
814                    // Even if NULL
815                    g_iorequest = iorq->next;
816                    xfree(iorq);
817                    iorq = NULL;
818            }
819            return iorq;
820    }
821    
822  /* Check if select() returned with one of the rdpdr file descriptors, and complete io if it did */  /* Check if select() returned with one of the rdpdr file descriptors, and complete io if it did */
823  void  void
824  rdpdr_check_fds(fd_set * rfds, fd_set * wfds, BOOL timed_out)  rdpdr_check_fds(fd_set * rfds, fd_set * wfds, BOOL timed_out)
825  {  {
         int i;  
826          NTSTATUS status;          NTSTATUS status;
827          uint32 result = 0, buffer_len = 0;          uint32 result = 0;
828          DEVICE_FNS *fns;          DEVICE_FNS *fns;
829          struct async_iorequest *iorq;          struct async_iorequest *iorq;
830            struct async_iorequest *prev;
831            uint32 req_size = 0;
832    
833          if (timed_out)          if (timed_out)
834          {          {
# Line 739  rdpdr_check_fds(fd_set * rfds, fd_set * Line 836  rdpdr_check_fds(fd_set * rfds, fd_set *
836                  return;                  return;
837          }          }
838    
839          // Walk through array of pending io_rq's          iorq = g_iorequest;
840          for (i = 0; i < MAX_ASYNC_IO_REQUESTS; i++)          prev = NULL;
841            while (iorq != NULL)
842          {          {
                 iorq = &g_iorequest[i];  
   
843                  if (iorq->fd != 0)                  if (iorq->fd != 0)
844                  {                  {
845                          switch (iorq->major)                          switch (iorq->major)
846                          {                          {
   
847                                  case IRP_MJ_READ:                                  case IRP_MJ_READ:
   
848                                          if (FD_ISSET(iorq->fd, rfds))                                          if (FD_ISSET(iorq->fd, rfds))
849                                          {                                          {
850                                                  // Read, and send data.                                                  /* Read the data */
851                                                  fns = iorq->fns;                                                  fns = iorq->fns;
852                                                  status = fns->read(iorq->fd, iorq->buffer,  
853                                                                     iorq->length, 0, &result);                                                  req_size =
854                                                  buffer_len = result;                                                          (iorq->length - iorq->partial_len) >
855                                                            8192 ? 8192 : (iorq->length -
856                                                  rdpdr_send_completion(iorq->device, iorq->id,                                                                         iorq->partial_len);
857                                                                        status, result, iorq->buffer,                                                  /* never read larger chunks than 8k - chances are that it will block */
858                                                                        buffer_len);                                                  status = fns->read(iorq->fd,
859                                                                       iorq->buffer + iorq->partial_len,
860                                                                       req_size, iorq->offset, &result);
861    
862                                                    if (result > 0)
863                                                    {
864                                                            iorq->partial_len += result;
865                                                            iorq->offset += result;
866                                                    }
867  #if WITH_DEBUG_RDP5  #if WITH_DEBUG_RDP5
868                                                  DEBUG(("RDPDR: %d bytes of data read\n", result));                                                  DEBUG(("RDPDR: %d bytes of data read\n", result));
869  #endif  #endif
870                                                  xfree(iorq->buffer);                                                  /* only delete link if all data has been transfered */
871                                                  iorq->fd = 0;                                                  /* or if result was 0 and status success - EOF      */
872                                                    if ((iorq->partial_len == iorq->length) ||
873                                                        (result == 0))
874                                                    {
875    #if WITH_DEBUG_RDP5
876                                                            DEBUG(("RDPDR: AIO total %u bytes read of %u\n", iorq->partial_len, iorq->length));
877    #endif
878                                                            rdpdr_send_completion(iorq->device,
879                                                                                  iorq->id, status,
880                                                                                  iorq->partial_len,
881                                                                                  iorq->buffer,
882                                                                                  iorq->partial_len);
883                                                            iorq = rdpdr_remove_iorequest(prev, iorq);
884                                                    }
885                                          }                                          }
886                                          break;                                          break;
   
887                                  case IRP_MJ_WRITE:                                  case IRP_MJ_WRITE:
   
888                                          if (FD_ISSET(iorq->fd, wfds))                                          if (FD_ISSET(iorq->fd, wfds))
889                                          {                                          {
890                                                  // Write data and send completion.                                                  /* Write data. */
891                                                  fns = iorq->fns;                                                  fns = iorq->fns;
                                                 status = fns->write(iorq->fd, iorq->buffer,  
                                                                     iorq->length, 0, &result);  
                                                 rdpdr_send_completion(iorq->device, iorq->id,  
                                                                       status, result, "", 1);  
892    
893                                                  xfree(iorq->buffer);                                                  req_size =
894                                                  iorq->fd = 0;                                                          (iorq->length - iorq->partial_len) >
895                                                            8192 ? 8192 : (iorq->length -
896                                                                           iorq->partial_len);
897    
898                                                    /* never write larger chunks than 8k - chances are that it will block */
899                                                    status = fns->write(iorq->fd,
900                                                                        iorq->buffer +
901                                                                        iorq->partial_len, req_size,
902                                                                        iorq->offset, &result);
903    
904                                                    if (result > 0)
905                                                    {
906                                                            iorq->partial_len += result;
907                                                            iorq->offset += result;
908                                                    }
909    
910    #if WITH_DEBUG_RDP5
911                                                    DEBUG(("RDPDR: %d bytes of data written\n",
912                                                           result));
913    #endif
914                                                    /* only delete link if all data has been transfered */
915                                                    /* or we couldn't write */
916                                                    if ((iorq->partial_len == iorq->length)
917                                                        || (result == 0))
918                                                    {
919    #if WITH_DEBUG_RDP5
920                                                            DEBUG(("RDPDR: AIO total %u bytes written of %u\n", iorq->partial_len, iorq->length));
921    #endif
922                                                            rdpdr_send_completion(iorq->device,
923                                                                                  iorq->id, status,
924                                                                                  iorq->partial_len,
925                                                                                  (uint8 *) "", 1);
926    
927                                                            iorq = rdpdr_remove_iorequest(prev, iorq);
928                                                    }
929                                          }                                          }
930                                          break;                                          break;
931                          }                          }
932    
933                  }                  }
934                    prev = iorq;
935                    if (iorq)
936                            iorq = iorq->next;
937          }          }
938    
939  }  }
940    
941  /* Abort a pending io request for a given handle and major */  /* Abort a pending io request for a given handle and major */
# Line 795  BOOL Line 943  BOOL
943  rdpdr_abort_io(uint32 fd, uint32 major, NTSTATUS status)  rdpdr_abort_io(uint32 fd, uint32 major, NTSTATUS status)
944  {  {
945          uint32 result;          uint32 result;
         int i;  
946          struct async_iorequest *iorq;          struct async_iorequest *iorq;
947            struct async_iorequest *prev;
948    
949          for (i = 0; i < MAX_ASYNC_IO_REQUESTS; i++)          iorq = g_iorequest;
950            prev = NULL;
951            while (iorq != NULL)
952          {          {
                 iorq = &g_iorequest[i];  
   
953                  // Only remove from table when major is not set, or when correct major is supplied.                  // Only remove from table when major is not set, or when correct major is supplied.
954                  // Abort read should not abort a write io request.                  // Abort read should not abort a write io request.
955                  if ((iorq->fd == fd) && (major == 0 || iorq->major == major))                  if ((iorq->fd == fd) && (major == 0 || iorq->major == major))
956                  {                  {
957                          result = 0;                          result = 0;
958                          rdpdr_send_completion(iorq->device, iorq->id, status, result, "", 1);                          rdpdr_send_completion(iorq->device, iorq->id, status, result, (uint8 *) "",
959                          xfree(iorq->buffer);                                                1);
960                          iorq->fd = 0;  
961                            iorq = rdpdr_remove_iorequest(prev, iorq);
962                          return True;                          return True;
963                  }                  }
964    
965                    prev = iorq;
966                    iorq = iorq->next;
967          }          }
968    
969          return False;          return False;
970  }  }
 #endif  

Legend:
Removed from v.590  
changed lines
  Added in v.646

  ViewVC Help
Powered by ViewVC 1.1.26