From ab161bbb0b5dc5fcabdc616c564cf2de2b6deadc Mon Sep 17 00:00:00 2001 From: henri Date: Sat, 27 Jun 2015 08:21:05 +0000 Subject: [PATCH] Remove nsock_pool unique identifiers. This isn't used anywhere and I cannot think of any use case. The NSP is supposed to be unique and global as it controls the event loop. --- nsock/include/nsock.h | 3 --- nsock/src/nsock_internal.h | 4 ---- nsock/src/nsock_pool.c | 11 ----------- 3 files changed, 18 deletions(-) diff --git a/nsock/include/nsock.h b/nsock/include/nsock.h index 5ce8d4e05..3c302d465 100644 --- a/nsock/include/nsock.h +++ b/nsock/include/nsock.h @@ -202,9 +202,6 @@ void nsock_loop_quit(nsock_pool nsp); * if the status is NSOCK_LOOP_ERROR was returned by nsock_loop() */ int nsp_geterrorcode(nsock_pool nsp); -/* Every nsp has an ID that is unique across the program execution */ -unsigned long nsp_getid(nsock_pool nsp); - nsock_ssl nsi_getssl(nsock_iod nsockiod); /* Note that nsi_get1_ssl_session will increment the usage count of the diff --git a/nsock/src/nsock_internal.h b/nsock/src/nsock_internal.h index 44cf8f60d..529b6623d 100644 --- a/nsock/src/nsock_internal.h +++ b/nsock/src/nsock_internal.h @@ -152,10 +152,6 @@ struct writeinfo { /* Remember that callers of this library should NOT be accessing these * fields directly */ struct npool { - - /* Every msp has a unique (across the program execution) id */ - unsigned long id; - /* User data, NULL if unset */ void *userdata; diff --git a/nsock/src/nsock_pool.c b/nsock/src/nsock_pool.c index a9f2da895..91cf0042a 100644 --- a/nsock/src/nsock_pool.c +++ b/nsock/src/nsock_pool.c @@ -74,8 +74,6 @@ extern struct timeval nsock_tod; -unsigned long nsp_next_id = 2; - /* To use this library, the first thing they must do is create a pool * so we do the initialization during the first pool creation */ static int nsocklib_initialized = 0; @@ -89,15 +87,8 @@ static void nsock_library_initialize(void); /* --------------------------------------- */ -/* Every mst has an ID that is unique across the program execution */ -unsigned long nsp_getid(nsock_pool nsp) { - struct npool *mt = (struct npool *)nsp; - return mt->id; -} - /* This next function returns the errno style error code -- which is only * valid if the status NSOCK_LOOP_ERROR was returned by nsock_loop() */ - int nsp_geterrorcode(nsock_pool nsp) { struct npool *mt = (struct npool *)nsp; return mt->errnum; @@ -162,8 +153,6 @@ nsock_pool nsp_new(void *userdata) { nsp->loglevel = NSOCK_LOG_ERROR; nsp->logger = (nsock_logger_t)nsock_stderr_logger; - nsp->id = nsp_next_id++; - nsp->userdata = userdata; nsp->engine = get_io_engine();