CGI disk access problem

 
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI
View previous topic :: View next topic  
Author Message
killermist
-


Joined: 10 May 2003
Posts: 19

PostPosted: Sat May 10, 2003 12:07 pm    Post subject: CGI disk access problem Reply with quote

I have a CGI program that I have written with Powerbasic Console Compiler, and it runs excellently on the Tinyweb server, but when I try to use it on the Abyss X1 server, it hangs horribly any time I attempt to write to the hard disk. Reading seems to pose no problem, but writing seems to be a problem.

Any suggestions?

The program in question is http://killermist.d2g.com:85/cgi-bin/index.exe as it is rendered by Tinyweb.
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sat May 10, 2003 11:49 pm    Post subject: Re: CGI disk access problem Reply with quote

killermist wrote:
I have a CGI program that I have written with Powerbasic Console Compiler, and it runs excellently on the Tinyweb server, but when I try to use it on the Abyss X1 server, it hangs horribly any time I attempt to write to the hard disk. Reading seems to pose no problem, but writing seems to be a problem.

Any suggestions?

The program in question is http://killermist.d2g.com:85/cgi-bin/index.exe as it is rendered by Tinyweb.

It is your index.exe that writes to the disk, not Abyss. So you should investigate why it is so long to do so. Having the source code may help to know what is wrong.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
killermist
-


Joined: 10 May 2003
Posts: 19

PostPosted: Sun May 11, 2003 8:08 pm    Post subject: Reply with quote

Code:
Function WriteFile(kmfilename$, datagram$) As Long
    Dim filehandle As Long
    filehandle=FreeFile
    Open kmfilename$ For Output As filehandle
    Print # filehandle, datagram$
    Function = 1
    Close filehandle
End Function


This is the page called when the page where editing occurs posts it's data (the new page with username and password) to the script.
Code:
Function Viewdoedit() As Long
    Dim x As Long
    Dim temp$, temp1$
    If inputlookup("user") = "killermist" And inputlookup("password") = "**********" Then
        temp$=inputlookup("content")
        If temp$<>"||undef||" Then
            x=writefile(Environ$("CGI-Root")+"\kmlinks.kmd", temp$)
        End If
        temp1$="Contents updated."
    Else
        temp1$="Authentication failed.  Contents not updated."
    End If

    'x=viewhome()
    StdOut $htmlplug
    StdOut "<html>"
    StdOut "<head>"
    StdOut "<title>Response processed.</title>"
    StdOut "</head>"
    StdOut "<body>"
    StdOut "Response processed.<br>"
    StdOut "Details are as follows:<br>"
    StdOut temp1$+"<br>"
    StdOut "<a href='/cgi-bin/index.exe'>Click here</a> to return to home page."
    StdOut "</body>"
    StdOut "</html>"
End Function


And, yes, before you ask I do make sure to set the environmental variable for CGI-Root. With TinyWeb I have to actually set the environmental variable in the Windows Environment. But for Abyss, I make sure to set it in the Abyss environment table. And I have double-checked it to make sure that the variable is in fact making it to the program. http://killermist.d2g.com:86/cgi-bin/second.exe is my diagnostic script. It returns the entire environment and the contents of any get or post data (if available).
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sun May 11, 2003 9:07 pm    Post subject: Reply with quote

Have tried to debug the writefile function when invoked from the script run by Abyss Web Server?
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
killermist
-


Joined: 10 May 2003
Posts: 19

PostPosted: Sun May 11, 2003 10:19 pm    Post subject: Reply with quote

Ok, I added more debugging code that should have cleared things up, but instead has made things even more confusing.
Now, the write procedure will 80% of the time, lockup solid, and 20% of the time, work perfectly. The problem is that for each one that locks up solid, it's another thread of the index.exe sitting in memory taking up space and doing nothing.
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Mon May 12, 2003 7:56 pm    Post subject: Reply with quote

killermist wrote:
Ok, I added more debugging code that should have cleared things up, but instead has made things even more confusing.
Now, the write procedure will 80% of the time, lockup solid, and 20% of the time, work perfectly. The problem is that for each one that locks up solid, it's another thread of the index.exe sitting in memory taking up space and doing nothing.

Abyss Web Server launches CGI .exe just as explorer does when you double click on a program icon. Nothing special is done except filling the ENV with some variables and redirecting the standard output and input handles to Abyss. This works perfectly on all the CGI exe we've tested including huge and complex one (PHP/Perl/etc...)
To debug your app, you can write to the standard error handle. This will automatically send what you write there to the cgi.log file to ease debugging.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group