mirror of
https://github.com/CPunch/Laika.git
synced 2025-09-27 04:10:08 +00:00
CNC: Fix possible out of bounds subscript for SHELL_* packets
- content events now pass the sLaika_peer struct
This commit is contained in:
@@ -26,9 +26,9 @@ typedef uint8_t CONTENT_TYPE;
|
||||
typedef uint8_t CONTENT_ERRCODE;
|
||||
typedef uint16_t CONTENT_ID;
|
||||
|
||||
typedef void (*contentRecvEvent)(struct sLaika_contentContext *context, struct sLaika_content *content);
|
||||
typedef bool (*contentNewEvent)(struct sLaika_contentContext *context, struct sLaika_content *content);
|
||||
typedef void (*contentErrorEvent)(struct sLaika_contentContext *context, struct sLaika_content *content, CONTENT_ERRCODE err);
|
||||
typedef void (*contentRecvEvent)(struct sLaika_peer *peer, struct sLaika_contentContext *context, struct sLaika_content *content);
|
||||
typedef bool (*contentNewEvent)(struct sLaika_peer *peer, struct sLaika_contentContext *context, struct sLaika_content *content);
|
||||
typedef void (*contentErrorEvent)(struct sLaika_peer *peer, struct sLaika_contentContext *context, struct sLaika_content *content, CONTENT_ERRCODE err);
|
||||
|
||||
struct sLaika_content {
|
||||
struct sLaika_content *next;
|
||||
@@ -53,6 +53,7 @@ void laikaF_cleanContext(struct sLaika_contentContext *context);
|
||||
|
||||
void laikaF_setupEvents(struct sLaika_contentContext *context, contentRecvEvent onRecv, contentNewEvent onNew, contentErrorEvent onError);
|
||||
|
||||
int laikaF_nextID(struct sLaika_peer *peer); /* returns the id that will be assigned to the next sent content */
|
||||
int laikaF_sendContent(struct sLaika_peer *peer, FILE *fd, CONTENT_TYPE type);
|
||||
|
||||
void laikaF_pollContent(struct sLaika_peer *peer);
|
||||
|
Reference in New Issue
Block a user