diff options
Diffstat (limited to 'src/util/server.c')
-rw-r--r-- | src/util/server.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/src/util/server.c b/src/util/server.c index 94d781870..d05df089f 100644 --- a/src/util/server.c +++ b/src/util/server.c | |||
@@ -122,12 +122,12 @@ struct GNUNET_SERVER_Handle | |||
122 | /** | 122 | /** |
123 | * Function to call for access control. | 123 | * Function to call for access control. |
124 | */ | 124 | */ |
125 | GNUNET_CONNECTION_AccessCheck access; | 125 | GNUNET_CONNECTION_AccessCheck access_cb; |
126 | 126 | ||
127 | /** | 127 | /** |
128 | * Closure for access. | 128 | * Closure for @e access_cb. |
129 | */ | 129 | */ |
130 | void *access_cls; | 130 | void *access_cb_cls; |
131 | 131 | ||
132 | /** | 132 | /** |
133 | * NULL-terminated array of sockets used to listen for new | 133 | * NULL-terminated array of sockets used to listen for new |
@@ -413,8 +413,8 @@ process_listen_socket (void *cls, | |||
413 | if (GNUNET_NETWORK_fdset_isset (tc->read_ready, server->listen_sockets[i])) | 413 | if (GNUNET_NETWORK_fdset_isset (tc->read_ready, server->listen_sockets[i])) |
414 | { | 414 | { |
415 | sock = | 415 | sock = |
416 | GNUNET_CONNECTION_create_from_accept (server->access, | 416 | GNUNET_CONNECTION_create_from_accept (server->access_cb, |
417 | server->access_cls, | 417 | server->access_cb_cls, |
418 | server->listen_sockets[i]); | 418 | server->listen_sockets[i]); |
419 | if (NULL != sock) | 419 | if (NULL != sock) |
420 | { | 420 | { |
@@ -522,8 +522,8 @@ open_listen_socket (const struct sockaddr *server_addr, socklen_t socklen) | |||
522 | /** | 522 | /** |
523 | * Create a new server. | 523 | * Create a new server. |
524 | * | 524 | * |
525 | * @param access function for access control | 525 | * @param access_cb function for access control |
526 | * @param access_cls closure for access | 526 | * @param access_cb_cls closure for @a access_cb |
527 | * @param lsocks NULL-terminated array of listen sockets | 527 | * @param lsocks NULL-terminated array of listen sockets |
528 | * @param idle_timeout after how long should we timeout idle connections? | 528 | * @param idle_timeout after how long should we timeout idle connections? |
529 | * @param require_found if #GNUNET_YES, connections sending messages of unknown type | 529 | * @param require_found if #GNUNET_YES, connections sending messages of unknown type |
@@ -532,8 +532,8 @@ open_listen_socket (const struct sockaddr *server_addr, socklen_t socklen) | |||
532 | * (typically, "port" already in use) | 532 | * (typically, "port" already in use) |
533 | */ | 533 | */ |
534 | struct GNUNET_SERVER_Handle * | 534 | struct GNUNET_SERVER_Handle * |
535 | GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access, | 535 | GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access_cb, |
536 | void *access_cls, | 536 | void *access_cb_cls, |
537 | struct GNUNET_NETWORK_Handle **lsocks, | 537 | struct GNUNET_NETWORK_Handle **lsocks, |
538 | struct GNUNET_TIME_Relative idle_timeout, | 538 | struct GNUNET_TIME_Relative idle_timeout, |
539 | int require_found) | 539 | int require_found) |
@@ -543,8 +543,8 @@ GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access, | |||
543 | server = GNUNET_new (struct GNUNET_SERVER_Handle); | 543 | server = GNUNET_new (struct GNUNET_SERVER_Handle); |
544 | server->idle_timeout = idle_timeout; | 544 | server->idle_timeout = idle_timeout; |
545 | server->listen_sockets = lsocks; | 545 | server->listen_sockets = lsocks; |
546 | server->access = access; | 546 | server->access_cb = access_cb; |
547 | server->access_cls = access_cls; | 547 | server->access_cb_cls = access_cb_cls; |
548 | server->require_found = require_found; | 548 | server->require_found = require_found; |
549 | if (NULL != lsocks) | 549 | if (NULL != lsocks) |
550 | GNUNET_SERVER_resume (server); | 550 | GNUNET_SERVER_resume (server); |
@@ -555,8 +555,8 @@ GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access, | |||
555 | /** | 555 | /** |
556 | * Create a new server. | 556 | * Create a new server. |
557 | * | 557 | * |
558 | * @param access function for access control | 558 | * @param access_cb function for access control |
559 | * @param access_cls closure for access | 559 | * @param access_cb_cls closure for @a access_cb |
560 | * @param server_addr address to listen on (including port), NULL terminated array | 560 | * @param server_addr address to listen on (including port), NULL terminated array |
561 | * @param socklen length of server_addr | 561 | * @param socklen length of server_addr |
562 | * @param idle_timeout after how long should we timeout idle connections? | 562 | * @param idle_timeout after how long should we timeout idle connections? |
@@ -566,7 +566,8 @@ GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access, | |||
566 | * (typically, "port" already in use) | 566 | * (typically, "port" already in use) |
567 | */ | 567 | */ |
568 | struct GNUNET_SERVER_Handle * | 568 | struct GNUNET_SERVER_Handle * |
569 | GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck access, void *access_cls, | 569 | GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck access_cb, |
570 | void *access_cb_cls, | ||
570 | struct sockaddr *const *server_addr, | 571 | struct sockaddr *const *server_addr, |
571 | const socklen_t * socklen, | 572 | const socklen_t * socklen, |
572 | struct GNUNET_TIME_Relative idle_timeout, | 573 | struct GNUNET_TIME_Relative idle_timeout, |
@@ -619,8 +620,11 @@ GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck access, void *access_cls, | |||
619 | { | 620 | { |
620 | lsocks = NULL; | 621 | lsocks = NULL; |
621 | } | 622 | } |
622 | return GNUNET_SERVER_create_with_sockets (access, access_cls, lsocks, | 623 | return GNUNET_SERVER_create_with_sockets (access_cb, |
623 | idle_timeout, require_found); | 624 | access_cb_cls, |
625 | lsocks, | ||
626 | idle_timeout, | ||
627 | require_found); | ||
624 | } | 628 | } |
625 | 629 | ||
626 | 630 | ||