[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Address of SOAP + 2



Hello,

 > In the following extract from Example18 in LIBHTTP, why do you add 2
 > to the address of SOAP?

This is done to skip the first 2 bytes of the variable.  If I pass 
%addr() by itself, the %ADDR() BIF will tell HTTPAPI where the variable 
is stored in memory.  If I pass %ADDR()+2, it provides a number that's 
two higher, and thus tells HTTPAPI the address of the 3rd byte of the field.

Why do I want to do that?  Because SOAP is a VARYING field.  A Varying 
field stores the "current length" of the field as a binary number stored 
in the first two bytes.

Since I don't want to send that binary number to the web server (which 
would be very confused by the seemingly random hex values I just sent 
it!) I add two to the address... causing it to skip those characters.

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------