mirror of
https://github.com/lammertb/libhttp.git
synced 2025-12-22 04:02:04 +03:00
Set deprecated remote_ip member as LEGACY_INTERFACE
This commit is contained in:
@@ -61,8 +61,11 @@ struct mg_request_info {
|
||||
const char *remote_user; /* Authenticated user, or NULL if no auth
|
||||
used */
|
||||
char remote_addr[48]; /* Client's IP address as a string. */
|
||||
|
||||
#if defined(MG_LEGACY_INTERFACE)
|
||||
long remote_ip; /* Client's IP address. Deprecated: use remote_addr instead
|
||||
*/
|
||||
#endif
|
||||
|
||||
long long content_length; /* Length (in bytes) of the request body,
|
||||
can be -1 if no length was given. */
|
||||
|
||||
@@ -10251,10 +10251,10 @@ static void *worker_thread_run(void *thread_func_param)
|
||||
sockaddr_to_string(conn->request_info.remote_addr,
|
||||
sizeof(conn->request_info.remote_addr),
|
||||
&conn->client.rsa);
|
||||
/* TODO: #if defined(MG_LEGACY_INTERFACE) */
|
||||
#if defined(MG_LEGACY_INTERFACE)
|
||||
addr = ntohl(conn->client.rsa.sin.sin_addr.s_addr);
|
||||
memcpy(&conn->request_info.remote_ip, &addr, 4);
|
||||
/* #endif */
|
||||
#endif
|
||||
conn->request_info.is_ssl = conn->client.is_ssl;
|
||||
|
||||
if (!conn->client.is_ssl
|
||||
|
||||
Reference in New Issue
Block a user