1
0
mirror of https://github.com/CPunch/Laika.git synced 2025-10-01 22:10:05 +00:00

lsocket.[ch] & lpeer.c: migrated to new vector API

This commit is contained in:
2022-09-01 19:05:56 -05:00
parent af09e74263
commit 13398dbdf6
4 changed files with 50 additions and 53 deletions

View File

@@ -3,8 +3,8 @@
#include "hashmap.h"
#include "laika.h"
#include "lsocket.h"
#include "lmem.h"
#include "lsocket.h"
#include <stdbool.h>
@@ -21,7 +21,8 @@ struct sLaika_pollEvent
struct sLaika_pollList
{
struct hashmap *sockets;
laikaM_newVector(struct sLaika_socket *, outQueue); /* holds sockets which have data needed to be sent */
/* holds sockets which have data needed to be sent */
laikaM_newVector(struct sLaika_socket *, outQueue);
laikaM_newVector(struct sLaika_pollEvent, revents);
#ifdef LAIKA_USE_EPOLL
/* epoll */

View File

@@ -55,6 +55,7 @@ typedef void buffer_t;
#endif
#include "laika.h"
#include "lsodium.h"
#include "lmem.h"
#include <fcntl.h>
#include <stdbool.h>
@@ -79,12 +80,8 @@ struct sLaika_socket
pollEvent onPollIn;
pollEvent onPollOut;
void *uData; /* passed to onPollFail */
uint8_t *outBuf; /* raw data to be sent() */
uint8_t *inBuf; /* raw data we recv()'d */
int outCount;
int inCount;
int outCap;
int inCap;
laikaM_newVector(uint8_t, outBuf); /* raw data to be sent() */
laikaM_newVector(uint8_t, inBuf); /* raw data we recv()'d */
bool flipEndian;
bool setPollOut; /* is EPOLLOUT/POLLOUT is set on sock's pollfd ? */
};