mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
[svn] Announce the beginning and the end of the SSL handshake when in debug mode.
Avoid the use of the %p format.
This commit is contained in:
parent
c1ba8c2111
commit
2307fcc5c2
@ -1,3 +1,11 @@
|
|||||||
|
2005-05-14 Hrvoje Niksic <hniksic@xemacs.org>
|
||||||
|
|
||||||
|
* openssl.c (ssl_connect): Announce the beginning and the end of
|
||||||
|
the SSL handshake when in debug mode.
|
||||||
|
|
||||||
|
* wget.h (PTR_FORMAT): New macro for easier printing of pointer
|
||||||
|
values. Use %0*lx along with PTR_FORMAT instead of %p.
|
||||||
|
|
||||||
2005-05-14 Hrvoje Niksic <hniksic@xemacs.org>
|
2005-05-14 Hrvoje Niksic <hniksic@xemacs.org>
|
||||||
|
|
||||||
* http.c (gethttp): Would forget to close the connection when
|
* http.c (gethttp): Would forget to close the connection when
|
||||||
|
@ -311,10 +311,11 @@ void
|
|||||||
address_list_release (struct address_list *al)
|
address_list_release (struct address_list *al)
|
||||||
{
|
{
|
||||||
--al->refcount;
|
--al->refcount;
|
||||||
DEBUGP (("Releasing %p (new refcount %d).\n", al, al->refcount));
|
DEBUGP (("Releasing 0x%0*lx (new refcount %d).\n", PTR_FORMAT (al),
|
||||||
|
al->refcount));
|
||||||
if (al->refcount <= 0)
|
if (al->refcount <= 0)
|
||||||
{
|
{
|
||||||
DEBUGP (("Deleting unused %p.\n", al));
|
DEBUGP (("Deleting unused 0x%0*lx.\n", PTR_FORMAT (al)));
|
||||||
address_list_delete (al);
|
address_list_delete (al);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -321,6 +321,8 @@ ssl_connect (int fd)
|
|||||||
{
|
{
|
||||||
SSL *ssl;
|
SSL *ssl;
|
||||||
|
|
||||||
|
DEBUGP (("Initiating SSL handshake.\n"));
|
||||||
|
|
||||||
assert (ssl_ctx != NULL);
|
assert (ssl_ctx != NULL);
|
||||||
ssl = SSL_new (ssl_ctx);
|
ssl = SSL_new (ssl_ctx);
|
||||||
if (!ssl)
|
if (!ssl)
|
||||||
@ -335,11 +337,12 @@ ssl_connect (int fd)
|
|||||||
functions are used for reading, writing, and polling. */
|
functions are used for reading, writing, and polling. */
|
||||||
fd_register_transport (fd, openssl_read, openssl_write, openssl_poll,
|
fd_register_transport (fd, openssl_read, openssl_write, openssl_poll,
|
||||||
openssl_peek, openssl_close, ssl);
|
openssl_peek, openssl_close, ssl);
|
||||||
DEBUGP (("Connected %d to SSL 0x%0*lx\n", fd, 2 * sizeof (void *),
|
DEBUGP (("Handshake successful; connected socket %d to SSL handle 0x%0*lx\n",
|
||||||
(unsigned long) ssl));
|
fd, PTR_FORMAT (ssl)));
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
DEBUGP (("SSL handshake failed.\n"));
|
||||||
print_errors ();
|
print_errors ();
|
||||||
if (ssl)
|
if (ssl)
|
||||||
SSL_free (ssl);
|
SSL_free (ssl);
|
||||||
@ -478,6 +481,8 @@ ssl_check_certificate (int fd, const char *host)
|
|||||||
|
|
||||||
/* The certificate was found, verified, and matched HOST. */
|
/* The certificate was found, verified, and matched HOST. */
|
||||||
success = 1;
|
success = 1;
|
||||||
|
DEBUGP (("X509 certificate successfully verified and matches host %s\n",
|
||||||
|
escnonprint (host)));
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (cert)
|
if (cert)
|
||||||
|
@ -224,6 +224,12 @@ typedef off_t wgint;
|
|||||||
basevar = (type *)xrealloc (basevar, DR_newsize * sizeof (type)); \
|
basevar = (type *)xrealloc (basevar, DR_newsize * sizeof (type)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
/* Used to print pointers (usually for debugging). Print pointers
|
||||||
|
using printf ("%0*lx", PTR_FORMAT (p)). (%p is too unpredictable;
|
||||||
|
some implementations prepend 0x, while some don't, and most don't
|
||||||
|
0-pad the address.) */
|
||||||
|
#define PTR_FORMAT(p) 2 * sizeof (void *), (unsigned long) (p)
|
||||||
|
|
||||||
extern const char *exec_name;
|
extern const char *exec_name;
|
||||||
|
|
||||||
/* Document type ("dt") flags */
|
/* Document type ("dt") flags */
|
||||||
|
@ -304,8 +304,7 @@ print_malloc_debug_stats (void)
|
|||||||
malloc_count, free_count, malloc_count - free_count);
|
malloc_count, free_count, malloc_count - free_count);
|
||||||
for (i = 0; i < SZ; i++)
|
for (i = 0; i < SZ; i++)
|
||||||
if (malloc_table[i].ptr != NULL)
|
if (malloc_table[i].ptr != NULL)
|
||||||
printf ("0x%0*lx: %s:%d\n", 2 * sizeof (void *),
|
printf ("0x%0*lx: %s:%d\n", PTR_FORMAT (malloc_table[i].ptr),
|
||||||
(long) malloc_table[i].ptr,
|
|
||||||
malloc_table[i].file, malloc_table[i].line);
|
malloc_table[i].file, malloc_table[i].line);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -368,8 +367,7 @@ debugging_free (void *ptr, const char *source_file, int source_line)
|
|||||||
if (!unregister_ptr (ptr))
|
if (!unregister_ptr (ptr))
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s: bad xfree(%0*lx) at %s:%d\n",
|
fprintf (stderr, "%s: bad xfree(%0*lx) at %s:%d\n",
|
||||||
exec_name, 2 * sizeof (void *), (long) ptr,
|
exec_name, PTR_FORMAT (ptr), source_file, source_line);
|
||||||
source_file, source_line);
|
|
||||||
abort ();
|
abort ();
|
||||||
}
|
}
|
||||||
++free_count;
|
++free_count;
|
||||||
|
Loading…
Reference in New Issue
Block a user