I'm a longtime user of WebWare. I just stumbled over some pretty strange 
problem. The Application running on Webware is a kind of Document 
Management system that can contain quite huge files (ISO images).
When somebody is downloading such a file and cancels the download, the 
application eats up more and more memory. It looks like the application 
tries to deliver the content, but, instead of delivering it to the 
client (who's not longer there), caches everything in memory.
This is the newest version of WebWare.

I've done the following change:
In WebKit/ThreadedAppServer.py

741     def flush(self):
742         """Flush stream.
743
744         Calls `ASStreamOut.ASStreamOut.flush`, and if that returns True
745         (indicating the buffer is full enough) then we send data from
746         the buffer out on the socket.
747
748         """
749         result = ASStreamOut.flush(self)
750         if result: # a True return value means we can send
751             reslen = len(self._buffer)
752             sent = 0
753             while sent < reslen:
754                 try:
755                     sent += self._socket.send(
756                         self._buffer[sent:sent+8192])
757                 except socket.error, e:
758                     if e[0] == errno.EPIPE: # broken pipe
759                         pass
760                     elif hasattr(errno, 'ECONNRESET') \
761                             and e[0] == errno.ECONNRESET:
762                         pass
763                     else:
764                         print "StreamOut Error: ", e
765                     break
766             self.pop(sent)

I've changed line 759 from 'pass' to 'raise', which now gives ugly 
tracebacks in the logs, but other than that, does what should happen 
anyway: cancel the download.

Stephan

P.S.: I know this is quite a political issue, but is there a chance to 
change from tabs to spaces in Webware code?

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to