Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/elvnct/AlloHouston
Browse files Browse the repository at this point in the history
  • Loading branch information
AxelVincent committed Dec 8, 2017
2 parents af8d2c3 + 392e7e1 commit b43a43f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions serveur/sources/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ void nouveauService(int descripteurSocketService)
recevoirMessage(descripteurSocketService, commandeRecu);
printf("Le client veut partir de : %s (taille = %d)\n", commandeRecu, sizeRead);
char* villeDepart = strdup(commandeRecu);
trimwhitespace(villeDepart);

// Envoie et reception des informations a propos de la ville d'arrivee
printf("%d "MAG"CHOIX ARRIVEE"RESET"\n", pid);
Expand All @@ -86,7 +85,6 @@ void nouveauService(int descripteurSocketService)
recevoirMessage(descripteurSocketService, commandeRecu);
printf("Le client veut aller a : %s (taille = %d)\n", commandeRecu, sizeRead);
char* villeArrivee = strdup(commandeRecu);
trimwhitespace(villeArrivee);

// Envoie et reception des informations a propos de l'horaire
printf("%d "MAG"CHOIX HORAIRE"RESET"\n", pid);
Expand Down Expand Up @@ -283,6 +281,11 @@ void recevoirMessage(int descripteurSocketService, char *commandeRecu)
{
int sizeRead;
sizeRead = read(descripteurSocketService, commandeRecu, SIZE_MSG);
if(sizeRead == -1 || sizeRead == 0){
fprintf(stderr, RED"Erreur lecture socket!\n"RESET);
exit(-1);
}
trimwhitespace(commandeRecu);
printf("Commande reçu du client : %s (taille = %d)\n", commandeRecu, sizeRead);
}

Expand Down

0 comments on commit b43a43f

Please sign in to comment.