Browse Source

Some debugging.

master
Jeroen Vreeken 4 years ago
parent
commit
4ad3bb0c1c
3 changed files with 9 additions and 2 deletions
  1. +1
    -0
      dml_httpd.c
  2. +5
    -1
      dml_reflector.c
  3. +3
    -1
      dml_stream_client_simple.c

+ 1
- 0
dml_httpd.c View File

@ -331,6 +331,7 @@ int client_connection_close(struct dml_connection *dc, void *arg)
printf("Connection to DML server closed\n");
ws_client = ws_client_get_by_wsi(wsi);
ws_client->dml_closed = true;
ws_client->dc = NULL;
lws_callback_on_writable(wsi);


+ 5
- 1
dml_reflector.c View File

@ -69,9 +69,11 @@ static void stream_req_reverse_connect_cb(struct dml_host *host, struct dml_stre
bool do_connect = true;
bool do_reject = false;
printf("Received reverse connect request (status=%d)\n", status);
if (do_connect) {
struct dml_crypto_key *key = dml_stream_crypto_get(ds_rev);
if (dml_host_mime_filter(host, ds_rev) && key) {
printf("Respond with connect\n");
if(!dml_host_connect(host, ds_rev)) {
send_beep();
}
@ -82,6 +84,7 @@ static void stream_req_reverse_connect_cb(struct dml_host *host, struct dml_stre
do_reject = true;
}
if (do_reject) {
printf("Reject request (status=%d)\n", DML_STATUS_UNAUTHORIZED);
dml_packet_send_req_reverse(dml_host_connection_get(host),
dml_stream_id_get(ds_rev),
dml_stream_id_get(ds),
@ -91,8 +94,9 @@ static void stream_req_reverse_connect_cb(struct dml_host *host, struct dml_stre
static void stream_req_reverse_disconnect_cb(struct dml_host *host, struct dml_stream *ds, struct dml_stream *ds_rev, int status, void *arg)
{
printf("Disconnect request (status=%d)\n", status);
if (dml_stream_data_id_get(ds_rev)) {
printf("Disconnect\n");
printf("Disconnect stream\n");
dml_packet_send_req_disc(dml_host_connection_get(host), dml_stream_id_get(ds_rev));
}
}


+ 3
- 1
dml_stream_client_simple.c View File

@ -190,8 +190,10 @@ static int client_reconnect(void *arg)
if (dml_client_connect(dss->client)) {
printf("Reconnect to DML server failed\n");
dml_poll_timeout(dss, &(struct timespec){ 2, 0 });
} else {
printf("Reconnect to DML server successfull\n");
dml_poll_add(dss, NULL, NULL, keepalive_cb);
}
dml_poll_add(dss, NULL, NULL, keepalive_cb);
return 0;
}


Loading…
Cancel
Save