Skip to content

Commit

Permalink
http: Fix CSD https requests
Browse files Browse the repository at this point in the history
If request_body is NULL, buf_error(request_body) will return -ENOMEM to
indicate an allocation failure.  This is a good thing if we just called
buf_alloc(), but it is a bad thing if we aren't actually passing in a
request_body pointer.

The CSD GET requests pass in a NULL request_body and request_body_type:

    result = do_https_request(vpninfo, "GET", NULL, NULL, &form_buf, 0);

so this change is needed to restore proper CSD operation.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
  • Loading branch information
cernekee committed Jul 27, 2014
1 parent 15ecae6 commit df55953
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion http.c
Expand Up @@ -906,7 +906,7 @@ static int do_https_request(struct openconnect_info *vpninfo, const char *method
int rq_retry;
int rlen, pad;

if (buf_error(request_body))
if (request_body_type && buf_error(request_body))
return buf_error(request_body);

redirected:
Expand Down

0 comments on commit df55953

Please sign in to comment.