Re: Question about FastCgi Protocol - how to retrieve content length

Bryan White <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
Jose Adriano Baltieri wrote:
> Hello members of the list !
> 
> The FastCGI protocol specs defines records as below :
> 
> typedef struct {
>             unsigned char version;
>             unsigned char type;
>             unsigned char requestIdB1;
>             unsigned char requestIdB0;
>             unsigned char *contentLengthB1*;
>             unsigned char *contentLengthB0*;
>             unsigned char paddingLength;
>             unsigned char reserved;
>             unsigned char contentData[contentLength];
>             unsigned char paddingData[paddingLength];
>         } FCGI_Record;
> 
> 
> How do I convert contentLengthB1 and contentLengthB0 into a human 
> readable number ?

int clen = (hdr.contentLengthB1 << 8) + hdr.contentLengthB0;


-- 
Bryan White
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.