Diff for /rpl/src/instructions_r4.c between versions 1.28.2.3 and 1.29

version 1.28.2.3, 2011/04/17 14:01:23 version 1.29, 2011/04/11 12:10:10
Line 1 Line 1
 /*  /*
 ================================================================================  ================================================================================
   RPL/2 (R) version 4.0.23    RPL/2 (R) version 4.1.0.prerelease.0
   Copyright (C) 1989-2011 Dr. BERTRAND Joël    Copyright (C) 1989-2011 Dr. BERTRAND Joël
   
   This file is part of RPL/2.    This file is part of RPL/2.
Line 903  instruction_read(struct_processus *s_eta Line 903  instruction_read(struct_processus *s_eta
   
     (*s_etat_processus).erreur_execution = d_ex;      (*s_etat_processus).erreur_execution = d_ex;
   
       attente.tv_sec = 0;
       attente.tv_nsec = GRANULARITE_us * 1000;
   
     if ((*s_etat_processus).affichage_arguments == 'Y')      if ((*s_etat_processus).affichage_arguments == 'Y')
     {      {
         printf("\n  READ ");          printf("\n  READ ");
Line 2034  instruction_read(struct_processus *s_eta Line 2037  instruction_read(struct_processus *s_eta
             }              }
         }          }
   
 printf("<1>\n");  
         if ((*((struct_socket *) (*s_objet_argument_1).objet)).binaire == 'N')          if ((*((struct_socket *) (*s_objet_argument_1).objet)).binaire == 'N')
         { // Socket formatée          { // Socket formatée
             longueur_questure = 256;              longueur_questure = 256;
 printf("<2>\n");  
   
             do              do
             {              {
Line 2064  printf("<2>\n"); Line 2065  printf("<2>\n");
                 }                  }
 #               endif  #               endif
   
                 attente.tv_sec = 0;  
                 attente.tv_nsec = GRANULARITE_us * 1000;  
   
                 for(;;)                  for(;;)
                 {                  {
                     if ((*((struct_socket *) (*s_objet_argument_1).objet))                      if ((*((struct_socket *) (*s_objet_argument_1).objet))
Line 2138  printf("<2>\n"); Line 2136  printf("<2>\n");
                         return;                          return;
                     }                      }
   
                     if (longueur_effective <= 0)                      if (longueur_effective < 0)
                     {                      {
                         nanosleep(&attente, NULL);                          nanosleep(&attente, NULL);
                         INCR_GRANULARITE(attente.tv_nsec);  
                         scrutation_injection(s_etat_processus);                          scrutation_injection(s_etat_processus);
                     }                      }
   
                     if (((*s_etat_processus).var_volatile_requete_arret == -1)                      if (((*s_etat_processus).var_volatile_requete_arret == -1)
                             || (longueur_effective > 0))                              || (longueur_effective >= 0))
                     {                      {
                         break;                          break;
                     }                      }
Line 2356  printf("<2>\n"); Line 2353  printf("<2>\n");
                 longueur_adresse = 0;                  longueur_adresse = 0;
                 recvfrom((*((struct_socket *)                  recvfrom((*((struct_socket *)
                         (*s_objet_argument_1).objet)).socket, tampon_lecture,                          (*s_objet_argument_1).objet)).socket, tampon_lecture,
                         longueur_effective, MSG_DONTWAIT,                          position_finale, MSG_DONTWAIT,
                         NULL, &longueur_adresse);                          NULL, &longueur_adresse);
 printf("<%s>\n", tampon_lecture);  
   
                 (*s_objet_adresse).objet = NULL;                  (*s_objet_adresse).objet = NULL;
             }              }
Line 2368  printf("<%s>\n", tampon_lecture); Line 2364  printf("<%s>\n", tampon_lecture);
                 longueur_adresse = sizeof(adresse_ipv4);                  longueur_adresse = sizeof(adresse_ipv4);
                 recvfrom((*((struct_socket *)                  recvfrom((*((struct_socket *)
                         (*s_objet_argument_1).objet)).socket, tampon_lecture,                          (*s_objet_argument_1).objet)).socket, tampon_lecture,
                         longueur_effective, MSG_DONTWAIT,                          position_finale, MSG_DONTWAIT,
                         (struct sockaddr *) &adresse_ipv4, &longueur_adresse);                          (struct sockaddr *) &adresse_ipv4, &longueur_adresse);
   
                 if (((*s_objet_adresse).objet =                  if (((*s_objet_adresse).objet =
Line 2448  printf("<%s>\n", tampon_lecture); Line 2444  printf("<%s>\n", tampon_lecture);
                 longueur_adresse = sizeof(adresse_ipv6);                  longueur_adresse = sizeof(adresse_ipv6);
                 recvfrom((*((struct_socket *)                  recvfrom((*((struct_socket *)
                         (*s_objet_argument_1).objet)).socket, tampon_lecture,                          (*s_objet_argument_1).objet)).socket, tampon_lecture,
                         longueur_effective, MSG_DONTWAIT,                          position_finale, MSG_DONTWAIT,
                         (struct sockaddr *) &adresse_ipv6, &longueur_adresse);                          (struct sockaddr *) &adresse_ipv6, &longueur_adresse);
   
                 if (((*s_objet_adresse).objet =                  if (((*s_objet_adresse).objet =
Line 2573  printf("<%s>\n", tampon_lecture); Line 2569  printf("<%s>\n", tampon_lecture);
                 }                  }
 #               endif  #               endif
   
                 attente.tv_sec = 0;  
                 attente.tv_nsec = GRANULARITE_us * 1000;  
   
                 for(;;)                  for(;;)
                 {                  {
                     if ((*((struct_socket *) (*s_objet_argument_1).objet))                      if ((*((struct_socket *) (*s_objet_argument_1).objet))
Line 2650  printf("<%s>\n", tampon_lecture); Line 2643  printf("<%s>\n", tampon_lecture);
                     if (longueur_effective < 0)                      if (longueur_effective < 0)
                     {                      {
                         nanosleep(&attente, NULL);                          nanosleep(&attente, NULL);
                         INCR_GRANULARITE(attente.tv_nsec);  
                         scrutation_injection(s_etat_processus);                          scrutation_injection(s_etat_processus);
                     }                      }
   
Line 2798  printf("<%s>\n", tampon_lecture); Line 2790  printf("<%s>\n", tampon_lecture);
   
             /*              /*
              * Les informations concernant la cible sont valides si               * Les informations concernant la cible sont valides si
              * la socket est non connectée et que les domaines sont               * la socket est non connectée et des domaines INET ou INET6.
              * INET ou INET6.  
              * Dans tous les autres cas, on renvoie une liste vide.               * Dans tous les autres cas, on renvoie une liste vide.
              */               */
   
Line 2809  printf("<%s>\n", tampon_lecture); Line 2800  printf("<%s>\n", tampon_lecture);
                     (strcmp((*((struct_socket *) (*s_objet_argument_1).objet))                      (strcmp((*((struct_socket *) (*s_objet_argument_1).objet))
                     .type, "SEQUENTIAL DATAGRAM") == 0))                      .type, "SEQUENTIAL DATAGRAM") == 0))
             {              {
                 // POSITION_FINALE peut être utilisée sans être initialisée !  
                 // virer position_finale pour longueur_effective  
                 longueur_adresse = 0;                  longueur_adresse = 0;
                 recvfrom((*((struct_socket *)                  recvfrom((*((struct_socket *)
                         (*s_objet_argument_1).objet)).socket, tampon_lecture,                          (*s_objet_argument_1).objet)).socket, tampon_lecture,

Removed from v.1.28.2.3  
changed lines
  Added in v.1.29


CVSweb interface <joel.bertrand@systella.fr>