From 2e37d6b71692508fa5d2764c1c80f3c7ca7c2894 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 26 Jun 2015 14:58:03 +0200 Subject: Send search requests on the same connection the explicit bind was done on, so the user's permissions regarding visibility of search results will be applied --- types.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'types.h') diff --git a/types.h b/types.h index 373b52a..183c41f 100644 --- a/types.h +++ b/types.h @@ -22,6 +22,8 @@ #define FALSE (0) typedef struct _server_t_ server_t; +typedef struct _epoll_client_t_ epoll_client_t; +typedef struct _epoll_server_t_ epoll_server_t; /** * General epoll struct, to be implemented by every epoll struct. @@ -44,7 +46,7 @@ typedef struct { /** * epoll struct for a client we're serving. */ -typedef struct { +struct _epoll_client_t_ { void (*callback)(void *data, int haveIn, int haveOut, int doCleanup); int fd; // @@ -56,15 +58,16 @@ typedef struct { size_t sbPos, sbFill, sbLen; SSL *ssl; // NULL if not encrypted char *sendBuffer; // Dynamically allocated, might or might not get huge + epoll_server_t *fixedServer; // If client performed explicit bind, tie to server connection // Recv buffer (client's request) size_t rbPos; char readBuffer[REQLEN]; // Static, queries > 4000 bytes simply not supported -} epoll_client_t; +}; /** * epoll struct for a connection to AD. */ -typedef struct { +struct _epoll_server_t_ { void (*callback)(void *data, int haveIn, int haveOut, int doCleanup); int fd; // @@ -72,6 +75,7 @@ typedef struct { size_t sbPos, sbFill, sbLen; SSL *ssl; // NULL if not encrypted char *sendBuffer; // Dynamically allocated, might or might not get huge + epoll_client_t *fixedClient; // If client performed explicit bind, this is the client belonging to this connection // Recv buffer (server's response) size_t rbPos; char readBuffer[MAXMSGLEN]; @@ -82,7 +86,7 @@ typedef struct { BOOL writeBlocked; // An SSL_write returned WANT_*, so we must not reallocate the current send buffer time_t lastActive; server_t *serverData; -} epoll_server_t; +}; /** * Configuration data for an ADS we're proxying. -- cgit v1.2.3-55-g7522