/[lwip]/lwip/src/api/sockets.c
ViewVC logotype

Diff of /lwip/src/api/sockets.c

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

revision 1.6 by jani, Fri Jan 24 09:24:44 2003 UTC revision 1.7 by jani, Fri Jan 31 12:51:56 2003 UTC
# Line 254  lwip_recvfrom(int s, void *mem, int len, Line 254  lwip_recvfrom(int s, void *mem, int len,
254       the supplied memory pointer mem */       the supplied memory pointer mem */
255    netbuf_copy_partial(buf, mem, copylen, sock->lastoffset);    netbuf_copy_partial(buf, mem, copylen, sock->lastoffset);
256    
257      /* Check to see from where the data was. */
258      if(from != NULL && fromlen != NULL) {
259        addr = netbuf_fromaddr(buf);
260        port = netbuf_fromport(buf);  
261        ((struct sockaddr_in *)from)->sin_addr.s_addr = addr->addr;
262        ((struct sockaddr_in *)from)->sin_port = port;
263        ((struct sockaddr_in *)from)->sin_family = AF_INET;
264        *fromlen = sizeof(struct sockaddr_in);
265      }
266    
267    /* If this is a TCP socket, check if there is data left in the    /* If this is a TCP socket, check if there is data left in the
268       buffer. If so, it should be saved in the sock structure for next       buffer. If so, it should be saved in the sock structure for next
269       time around. */       time around. */
# Line 266  lwip_recvfrom(int s, void *mem, int len, Line 276  lwip_recvfrom(int s, void *mem, int len,
276      netbuf_delete(buf);      netbuf_delete(buf);
277    }    }
278    
279    /* Check to see from where the data was. */  
   if(from != NULL && fromlen != NULL) {  
     addr = netbuf_fromaddr(buf);  
     port = netbuf_fromport(buf);    
     ((struct sockaddr_in *)from)->sin_addr.s_addr = addr->addr;  
     ((struct sockaddr_in *)from)->sin_port = port;  
     ((struct sockaddr_in *)from)->sin_family = AF_INET;  
     *fromlen = sizeof(struct sockaddr_in);  
   }  
     
280    return copylen;    return copylen;
281  }  }
282  /*-----------------------------------------------------------------------------------*/  /*-----------------------------------------------------------------------------------*/

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26