Changeset 5499

Show
Ignore:
Timestamp:
06/06/12 13:05:45 (7 years ago)
Author:
justinc
Message:

fix proposed by Leonard Law. Prevents large webpages from being truncated.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • seattle/trunk/repy/apps/allpairsping/allpairsping.repy

    r3658 r5499  
    7070  webpage = webpage + '</table></html>' 
    7171 
    72   # send the header and page 
    73   connobj.send('HTTP/1.1 200 OK\nContent-Type: text/html\nContent-Length: '+str(len(webpage))+'\nServer: Seattle Testbed\n\n'+webpage)  
     72  # combine everything into one unit 
     73  data = 'HTTP/1.1 200 OK\nContent-Type: text/html\nContent-Length: '+str(len(webpage))+'\nServer: Seattle Testbed\n\n'+webpage 
     74 
     75  # send all the data 
     76  sent = 0 
     77  while sent < len(data): 
     78    sent += connobj.send(data[sent:]) 
    7479 
    7580  # and we're done, so let's close this connection...