Skip to content

Commit

Permalink
fix(include): added missing SSL error include
Browse files Browse the repository at this point in the history
  • Loading branch information
martinopresnik committed Jun 6, 2018
1 parent 85e53cc commit 1877b11
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "log.h"

#include "openssl/ssl.h"
#include "openssl/err.h"
#include "uv_ssl_t.h"

#define CONFIG_MAX_HOSTS 10
Expand Down
14 changes: 9 additions & 5 deletions src/bproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,23 +278,27 @@ void proxy_read_cb(uv_stream_t *handle, ssize_t nread, const uv_buf_t *buf)
void proxy_connect_cb(uv_connect_t *req, int status)
{
conn_t *conn = req->handle->data;
QUEUE *q;
free(req);

if (status < 0)
{
QUEUE_FOREACH(q, &conn->http_link_context.request.raw_requests)
{
buf_queue_t *bq = QUEUE_DATA(q, buf_queue_t, member);
free(bq->buf.base);
}
http_free_raw_requests_queue(&conn->http_link_context.request);
conn_close(conn);
return;
// TODO: write meaningful responses
}

uv_read_start((uv_stream_t *)conn->proxy_handle, alloc_cb, proxy_read_cb);
QUEUE *q;
QUEUE_FOREACH(q, &conn->http_link_context.request.raw_requests)
{
buf_queue_t *bq = QUEUE_DATA(q, buf_queue_t, member);
if (status >= 0)
{
write_buf((uv_stream_t *)conn->proxy_handle, bq->buf.base, bq->buf.len);
}
write_buf((uv_stream_t *)conn->proxy_handle, bq->buf.base, bq->buf.len);
free(bq->buf.base);
}
http_free_raw_requests_queue(&conn->http_link_context.request);
Expand Down

0 comments on commit 1877b11

Please sign in to comment.