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

version 1.28.2.6, 2011/05/09 13:52:20 version 1.29, 2011/04/11 12:10:10
Line 1 Line 1
 /*  /*
 ================================================================================  ================================================================================
   RPL/2 (R) version 4.0.24    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 2062  instruction_read(struct_processus *s_eta Line 2065  instruction_read(struct_processus *s_eta
                 }                  }
 #               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 2097  instruction_read(struct_processus *s_eta Line 2097  instruction_read(struct_processus *s_eta
                                 tampon_lecture, longueur_questure,                                  tampon_lecture, longueur_questure,
                                 MSG_PEEK | MSG_DONTWAIT, (struct sockaddr *)                                  MSG_PEEK | MSG_DONTWAIT, (struct sockaddr *)
                                 &adresse_ipv6, &longueur_adresse);                                  &adresse_ipv6, &longueur_adresse);
   
 #                       else  #                       else
                         if ((*s_etat_processus).langue == 'F')                          if ((*s_etat_processus).langue == 'F')
                         {                          {
Line 2140  instruction_read(struct_processus *s_eta Line 2139  instruction_read(struct_processus *s_eta
                     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);
                     }                      }
   
                     // Une donnée a été reçue.  
   
                     if (((*s_etat_processus).var_volatile_requete_arret == -1)                      if (((*s_etat_processus).var_volatile_requete_arret == -1)
                             || (longueur_effective >= 0))                              || (longueur_effective >= 0))
                     {                      {
Line 2357  instruction_read(struct_processus *s_eta Line 2353  instruction_read(struct_processus *s_eta
                 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);
   
                 (*s_objet_adresse).objet = NULL;                  (*s_objet_adresse).objet = NULL;
Line 2368  instruction_read(struct_processus *s_eta Line 2364  instruction_read(struct_processus *s_eta
                 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  instruction_read(struct_processus *s_eta Line 2444  instruction_read(struct_processus *s_eta
                 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  instruction_read(struct_processus *s_eta Line 2569  instruction_read(struct_processus *s_eta
                 }                  }
 #               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  instruction_read(struct_processus *s_eta Line 2643  instruction_read(struct_processus *s_eta
                     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  instruction_read(struct_processus *s_eta Line 2790  instruction_read(struct_processus *s_eta
   
             /*              /*
              * 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  instruction_read(struct_processus *s_eta Line 2800  instruction_read(struct_processus *s_eta
                     (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.6  
changed lines
  Added in v.1.29


CVSweb interface <joel.bertrand@systella.fr>