/[dynamips]/upstream/dynamips-0.2.7-RC2/net_io.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /upstream/dynamips-0.2.7-RC2/net_io.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

upstream/dynamips-0.2.7-RC1/net_io.c revision 7 by dpavlin, Sat Oct 6 16:23:47 2007 UTC upstream/dynamips-0.2.7-RC2/net_io.c revision 8 by dpavlin, Sat Oct 6 16:24:54 2007 UTC
# Line 1461  static void netio_rxl_add_internal(struc Line 1461  static void netio_rxl_add_internal(struc
1461  static void *netio_rxl_spec_thread(void *arg)  static void *netio_rxl_spec_thread(void *arg)
1462  {  {
1463     struct netio_rx_listener *rxl = arg;     struct netio_rx_listener *rxl = arg;
1464     u_char pkt[NETIO_MAX_PKT_SIZE];     netio_desc_t *nio = rxl->nio;
1465     ssize_t pkt_len;     ssize_t pkt_len;
1466    
1467     while(rxl->running) {     while(rxl->running) {
1468        pkt_len = netio_recv(rxl->nio,pkt,sizeof(pkt));        pkt_len = netio_recv(nio,nio->rx_pkt,sizeof(nio->rx_pkt));
1469    
1470        if (pkt_len > 0)        if (pkt_len > 0)
1471           rxl->rx_handler(rxl->nio,pkt,pkt_len,rxl->arg1,rxl->arg2);           rxl->rx_handler(nio,nio->rx_pkt,pkt_len,rxl->arg1,rxl->arg2);
1472     }     }
1473    
1474     return NULL;     return NULL;
# Line 1478  static void *netio_rxl_spec_thread(void Line 1478  static void *netio_rxl_spec_thread(void
1478  void *netio_rxl_gen_thread(void *arg)  void *netio_rxl_gen_thread(void *arg)
1479  {  {
1480     struct netio_rx_listener *rxl;     struct netio_rx_listener *rxl;
    u_char pkt[NETIO_MAX_PKT_SIZE];  
1481     ssize_t pkt_len;     ssize_t pkt_len;
1482     netio_desc_t *nio;     netio_desc_t *nio;
1483     struct timeval tv;     struct timeval tv;
# Line 1533  void *netio_rxl_gen_thread(void *arg) Line 1532  void *netio_rxl_gen_thread(void *arg)
1532        NETIO_RXL_LOCK();        NETIO_RXL_LOCK();
1533    
1534        for(rxl=netio_rxl_list;rxl;rxl=rxl->next) {        for(rxl=netio_rxl_list;rxl;rxl=rxl->next) {
1535           if ((fd = netio_get_fd(rxl->nio)) == -1)           nio = rxl->nio;
1536    
1537             if ((fd = netio_get_fd(nio)) == -1)
1538              continue;              continue;
1539    
1540           if (FD_ISSET(fd,&rfds)) {           if (FD_ISSET(fd,&rfds)) {
1541              pkt_len = netio_recv(rxl->nio,pkt,sizeof(pkt));              pkt_len = netio_recv(nio,nio->rx_pkt,sizeof(nio->rx_pkt));
1542    
1543              if (pkt_len > 0)              if (pkt_len > 0)
1544                 rxl->rx_handler(rxl->nio,pkt,pkt_len,rxl->arg1,rxl->arg2);                 rxl->rx_handler(nio,nio->rx_pkt,pkt_len,rxl->arg1,rxl->arg2);
1545           }           }
1546        }        }
1547    

Legend:
Removed from v.7  
changed lines
  Added in v.8

  ViewVC Help
Powered by ViewVC 1.1.26