Skip to content

Instantly share code, notes, and snippets.

@metametaclass
Created October 19, 2012 12:24
Show Gist options
  • Save metametaclass/3917988 to your computer and use it in GitHub Desktop.
Save metametaclass/3917988 to your computer and use it in GitHub Desktop.
#ifdef WANT_IP_FROM_PROXY
if( accesslist_isblessed( cookie->ip, OT_PERMISSION_MAY_PROXY ) ) {
ot_ip6 proxied_ip;
char *fwd = http_header( ws->request, ws->header_size, "x-forwarded-for" );
if( fwd && scan_ip6( fwd, proxied_ip ) ) {
syslog(LOG_DAEMON | LOG_DEBUG,"ip_from_proxy %s",fwd);
OT_SETIP( &ws->peer, proxied_ip );
} else
OT_SETIP( &ws->peer, cookie->ip );
} else
#endif
ws->peer_id = NULL;
ws->hash = NULL;
OT_SETIP( &ws->peer, cookie->ip );
OT_SETPORT( &ws->peer, &port );
OT_PEERFLAG( &ws->peer ) = 0;
numwant = 50;
scanon = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment