You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by dr...@apache.org on 2006/06/22 18:56:57 UTC

svn commit: r416420 - in /apr/apr-util/trunk: include/apr_ssl.h include/private/apr_ssl_private.h ssl/apr_ssl.c test/testssl.c

Author: dreid
Date: Thu Jun 22 09:56:57 2006
New Revision: 416420

URL: http://svn.apache.org/viewvc?rev=416420&view=rev
Log:
- add apr_ssl_library_name()

Do we also want to return a constant so that apps can easier
apply per-library logic if they wish? Might be overkill, might
not but probably fits with the aiims of making this as useful
as possible.

Modified:
    apr/apr-util/trunk/include/apr_ssl.h
    apr/apr-util/trunk/include/private/apr_ssl_private.h
    apr/apr-util/trunk/ssl/apr_ssl.c
    apr/apr-util/trunk/test/testssl.c

Modified: apr/apr-util/trunk/include/apr_ssl.h
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/include/apr_ssl.h?rev=416420&r1=416419&r2=416420&view=diff
==============================================================================
--- apr/apr-util/trunk/include/apr_ssl.h (original)
+++ apr/apr-util/trunk/include/apr_ssl.h Thu Jun 22 09:56:57 2006
@@ -72,6 +72,13 @@
                                                  const char *, 
                                                  apr_pool_t *);
 
+/**
+ * @fn const char * apr_ssl_library_name(void)
+ * @brief Return the name of the library or underlying SSL
+ *        implementation in use.
+ * @return NULL in case of no SSL support.
+ */
+APU_DECLARE(const char *) apr_ssl_library_name(void);
 
 /**
  * @fn apr_status_t apr_ssl_socket_create(apr_ssl_socket_t **newSock,
@@ -203,6 +210,7 @@
  * @param sock The socket to report the error for.
  */
 APU_DECLARE(apr_status_t) apr_ssl_socket_raw_error(apr_ssl_socket_t *);
+
 
 /** @} */
 #ifdef __cplusplus

Modified: apr/apr-util/trunk/include/private/apr_ssl_private.h
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/include/private/apr_ssl_private.h?rev=416420&r1=416419&r2=416420&view=diff
==============================================================================
--- apr/apr-util/trunk/include/private/apr_ssl_private.h (original)
+++ apr/apr-util/trunk/include/private/apr_ssl_private.h Thu Jun 22 09:56:57 2006
@@ -66,6 +66,13 @@
 apr_status_t apu_ssl_accept(apr_ssl_socket_t *, apr_ssl_socket_t *, apr_pool_t *);
 apr_status_t apu_ssl_raw_error(apr_ssl_socket_t *);
 
+/**
+ * Descriptive name for the library we are using for SSL
+ */
+#ifdef APU_HAVE_OPENSSL
+#define APU_SSL_LIBRARY   "openssl"
+#endif
+
 #ifdef __cplusplus
 }
 #endif

Modified: apr/apr-util/trunk/ssl/apr_ssl.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/ssl/apr_ssl.c?rev=416420&r1=416419&r2=416420&view=diff
==============================================================================
--- apr/apr-util/trunk/ssl/apr_ssl.c (original)
+++ apr/apr-util/trunk/ssl/apr_ssl.c Thu Jun 22 09:56:57 2006
@@ -67,6 +67,11 @@
     return APR_SUCCESS;
 }
 
+APU_DECLARE(const char *) apr_ssl_library_name(void)
+{
+    return APU_SSL_LIBRARY;
+}
+
 #else /* ! APU_HAVE_SSL */
 
 APU_DECLARE(apr_status_t) apr_ssl_factory_create(apr_ssl_factory_t **fact,
@@ -77,6 +82,11 @@
 
 {
     return APR_ENOTIMPL;
+}
+
+APU_DECLARE(const char *) apr_ssl_library_name(void)
+{
+    return NULL;
 }
 
 #endif /* APU_HAVE_SSL */

Modified: apr/apr-util/trunk/test/testssl.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/test/testssl.c?rev=416420&r1=416419&r2=416420&view=diff
==============================================================================
--- apr/apr-util/trunk/test/testssl.c (original)
+++ apr/apr-util/trunk/test/testssl.c Thu Jun 22 09:56:57 2006
@@ -52,12 +52,15 @@
     apr_ssl_factory_t *asf = NULL;
     apr_sockaddr_t *remoteSA;
     apr_status_t rv;
+    const char *libName;
 
 #ifdef APU_HAVE_SSL
 
     (void) apr_initialize();
     apr_pool_create(&pool, NULL);
     atexit(apr_terminate);
+
+    printf("SSL Library: %s\n", apr_ssl_library_name());
 
     if (apr_ssl_factory_create(&asf, NULL, NULL, NULL, pool) != APR_SUCCESS) {
         fprintf(stderr, "Unable to create client factory\n");



Re: svn commit: r416420 - in /apr/apr-util/trunk: include/apr_ssl.h include/private/apr_ssl_private.h ssl/apr_ssl.c test/testssl.c

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 6/22/06, dreid@apache.org <dr...@apache.org> wrote:

> +++ apr/apr-util/trunk/test/testssl.c Thu Jun 22 09:56:57 2006
> @@ -52,12 +52,15 @@
>      apr_ssl_factory_t *asf = NULL;
>      apr_sockaddr_t *remoteSA;
>      apr_status_t rv;
> +    const char *libName;
>
>  #ifdef APU_HAVE_SSL
>
>      (void) apr_initialize();
>      apr_pool_create(&pool, NULL);
>      atexit(apr_terminate);
> +
> +    printf("SSL Library: %s\n", apr_ssl_library_name());
>
>      if (apr_ssl_factory_create(&asf, NULL, NULL, NULL, pool) != APR_SUCCESS) {
>          fprintf(stderr, "Unable to create client factory\n");

I think that libName variable is a holdover from previous versions of
this code...

-garrett