View previous topic :: View next topic |
Author |
Message |
reachjeffs -
Joined: 13 May 2004 Posts: 1
|
Posted: Mon Jul 28, 2008 11:19 pm Post subject: form post limit of 1024 bytes? |
|
|
I'm using X1 v2.5 on a WinXP box.
I've written many cgi programs in BCX and I've always had very good results when running on Abyss. My current program needs to post much more data than the others and it's causing a problem...
Everything works fine when I post < 1024 bytes of data to the program but it fails with > 1024 bytes.
The relevant code is:
Code: | DIM CONTENT_LENGTH
DIM ByteCount AS ULONG
DIM POST_Data$ * 1024*1024
DIM hSTDIN AS HANDLE
CONTENT_LENGTH = VAL (ENVIRON$ ("CONTENT_LENGTH"))
hSTDIN = GetStdHandle (STD_INPUT_HANDLE)
ReadFile (hSTDIN, POST_Data$, CONTENT_LENGTH, &ByteCount, 0) |
POST_Data$ is dimensioned at 1024*1024, which should give me a 1MB variable. If I print out the contents of POST_Data$, I only see the first 1024 characters, even though the CONTENT_LENGTH is showing the correct length of 1454.
Am I missing something? If this is an Abyss limitation, is there a custom CGI variable that I can set that will extend this limit?
Any ideas would be appreciated.
Thank you,
Jeff |
|
Back to top |
|
|
mdoigny -
Joined: 24 May 2008 Posts: 16 Location: Oostende, Belgium
|
Posted: Fri Mar 27, 2009 5:47 pm Post subject: |
|
|
Had the same problem. This is my workaound:
Code: | %STD_INPUT_HANDLE = -10&
TYPE OVERLAPPED
Internal AS DWORD
InternalHigh AS DWORD
offset AS DWORD
OffsetHigh AS DWORD
hEvent AS DWORD
END TYPE
DECLARE FUNCTION ReadFile LIB "KERNEL32.DLL" ALIAS "ReadFile"_
(BYVAL hFile AS DWORD, lpBuffer AS ANY, BYVAL nNumberOfBytesToRead AS DWORD, lpNumberOfBytesRead AS DWORD, lpOverlapped AS OVERLAPPED) AS LONG
DECLARE FUNCTION GetStdHandle LIB "KERNEL32.DLL" ALIAS "GetStdHandle" (BYVAL nStdHandle AS DWORD) AS DWORD
FUNCTION PBMAIN()
c = VAL(ENVIRON$("CONTENT_LENGTH"))
a$ = SPACE$(c): j = 1
hInput = GetStdHandle(%STD_INPUT_HANDLE)
IF hInput THEN
DO
Buffer$ = SPACE$(512)
iResult = ReadFile(hInput, BYVAL STRPTR(Buffer$), LEN(Buffer$), iRead, BYVAL 0)
IF iResult = 0 THEN
STDOUT "HTTP/1.1 500 Internal Server Error"
STDOUT "Content-Type: text/plain
STDOUT
STDOUT "Failed to 'ReadFile'
EXIT FUNCTION
ELSEIF iRead = 0 THEN
EXIT DO
ELSE
MID$(a$, j, iRead) = Buffer$
j = j + iRead
END IF
IF iRead < LEN(Buffer$) THEN
EXIT DO
END IF
LOOP
END IF
|
_________________ Home server |
|
Back to top |
|
|
|
|
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
|
|