[Xitami] Developer Issue: POST STDIN vs CGI read

Francis Turner francis.turner at gmail.com
Mon Aug 29 14:18:21 CEST 2005


I do not believe there is anyway to get Xitami to handle posts in any
other way than a single chunk of everything

On 8/29/05, RPO <rolinger1 at hotmail.com> wrote:
>  
> I tested Windows Apache (port 8080) and Windows Xitami (port 80), running
> identical upload scripts.  The upload form passes all the raw POST data to
> upload.pl and an onSubmit calls a popup window running progress.pl.  The
> upload.pl reads in all the raw POST data through a standard "while
> (<STDIN>)", during the while the script writes "bytesReadIn of totalBytes"
> to a temp file, every 8K of read in raw data the script flushes the buffer
> to the temp file to ensure its being written to properly.  While this the
> data is being read in and the temp file is being written to, the progress.pl
> script refreshes in the popup window every two seconds.  During each refresh
> it reads the last "bytesReadIn of totalBytes" entry in the temp file to
> create a visual progress bar, bytes counter and time elapsed. 
>   
> In Apache, this whole process works because the temp file gets created and
> is written to on every 8K buffer flush, thus allowing the Progress Bar to
> increment properly in the popup window.  In Xitami, the temp file creation
> and/or the flush is being ignored and the temp file doesn't get created
> until the entire STDIN done being read in, thus the progress bar popup
> window remains empty during the entire upload until suddenly it shows 100%
> completed.  This is a very fundamental difference and issue in the way the
> Xitami CGI engine captures the POST data and passes it a parsing script. 
>   
> Can anyone elaborate on this?  This is a very critical issue for me.  I have
> created a photo upload site and am highly worried that without a
> status/progress bar users will think their browser has hung or the server
> has timed out. Big uploads of 5Mb to 15Mb could take 5 to 8 minutes, if
> users don't see a visual progress meter incrementing they will cancel the
> upload.  
>   
> Is there some setting or switch I am not aware of that can correct this
> problem?  If not, I may have to consider moving to Apache and I have no
> desire of doing that.  I have been a devoted Xitami user for nearly 7 years
> now and have no desire to stop being a Xitami user. 
>   
> -R 
>  
> ----- Original Message ----- 
> From: RPO 
> To: xitami at lists.xitami.org 
> Sent: Sunday, August 28, 2005 4:13 PM 
> Subject: [Xitami] Developer Issue: POST STDIN vs CGI read 
> 
>  
> I am running Xitami on W2k machine.  How does Xitami handle POST data?  I am
> trying to read in the raw POST data from a file upload form, and while
> reading in the raw data my script writes to a temp file the progress of that
> upload.  Every 8k of POST data the temp file gets updated.  In the script
> the temp file gets created before the POST STDIN occurs. However, with
> Xitami the temp file doesn't get created until AFTER the entire raw STDIN
> has been processed, thus preventing the use of any status or progess data.  
>   
> Is Xitami server somehow holding onto the raw POST data, waiting for it to
> be completely read in, before handing it off to the CGI compiler or before
> handing it off to the perl script?  This same script works on Linux/apache
> the way its intended to, but on Windows/Xitami the temp file doesn't get
> written til after the raw data is completely read in. 
>   
> This is a serious issue because it is inteferring with the ability to create
> a Progress Bar that shows users the status of a multi-file upload.  With
> Perl, the only way to create a Progress Bar is to write updates to a temp
> file (bytesIN of totalBytes) while the files are being uploaded, and a popup
> window refreshes itself and processes the contents of that temp file to be
> able to provide the visual progress of the file upload.  If Xitami is
> somehow interferring with the raw read of POST data, then there is no
> effective way of creating that temp file. 
>   
> -Russel 
>   
>   
> 
>  ________________________________
>  
> 
> 
> --
> Xitami Users Mailing List -- For Xitami support
> To unsubscribe:
> http://lists.xitami.org/mailman/listinfo/xitami
> 
>  
> 
> --
> Xitami Users Mailing List -- For Xitami support
> To unsubscribe:
> http://lists.xitami.org/mailman/listinfo/xitami
> 
> 


-- 
http://www.di2.nu/blog.htm
Faber's Fourth Law:
  Necessity is the mother of strange bedfellows.



More information about the Xitami mailing list