Skip to content
This repository has been archived by the owner on Aug 10, 2022. It is now read-only.

Commit

Permalink
demo: use random string as Session-ID
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredh committed Aug 6, 2022
1 parent 023a32e commit f2f1178
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ struct session {
struct le le;
struct peer_connection *pc;
struct http_conn *conn_pending;
char *id;
char id[4];
};


static struct demo {
struct list sessl;
uint32_t session_counter;
const struct mnat *mnat;
const struct menc *menc;
} demo;
Expand All @@ -46,7 +45,6 @@ static void destructor(void *data)
list_unlink(&sess->le);
mem_deref(sess->conn_pending);
mem_deref(sess->pc);
mem_deref(sess->id);
}


Expand Down Expand Up @@ -207,7 +205,7 @@ static int session_new(struct session **sessp)
return ENOMEM;

/* generate a unique session id */
re_sdprintf(&sess->id, "%u", ++demo.session_counter);
rand_str(sess->id, sizeof(sess->id));

/* create a new session object, send SDP to it */
err = peerconnection_new(&sess->pc, &pc_config, demo.mnat, demo.menc,
Expand Down

0 comments on commit f2f1178

Please sign in to comment.