TFTP
move init of virtImage to init instead of init index
This commit is contained in:
@@ -244,9 +244,6 @@ void init_index(void) {
|
|||||||
str_cat(virt_file[0].data, len, '\n');
|
str_cat(virt_file[0].data, len, '\n');
|
||||||
root = root->next;
|
root = root->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
virt_file[2].data = malloc(100);
|
|
||||||
virt_file[2].len = 100;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct tftp_context tftpContext_s = {.open = tftp_open, .close = tftp_close, .read = tftp_read, .write = tftp_write};
|
struct tftp_context tftpContext_s = {.open = tftp_open, .close = tftp_close, .read = tftp_read, .write = tftp_write};
|
||||||
@@ -258,6 +255,9 @@ void tftp_server_init(void) {
|
|||||||
LOG_INFO(TAG, "Initializing tftp server");
|
LOG_INFO(TAG, "Initializing tftp server");
|
||||||
// init the index.txt virt_file
|
// init the index.txt virt_file
|
||||||
init_index();
|
init_index();
|
||||||
|
// init the virtImage.raw virt_file
|
||||||
|
virt_file[2].data = malloc(81920 * sizeof(char));
|
||||||
|
virt_file[2].len = 81920;
|
||||||
|
|
||||||
// Init the tftp server
|
// Init the tftp server
|
||||||
if (tftp_init(&tftpContext_s) != ERR_OK) {
|
if (tftp_init(&tftpContext_s) != ERR_OK) {
|
||||||
|
|||||||
Reference in New Issue
Block a user