diff options
author | latex <latex@disroot.org> | 2023-02-11 02:01:21 +0100 |
---|---|---|
committer | latex <latex@disroot.org> | 2023-02-11 02:01:21 +0100 |
commit | 82ca959ff701832e96c869161adc5e179c2201dd (patch) | |
tree | 3a819f5b26cfd3703a229eaf2ea187c3fa60a0ef /src/connection.c | |
parent | 79c59f93b7461082cf4aec3025257560fc788c69 (diff) | |
download | libumumble-82ca959ff701832e96c869161adc5e179c2201dd.tar.gz |
* restructed include/ to have a umumble folder * fix the makefile to use the new include structure * tests makefile now builds inside root build folder * added TODO list for shit I gotta do * laid groundwork for packet parsing/packing: mumble_packet_gen_header
Diffstat (limited to 'src/connection.c')
-rw-r--r-- | src/connection.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/connection.c b/src/connection.c index c484163..2c2bfbd 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1,10 +1,10 @@ #include <stdlib.h> #include <assert.h> +#include <string.h> -#include <libumumble.h> +#include <umumble/umumble.h> #include <tlsuv/tlsuv.h> #include <uv.h> -#include "Mumble.pb.h" void alloc_buffer(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf) { buf->base = malloc(suggested_size); @@ -37,10 +37,10 @@ void on_read_cb(uv_stream_t *client, ssize_t nread, const uv_buf_t *buf) if (nread < 0) { if (nread != UV_EOF) { ctx->error = nread; - ctx->status = DISCONNECTED; + ctx->status = MUMBLE_STATUS_DISCONNECTED; } tlsuv_stream_close((tlsuv_stream_t *) client, on_close_cb); - ctx->status = DISCONNECTED; + ctx->status = MUMBLE_STATUS_DISCONNECTED; free(buf->base); free(client); return; @@ -62,11 +62,11 @@ void on_connect_cb(uv_connect_t *req, int status) if (status < 0) { ctx->error = status; - ctx->status = DISCONNECTED; + ctx->status = MUMBLE_STATUS_DISCONNECTED; tlsuv_stream_close((tlsuv_stream_t *) req->handle, on_close_cb); return; } - ctx->status = CONNECTED; + ctx->status = MUMBLE_STATUS_CONNECTED; tlsuv_stream_read(tls_stream, alloc_buffer, on_read_cb); @@ -89,7 +89,7 @@ void on_resolve_cb(uv_getaddrinfo_t *resolver, int status, struct addrinfo *res) assert(status >= 0); if (status < 0) { ctx->error = status; - ctx->status = DISCONNECTED; + ctx->status = MUMBLE_STATUS_DISCONNECTED; return; } |