Re: [Karrigell-main] Crash on large files? & why async?
Brought to you by:
quentel
From: quentel.pierre <que...@wa...> - 2003-12-08 20:18:28
|
Re: [Karrigell-main] Crash on large files? & why async?On the last = version I've put on the cvs, KarrigellRequestHandler is now in a = separate script, while Karrigell.py or Karrigell_async.py only lanches = the server. In KarrigellRequestHandler I've added this : KarrigellRequestHandler.extensions_map.update({".py":"text/html", ".pih":"text/html",".hip":"text.html",".pyk":"text/html"}) extensions_map is used to compute the content-type header Could you see if this solves the problem you mention ? A+ ----- Original Message -----=20 From: Remco Boerma=20 To: Andrew Nelis=20 Sent: Monday, December 08, 2003 11:26 AM Subject: RE: [Karrigell-main] Crash on large files? & why async? After i've tried this on my work - machine , i've got strange = behaviour: IE downloaded the PY file (begin html) en startend=20 running python on it. And using the mimetypes unig (what it obviously = does) is making all my .py, pih, and hip files application/text-python = files (or something similar)..=20 So if you want to use it, use something like: =20 if extension.lower() in ['py','pyc','pyo','pih','hip']: self.ctype =3D 'text/html' else: self.ctype =3D self.guess_type(self.path) self.RESPONSE['Content-Type'] =3D self.ctype[0] or = 'application/unknown' Now it works again..=20 Anyways, i think i'll disable the 2 lines you sent me untill they = reappear in a beta version somewhere ;)) cheerz! /a+ Remco -----Original Message-----=20 From: Andrew Nelis [mailto:an...@ni...]=20 Sent: Thu 12/4/2003 15:10=20 To: Kar...@li...=20 Cc:=20 Subject: Re: [Karrigell-main] Crash on large files? & why async? Remco Boerma wrote: >Hi all, >=20 > Hello again, >Does any of you have any idea why my page (ranging from 0.2MB to = 20MB - >it's al logfile) doesn't want to be sent? >Both the Async server as the 'standard , non-threaded' server have = this >problem.=20 >The 'threaded' server in Karrigell 1.3 didn't have any problems = with it. It >just took a few seconds.. (around 10). >=20 > I'm thinking this might be to do with the default mime-type which is text/html, I guess your browser might get a large file thrown at it = and then try and display it ... all 20Mb of it. Which would eventually = lead it to die. Maybe. Here's a fix to add more intelligent mimetype handling to karrigell: Karrigell_async.py - append after line 187 so 187 to 188 reads: self.ctype =3D self.guess_type(self.path) self.RESPONSE['Content-Type'] =3D self.ctype[0] or 'application/unknown' (That's line 183 for Karrigell.py) This seperation and having to fix two different files - maybe it = might be a good idea to have the common KarrigellRequestHandler class definition in a single file, and just import it & overide it's = methods each time for the various server implementations? >My second question is: what purpose does the async have? Is it = like,: you >get multiple connections without using threads? - (so i still need = file >locking??!?!) or it's faster to transfer the data? > >error: (10053, 'Software caused connection abort') >--------------------------------------- >=20 > I think it's due to your browser dying, and not closing the = connection in a very friendly fashion. Apply the above fix, let us know how = that goes. Cheers, Andrew. ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Karrigell-main mailing list Kar...@li... https://lists.sourceforge.net/lists/listinfo/karrigell-main -------------------------------------------------------------------------= ----- Dit bericht is gecontroleerd op virussen door Mailmarshal software en = Sophos Antivirus Wilt u meer weten over deze producten? Neemt u dan contact op met ICT = Point Telefoon 0592 316311, of bezoek onze website: www.ictpoint.nl=20 -------------------------------------------------------------------------= ----- = NH????u=16=1Am>???x???m???=0E???jz?yD=10=11???Pr???q?z?{?zjj???zj??q?z=D8= =AD?????=1E~?=E0=BA=B7??=CB=A2???=07??f? |