From def2679a84ea887893c038e9d58dbfc7d66e7c0f Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Sun, 25 Jan 2015 16:59:05 +0000 Subject: [PATCH] Make --dump-http-traffic dump the CONNECT request too Signed-off-by: David Woodhouse --- cstp.c | 4 ++++ http.c | 2 +- openconnect-internal.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cstp.c b/cstp.c index 45fe007e..a6af5449 100644 --- a/cstp.c +++ b/cstp.c @@ -243,6 +243,10 @@ static int start_cstp_connection(struct openconnect_info *vpninfo) _("Error creating HTTPS CONNECT request\n")); return buf_free(reqbuf); } + + if (vpninfo->dump_http_traffic) + dump_buf(vpninfo, '>', reqbuf->data); + vpninfo->ssl_write(vpninfo, reqbuf->data, reqbuf->pos); buf_free(reqbuf); diff --git a/http.c b/http.c index d1b51743..62053dad 100644 --- a/http.c +++ b/http.c @@ -1021,7 +1021,7 @@ static int handle_redirect(struct openconnect_info *vpninfo) } } -static void dump_buf(struct openconnect_info *vpninfo, char prefix, char *buf) +void dump_buf(struct openconnect_info *vpninfo, char prefix, char *buf) { while (*buf) { char *eol = buf; diff --git a/openconnect-internal.h b/openconnect-internal.h index ccc55f0f..835bd6f0 100644 --- a/openconnect-internal.h +++ b/openconnect-internal.h @@ -762,6 +762,7 @@ int xmlpost_initial_req(struct openconnect_info *vpninfo, /* http.c */ struct oc_text_buf *buf_alloc(void); +void dump_buf(struct openconnect_info *vpninfo, char prefix, char *buf); int buf_ensure_space(struct oc_text_buf *buf, int len); void __attribute__ ((format (printf, 2, 3))) buf_append(struct oc_text_buf *buf, const char *fmt, ...);