Problem with webserver

Problem with webserver

Postby Dave Zowasky » Thu Jun 22, 2006 5:01 pm

Hello All,

It seems I am having a problem with the webserv program.

I am on a version that was out in oct 2004.

When It goes to send a page, the receiving page never gets to the browser, and the page sent does not show in the log. When I ask for an invalid page I do get the error on the browser.

I have tested the same code on FW, FWPP and it works fine on those installs. I even installed the last version of FWH I have on a PC fresh and it still gets the same results.

Any Ideas?


Thanks
Dave Zowasky
Com1 Software, Inc.
http://www.com1software.com
information@com1software.com
330 653-3771
User avatar
Dave Zowasky
 
Posts: 125
Joined: Wed Oct 19, 2005 2:28 pm
Location: Hudson Ohio

Figured out part of the problem

Postby Dave Zowasky » Fri Jun 23, 2006 2:43 am

I decided to create a new class from a copy of the twebserv class and as
I was debugging it I got to this section.

HtmlRead( cFileName ) CLASS TWebServer

hFile = LOpen( cFileName, "r" )

nSize = FSeek( hFile, 0, 2 ) // FS_END


It appears the nsize is coming back 0

I decided to plug in my own code:

hFile = fopen( cFileName, 0 )
nSize = FSeek( hFile, 0, 2 ) // FS_END
FSeek( hFile, 0, 0 ) // FS_SET
tbuf=" "
cbuffer:=""
y:=0
do while y<nsize
fx:=fseek(hfile,y,0)
fx=ferror()
if fx#0
info="Cfile <ERROR> FC-Seek #"+str(fx,2)
?info
endif
fx:=fread(hfile,@tbuf,1)
fx=ferror()
if fx#0
info="Cfile <ERROR> FC-Fread #"+str(fx,2)
?info
endif
cbuffer:=cbuffer+chr(asc(tbuf))
y:=y+1
enddo
fclose( hFile )


The server works nice and I am looking forward adding and playing with my new class.

Just wanted to pass on what I found.


Thanks
Dave Zowasky
Com1 Software, Inc.
http://www.com1software.com
information@com1software.com
330 653-3771
User avatar
Dave Zowasky
 
Posts: 125
Joined: Wed Oct 19, 2005 2:28 pm
Location: Hudson Ohio

Postby Antonio Linares » Fri Jun 23, 2006 8:35 am

Dave,

Please try this change. Instead of:
Code: Select all  Expand view
   hFile = LOpen( cFileName, "r" )

   nSize = FSeek( hFile, 0, 2 )  // FS_END
   FSeek( hFile, 0, 0 )          // FS_SET

   cBuffer = Space( nSize )
   FRead( hFile, @cBuffer, nSize )
   LClose( hFile )

just use:
Code: Select all  Expand view
   cBuffer = MemoRead( cFileName )

Please let us know if it works for you. Thanks,
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 76 guests