aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/llares.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llmessage/llares.cpp')
-rw-r--r--linden/indra/llmessage/llares.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/linden/indra/llmessage/llares.cpp b/linden/indra/llmessage/llares.cpp
index 578304a..fe37fe8 100644
--- a/linden/indra/llmessage/llares.cpp
+++ b/linden/indra/llmessage/llares.cpp
@@ -19,7 +19,8 @@
19 * There are special exceptions to the terms and conditions of the GPL as 19 * There are special exceptions to the terms and conditions of the GPL as
20 * it is applied to this Source Code. View the full text of the exception 20 * it is applied to this Source Code. View the full text of the exception
21 * in the file doc/FLOSS-exception.txt in this software distribution, or 21 * in the file doc/FLOSS-exception.txt in this software distribution, or
22 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 22 * online at
23 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
23 * 24 *
24 * By copying, modifying or distributing this software, you acknowledge 25 * By copying, modifying or distributing this software, you acknowledge
25 * that you have read and understood your obligations described above, 26 * that you have read and understood your obligations described above,
@@ -469,9 +470,7 @@ bool LLAres::process(U64 timeout)
469 470
470 int socks[ARES_GETSOCK_MAXNUM]; 471 int socks[ARES_GETSOCK_MAXNUM];
471 apr_pollfd_t aprFds[ARES_GETSOCK_MAXNUM]; 472 apr_pollfd_t aprFds[ARES_GETSOCK_MAXNUM];
472 apr_int32_t nsds = 0; 473 apr_int32_t nsds = 0;
473 apr_status_t status;
474 apr_pool_t *pool;
475 int nactive = 0; 474 int nactive = 0;
476 int bitmask; 475 int bitmask;
477 476
@@ -479,10 +478,12 @@ bool LLAres::process(U64 timeout)
479 478
480 if (bitmask == 0) 479 if (bitmask == 0)
481 { 480 {
482 goto bail; 481 return nsds > 0;
483 } 482 }
484 483
485 status = apr_pool_create(&pool, gAPRPoolp); 484 apr_status_t status;
485 LLAPRPool pool;
486 status = pool.getStatus() ;
486 ll_apr_assert_status(status); 487 ll_apr_assert_status(status);
487 488
488 for (int i = 0; i < ARES_GETSOCK_MAXNUM; i++) 489 for (int i = 0; i < ARES_GETSOCK_MAXNUM; i++)
@@ -500,16 +501,16 @@ bool LLAres::process(U64 timeout)
500 501
501 apr_socket_t *aprSock = NULL; 502 apr_socket_t *aprSock = NULL;
502 503
503 status = apr_os_sock_put(&aprSock, (apr_os_sock_t *) &socks[i], pool); 504 status = apr_os_sock_put(&aprSock, (apr_os_sock_t *) &socks[i], pool.getAPRPool());
504 if (status != APR_SUCCESS) 505 if (status != APR_SUCCESS)
505 { 506 {
506 ll_apr_warn_status(status); 507 ll_apr_warn_status(status);
507 goto bail_pool; 508 return nsds > 0;
508 } 509 }
509 510
510 aprFds[nactive].desc.s = aprSock; 511 aprFds[nactive].desc.s = aprSock;
511 aprFds[nactive].desc_type = APR_POLL_SOCKET; 512 aprFds[nactive].desc_type = APR_POLL_SOCKET;
512 aprFds[nactive].p = pool; 513 aprFds[nactive].p = pool.getAPRPool();
513 aprFds[nactive].rtnevents = 0; 514 aprFds[nactive].rtnevents = 0;
514 aprFds[nactive].client_data = &socks[i]; 515 aprFds[nactive].client_data = &socks[i];
515 516
@@ -537,10 +538,6 @@ bool LLAres::process(U64 timeout)
537 } 538 }
538 } 539 }
539 540
540bail_pool:
541 apr_pool_destroy(pool);
542
543bail:
544 return nsds > 0; 541 return nsds > 0;
545} 542}
546 543