Changeset 5513

Show
Ignore:
Timestamp:
06/16/12 12:32:53 (7 years ago)
Author:
nitin
Message:

Fixed bugs in recvfrom_syscall() and sendto_syscall() in lind_net_calls.py. Added new unit test, ut_lind_net_recvfrom.py

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • seattle/branches/nacl_repy/seattlelib/lind_net_calls.py

    r5500 r5513  
    300300 
    301301 
    302   filedescriptortable[fd]['last_peek'] = None 
     302  filedescriptortable[fd]['last_peek'] = '' 
    303303 
    304304 
     
    381381  # end is connected... 
    382382  if remoteip == '' and remoteport == 0: 
    383     return send_syscall(fd,message) 
     383    return send_syscall(fd, message, flags) 
    384384 
    385385  if filedescriptortable[fd]['state'] == CONNECTED or filedescriptortable[fd]['state'] == LISTEN: 
     
    530530    while True: 
    531531      # if we have previous data from a peek, use that 
    532       data = None 
     532      data = '' 
    533533      try: 
    534534        data = sockobj.recv(length) 
     
    555555      if len(peek) <= length: 
    556556        ret_data = peek 
    557         filedescriptortable[fd]['last_peek'] = None 
     557        filedescriptortable[fd]['last_peek'] = '' 
    558558      else: 
    559559        ret_data = peek[:length] 
     
    562562      if (flags & MSG_PEEK) != 0: 
    563563        # print "@@ peek next time" 
    564         filedescriptortable[fd]['last_peek'] = ret_data 
    565  
     564        filedescriptortable[fd]['last_peek'] = peek 
     565         
    566566      return remoteip, remoteport, ret_data 
    567567 
     
    840840        sleep(RETRYWAITAMOUNT) 
    841841      else: 
    842          
     842 
    843843        newfd = _socket_initializer(filedescriptortable[fd]['domain'],filedescriptortable[fd]['type'],filedescriptortable[fd]['protocol']) 
    844844