Skip to content

Commit

Permalink
Make --dump-http-traffic dump the CONNECT request too
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jan 25, 2015
1 parent 58a2bfe commit def2679
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cstp.c
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion http.c
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions openconnect-internal.h
Expand Up @@ -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, ...);
Expand Down

0 comments on commit def2679

Please sign in to comment.