Mentions légales du service

Skip to content
  • Johannes Kanig's avatar
    P613-010 fix crashes of gnatwhy3 connecting to why3server · 95c207d1
    Johannes Kanig authored
    On windows, when the why3server has accepted a client on the server
    socket, it continues to use that socket for the client communication. A
    new socket is created so that new clients can connect. However, there
    may be a little time between accepting the client and creating the new
    socket, where the connection of another client will be refused. This
    resulted in crashes.
    
    We now simply prepare more than one server socket, so that several
    clients can connect at the same time. More precisely, we create as many
    sockets as gnatwhy3 processes will be run in parallel.
    
    Concretely, we replace the previous server_socket and server_key
    variables by arrays, whose length is determined by the "parallel"
    option. The code which manipulated these variables needs to be adapted
    to know which of the sockets to manipulate.
    
    * server-win.c
    (shutdown_with_msg): close all handles
    (create_server_socket): new integer argument which specifies the cell to
       store the new server socket in
    (accept_client): new integer argument which specifies on which of the
       server sockets the connection was accepted. Used to create a new
       socket in that cell using create_server_socket.
    (init): create an array of sockets instead of just one
    (get_server_num): new function to determine the socket which got the
      new client
    (main): use get_server_num to know if it was a server socket that had an
       event, and which one. Call accept_client with the result.
    
    Change-Id: I5f7ff1b30c9340d897b75085ade61b2d79f87167
    (cherry picked from commit f2cbded5da7a3fcbebb61ee98b8e6c8d9c1d2227)
    95c207d1