Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Foxisapi MAX buffer size
Message
 
À
24/06/1998 18:17:54
Miguel Villax
Migg Systems Limited
Lisbon, Portugal
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00111400
Message ID:
00112117
Vues:
12
>Does any one know the size of foxisapi.dll internal buffer for the incoming POST message. I have an HTML page with a form with POST action and where the encoding/type is 'multipart/form-data'. I can send files to a vfox COM server running of foxisapi under IIS 4 but only if they are ASCII and less than 49Kbytes.

FoxISAPI only grabs the first Client chunk out of the ISAPI ECB structure.
It doesn't read the remaining data which has to be loaded manually with
ReadClient.

The buffer is 48k by default - there is an option to change the default
buffer in the registry. You can check in the docs. Not sure if this
works for IIS 4 (the key may now be in the Metabase). FWIW, it's not
a good idea to resize that buffer too large as IIS has to allocate that
much memory on each ISAPI request.

>I started looking at the foxisapi.cpp but before I went further decided to see if anyone has resilved this problem.

It's fairly trivial to fix actually. The following code is from Web Connection:
	lpFull = (CHAR *) HeapAlloc (GetProcessHeap (), 0, ecb->cbTotalBytes + 10);
	if (!lpFull) {
	   LogError("Unable to allocate memory for POST buffer",ecb);
	   return FALSE;
	}


    /// *** Read the full POST buffer area - loop if more than available
    memset(lpFull,'\0',ecb->cbTotalBytes + 1);      
    memcpy(lpFull,(char *)ecb->lpbData,ecb->cbAvailable);

    cbLeft = ecb->cbTotalBytes - ecb->cbAvailable;
    if (cbLeft < 0)
	   cbLeft=0;

	cbRead = cbLeft;
	pWrite = lpFull + ecb->cbAvailable;
	while (cbLeft > 0) {
		ecb->ReadClient(ecb->ConnID, 
		               (LPVOID) pWrite,
					   (DWORD *) &cbRead);
		pWrite = pWrite + cbRead;
		cbLeft = cbLeft - cbRead;
		cbRead = cbLeft;
	}

    ... do whatever with the Post Buffer

    HeapFree (GetProcessHeap (), 0, lpFull);
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform