Skip to content

Commit c26a6ba

Browse files
committed
Ensure lwan_connection_get_fd() is always inlined
1 parent c26a398 commit c26a6ba

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/lib/lwan-request.c

-6
Original file line numberDiff line numberDiff line change
@@ -1788,12 +1788,6 @@ const char *lwan_request_get_host(struct lwan_request *request)
17881788
return helper->host.len ? helper->host.value : NULL;
17891789
}
17901790

1791-
ALWAYS_INLINE int
1792-
lwan_connection_get_fd(const struct lwan *lwan, const struct lwan_connection *conn)
1793-
{
1794-
return (int)(intptr_t)(conn - lwan->conns);
1795-
}
1796-
17971791
const char *
17981792
lwan_request_get_remote_address_and_port(struct lwan_request *request,
17991793
char buffer[static INET6_ADDRSTRLEN],

src/lib/lwan.h

+7
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,13 @@ ssize_t lwan_request_async_writev(struct lwan_request *request,
686686

687687
void lwan_straitjacket_enforce(const struct lwan_straitjacket *sj);
688688

689+
static ALWAYS_INLINE int
690+
lwan_connection_get_fd(const struct lwan *lwan,
691+
const struct lwan_connection *conn)
692+
{
693+
return (int)(intptr_t)(conn - lwan->conns);
694+
}
695+
689696
#if defined(__cplusplus)
690697
}
691698
#endif

0 commit comments

Comments
 (0)