Skip to content
Snippets Groups Projects
Commit bdb242aa authored by huitema's avatar huitema
Browse files

Making sure that the ticket store works properly in Ubuntu.

parent 093832ae
Branches
No related merge requests found
......@@ -3,6 +3,8 @@ CMAKE_POLICY(SET CMP0003 NEW)
PROJECT(picoquic)
SET(CMAKE_C STANDARD 11)
# FIND_PACKAGE(PkgConfig REQUIRED)
SET(CMAKE_C_FLAGS "-std=c99 -Wall -O2 -g ${CC_WARNING_FLAGS} ${CMAKE_C_FLAGS}")
......
......@@ -19,6 +19,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stddef.h>
#include <string.h>
#include <stdlib.h>
#include "picoquic_internal.h"
int picoquic_store_ticket(picoquic_stored_ticket_t ** pp_first_ticket,
......@@ -81,7 +84,7 @@ int picoquic_store_ticket(picoquic_stored_ticket_t ** pp_first_ticket,
next_p += alpn_length;
*next_p++ = 0;
stored->ticket = next_p;
stored->ticket = (uint8_t *)next_p;
stored->ticket_length = ticket_length;
memcpy(next_p, ticket, ticket_length);
......@@ -191,8 +194,6 @@ int picoquic_load_tickets(picoquic_stored_ticket_t ** pp_first_ticket,
picoquic_stored_ticket_t * next;
uint32_t record_size;
uint32_t storage_size;
size_t size_read = 0;
size_t size_blob = 0;
#ifdef _WINDOWS
errno_t err = fopen_s(&F, ticket_file_name, "rb");
......@@ -274,4 +275,4 @@ void picoquic_free_tickets(picoquic_stored_ticket_t ** pp_first_ticket)
free(next);
}
}
\ No newline at end of file
}
......@@ -19,6 +19,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <string.h>
#include <stdlib.h>
#include "../picoquic/picoquic_internal.h"
......@@ -104,7 +105,6 @@ int ticket_store_test()
uint64_t current_time = 50000000000ull;
uint64_t retrieve_time = 60000000000ull;
uint64_t too_late_time = 150000000000ull;
uint64_t create_time = 10000000ull;
uint32_t ttl = 100000;
uint8_t ticket[128];
......@@ -186,4 +186,4 @@ int ticket_store_test()
picoquic_free_tickets(&p_first_ticket_ter);
return ret;
}
\ No newline at end of file
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment