Changeset 4020


Ignore:
Timestamp:
11/29/10 22:09:50 (10 years ago)
Author:
_network
Message:

fix duplicate newcamd users

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/module-newcamd.c

    r3994 r4020  
    11061106    while(rc==-9)
    11071107    {
     1108        if (!client->pfd) break;
    11081109        // process_input returns -9 on clienttimeout
    11091110        while ((rc=process_input(mbuf, sizeof(mbuf), cfg->cmaxidle))>0)
  • trunk/oscam-reader.c

    r3965 r4020  
    283283void network_tcp_connection_close(struct s_client *cl, int fd)
    284284{
    285   if(!cl) return;
    286   struct s_reader *reader = cl->reader;
    287   cs_debug("tcp_conn_close(): fd=%d, cl->typ == 'c'=%d", fd, cl->typ == 'c');
    288   if (fd) {
    289     close(fd);
    290     if(reader)
    291       clear_block_delay(reader);
    292   }
    293   cl->udp_fd = 0;
     285    if(!cl) return;
     286    struct s_reader *reader = cl->reader;
     287    cs_debug("tcp_conn_close(): fd=%d, cl->typ == 'c'=%d", fd, cl->typ == 'c');
     288
     289    if (fd) {
     290        close(fd);
     291        if (fd == cl->udp_fd)
     292            cl->udp_fd = 0;
     293        if (fd == cl->pfd)
     294            cl->pfd = 0;
     295
     296        if(reader)
     297            clear_block_delay(reader);
     298    }
     299
    294300
    295301  if (cl->typ != 'c')
  • trunk/oscam.c

    r4014 r4020  
    390390        prev->next = cl2->next; //remove client from list
    391391
    392     cs_sleepms(2000); //wait some time before cleanup to prevent segfaults
    393     if(ph[cl->ctyp].cleanup) ph[cl->ctyp].cleanup(cl);
     392    if(cl->typ == 'c' && ph[cl->ctyp].cleanup)
     393        ph[cl->ctyp].cleanup(cl);
     394
     395    if(cl->pfd)     nullclose(&cl->pfd); //Closing Network socket
     396    if(cl->fd_m2c_c)    nullclose(&cl->fd_m2c_c); //Closing client read fd
     397    if(cl->fd_m2c)  nullclose(&cl->fd_m2c); //Closing client read fd
     398
     399    cs_sleepms(1000); //wait some time before cleanup to prevent segfaults
    394400    NULLFREE(cl->ecmtask);
    395401    NULLFREE(cl->emmcache);
    396402    NULLFREE(cl->req);
    397403    NULLFREE(cl->cc);
    398     if(cl->pfd)     nullclose(&cl->pfd); //Closing Network socket
    399     if(cl->fd_m2c_c)    nullclose(&cl->fd_m2c_c); //Closing client read fd
    400     if(cl->fd_m2c)  nullclose(&cl->fd_m2c); //Closing client read fd
    401404
    402405    NULLFREE (cl);
Note: See TracChangeset for help on using the changeset viewer.