Re: Re: HTTP server storing client's IP address?
Scott Henion <[email protected]>
| Newsgroups | gmane.comp.hardware.rabbit-semiconductor |
|---|---|
| Message-ID | <[email protected]> |
On 11/2/2012 10:11 AM, racqueldesign wrote:
> Hi Jesus,
>
> Thanks for telling about the getpeername but I first need to know the name of the socket. For example:
>
> void main()
> {
> sock_init_or_exit(1);
> http_init();
> tcp_reserveport(80);
> while (1)
> {
> http_handler();
> }
> }
>
> I am guessing the http_init() setup the socket. Am i right or am I missing something? I need my .cgi handler to get its client's ip address. Is there also a function the returns a pointer to the current socket? I think that might solve my problem with your advice.
>
Your CGI handler will be passed a HttpState pointer. Look at the
structure, the socket will be in there.
<Scott>
--
------------------------------------------
Scott G. Henion, Consultant
Web site: http://SHDesigns.org
------------------------------------------