MultiverseSocial.com

Channel circle › core 9 Server › bmlserver

bmlserver (core 9, sub 11, flat id 155)

74 functions
SignaturePurposeSourceScope
int BMLPageV21Valid(const uint8_t *doc, size_t len)(no comment)BMLPageV21.c:12public
struct BMLServerChannel * BMLServerChannelGet(void)(no comment)BMLServerChannel.c:19public
static void BsW32(uint8_t *p, uint32_t v)(no comment)BMLServerChannel.c:21static
static int BsValidate(const uint8_t *doc, size_t n)merge4f: page validator. BML v2.1 (channels7 bml, what BlitzBrowse decodes) -> BMLPageV21Valid; anything else (BMLW) -> BMLChannelValidate. 0 = valid.BMLServerChannel.c:25static
static int BsEnds(const char *s, size_t n, const char *suf)(no comment)BMLServerChannel.c:31static
struct BMLServerStats * BMLServerStatsGet(void)(no comment)BMLServerChannel.c:37public
uint32_t BMLServerCacheFlush(uint32_t *bytes)(no comment)BMLServerChannel.c:39public
uint8_t BMLServeCtype(const char *p, size_t n)(no comment)BMLServerChannel.c:49public
static uint8_t BsCtAcc(uint8_t ct)(no comment)BMLServerChannel.c:62static
static int BsLoad(const char *root, const char *path, int page, uint8_t *dst, size_t cap, size_t *len, uint32_t *val, int *bad)ROOT/path -> dst (cap). Cache hit when path + mtime + size + inode match. page: BsValidate once (bad -> *bad). 0 ok, 1 not found / unreadable / too large.BMLServerChannel.c:70static
int BMLServeWantBml(const char *root, const uint8_t *payload, uint32_t n, uint8_t *doc, size_t cap, size_t *len, struct BmlReq *q)BMLServeWantBml -- one WANT_BML request, transport-free (merge point for any loop: select, keep-alive, ...). payload/n: frame payload after the 4-byte header (packed v1 or legacy '/path'). Reads ROOT/path into doc[0..cap).BMLServerChannel.c:121public
int BMLServeResource(const char *root, const uint8_t *pl, uint32_t n, uint8_t *out, size_t cap, size_t *len, uint8_t *ct, uint32_t *val)BMLServeResource -- one resource request (kind 2), transport-free. out gets the bytes; *ct BMLRQ_CT_*, *val FNV-1a 32. 0 ok, 1 not found, 2 bad request, 4 not modified, 5 type not accepted. No HTTP: images and other sub-resources ride the BBMLServerChannel.c:137public
int BMLServeFrame(const char *root, const uint8_t *pl, uint32_t n, uint8_t *frame, size_t cap, size_t *flen, struct BmlReq *q, int *keep)BMLServeFrame -- the one call a loop needs: request payload -> complete reply frame (header included) in frame[0..*flen). Page (packed v1 / legacy) -> BODY 0x06 | resource (kind 2) -> RES 0x0D | ERROR 0x0B code. Counters + stats updated.BMLServerChannel.c:160public
struct BMLServerChannel * OpenBMLServerChannel(void)(no comment)BMLServerChannel.c:196public
void CloseBMLServerChannel(struct BMLServerChannel *ch)(no comment)BMLServerChannel.c:215public
int BMLServerSetRoot(const char *docroot)(no comment)BMLServerChannel.c:227public
static int BmlsrvOp(struct BMLServerChannel *ch, uint32_t op, uint32_t a, uint64_t b)(no comment)BMLServerChannel.c:244static
static void BmlsrvRd(struct BMLServerChannel *ch, uint32_t *m, uint32_t *a, uint64_t *b)(no comment)BMLServerChannel.c:266static
static int BsRec(uint32_t op, uint32_t a, uint64_t b)(no comment)BMLServerChannel.c:274static
int BMLServerStart(uint16_t port, int any)(no comment)BMLServerChannel.c:281public
int BMLServerStep(uint32_t timeout_ms)(no comment)BMLServerChannel.c:282public
uint16_t BMLServerPort(void)(no comment)BMLServerChannel.c:289public
int BmsSrvAttach(struct BMLServerChannel *ch)(no comment)BMLServerChannel.c:300public
void BmsSrvDetach(struct BMLServerChannel *ch)(no comment)BMLServerChannel.c:310public
struct BMLServerLoop * BMLServerLoopGet(void)(no comment)BMLServerChannel.c:345public
void BMLServerStopRun(void)(no comment)BMLServerChannel.c:346public
static uint64_t BmsNowMs(void)clock for idle timeouts / RUN_MS (not a socket call)BMLServerChannel.c:355static
static void BmsConnFree(struct BMLServerConn *c)(no comment)BMLServerChannel.c:369static
static int BmsSend(struct BMLServerConn *c, const uint8_t *p, size_t n)No idle stamp in BmsSend: it runs only from BmsProcess in a pass that just read (last_ms = t) or flushed (last_ms = now in BmsFlush), so the idle clock is already fresh for this pass.BMLServerChannel.c:377static
static int BmsFlush(struct BMLServerConn *c, uint64_t now)write-side idle (merge4c): send progress refreshes last_ms with the pass clock already read (merge4e: the pass's one reading t), so a reply that took longer than the idle limit to drain is not reaped the moment it finishes. No extra clock rBMLServerChannel.c:388static
static int BmsErr2(struct BMLServerChannel *ch, struct BMLServerConn *c)hardcoded ERROR 2 ([team]'s exact bytes; same frame bs_err builds) for frames rejected before BMLServeWantBmlBMLServerChannel.c:398static
static int BmsBmlwCheck(const uint8_t *doc, size_t n)422 hook: .bmlw over HTTP validates exactly like WANT_BML (BsValidate)BMLServerChannel.c:405static
static int BmsCiHas(const char *h, size_t n, const char *needle)(no comment)BMLServerChannel.c:407static
static int BmsHTTPOne(struct BMLServerChannel *ch, struct BMLServerLoop *L, struct BMLServerConn *c)one HTTP request: framing + keep-alive here, everything else in [team]'s BMLHttpHandleRaw. 1 wait, 0 done, -1 dropBMLServerChannel.c:417static
static int BmsProcess(struct BMLServerChannel *ch, struct BMLServerLoop *L, struct BMLServerConn *c)consume whole frames in c->in, strictly in request order. 0 ok, -1 dropBMLServerChannel.c:450static
struct BMLServerLoop * BMLServerLoopOpen(uint16_t port, int any, int http)[team]'s proposal #2 (ANSWERS_[team].md): one select pass = BMLServerLoopStep; Run = Open + Step loop + Close. Pod/ChRec wiring of BMLSRV_W_STEP onto LoopStep is NOT done here (see MERGE_[team].md, remaining).BMLServerChannel.c:479public
static int BmsWaitFds(const int64_t *fd, const uint8_t *want, uint8_t *ready, uint32_t n, int timeout_ms)(no comment)BMLServerChannel.c:510static
int BMLServerLoopStep(struct BMLServerLoop *L, uint32_t max_ms)exactly one wait-set pass (NetXecStreamWaitSet): accept all, read, process, flush, reap. 1 = some fd was ready, 0 = timeout, -1 = errorBMLServerChannel.c:554public
void BMLServerLoopClose(struct BMLServerLoop *L)(no comment)BMLServerChannel.c:630public
int BMLServerRun(uint16_t port, int any, int http, int64_t max_ms)(no comment)BMLServerChannel.c:638public
int main(int argc, char **argv)(no comment)BMLServerChannel.c:654public
unsigned BMLHttpAcceptMask(const char *acc)(no comment)BMLServerHTTP.c:23public
int BMLHttpWantsBml(const char *acc)(no comment)BMLServerHTTP.c:36public
static int BhHex(int c)(no comment)BMLServerHTTP.c:44static
uint32_t BMLHttpParseINM(const char *v, int *ok)(no comment)BMLServerHTTP.c:52public
int BMLHttpRedirect(const char *method, const char *query, char *loc, size_t cap)(no comment)BMLServerHTTP.c:67public
int BMLHttpResolve(const char *prefix, const char *target, char *out, size_t cap)(no comment)BMLServerHTTP.c:84public
const char * BMLHttpCtype(const char *p)(no comment)BMLServerHTTP.c:115public
void BMLHttpRespFree(struct BMLHttpResp *rs)(no comment)BMLServerHTTP.c:134public
static int BhLoad(const char *file, struct BMLHttpResp *rs)(no comment)BMLServerHTTP.c:136static
int BMLHttpHandle(const struct BMLHttpCfg *cfg, const struct BMLHttpReq *rq, struct BMLHttpResp *rs)(no comment)BMLServerHTTP.c:153public
static const char * BhReason(int s)(no comment)BMLServerHTTP.c:204static
size_t BMLHttpFormat(const struct BMLHttpResp *rs, char *out, size_t cap)(no comment)BMLServerHTTP.c:213public
static const char * BhHdr(const char *raw, size_t n, const char *name, char *buf, size_t cap)(no comment)BMLServerHTTP.c:250static
static void BhParse(const struct BMLHttpCfg *cfg, const char *raw, size_t n, struct BMLHttpResp *rs, char *method, char *target, char *acc, size_t accn, char *inm, size_t inmn)(no comment)BMLServerHTTP.c:270static
size_t BMLHttpHandleInto(const struct BMLHttpCfg *cfg, const char *raw, size_t n, int keep, uint8_t *out, size_t cap, size_t *off, int *status)(no comment)BMLServerHTTP.c:286public
size_t BMLHttpHandleRaw(const struct BMLHttpCfg *cfg, const char *raw, size_t n, uint8_t **out, int *status)(no comment)BMLServerHTTP.c:307public
struct MemoryChannel * OpenMemoryChannel(void)(no comment)BMLStandaloneRt.c:22public
void * AllocMem(uint64_t n, ...)(no comment)BMLStandaloneRt.c:23public
void FreeMem(void *p)(no comment)BMLStandaloneRt.c:24public
int ThreadLockInit(struct HyperLock *h, const char *n)(no comment)BMLStandaloneRt.c:25public
void ThreadLockFree(struct HyperLock *h)(no comment)BMLStandaloneRt.c:26public
void ThreadLock(struct HyperLock *h)(no comment)BMLStandaloneRt.c:27public
void ThreadUnlock(struct HyperLock *h)(no comment)BMLStandaloneRt.c:28public
void SDL_Delay(uint32_t ms)(no comment)BMLStandaloneRt.c:29public
uint64_t SDL_GetCurrentThreadID(void)(no comment)BMLStandaloneRt.c:37public
struct ServerChannel * ServerChannelGet(void)(no comment)BMLStandaloneRt.c:50public
static int RqRecv(uint32_t h, uint8_t *b, size_t n)(no comment)bmlrq_fetch.c:8static
static int RqDrain(uint32_t h, size_t n)(no comment)bmlrq_fetch.c:14static
uint32_t BMLReqConnect(const char *host, uint16_t port)(no comment)bmlrq_fetch.c:16public
static int64_t RqReply(uint32_t c, uint8_t *out, size_t cap, uint8_t *ct, uint32_t *val)reads one reply frame; RES payload split into ct + validator + bytes. Returns bytes, -1 transport, -(100+code).bmlrq_fetch.c:26static
int64_t BMLReqFetchOn(uint32_t c, const struct BmlReq *q, uint8_t *out, size_t cap, uint32_t *sent)(no comment)bmlrq_fetch.c:43public
int64_t BMLResFetchOn(uint32_t c, const char *path, uint8_t accept, int has_val, uint32_t val, uint8_t *out, size_t cap, uint8_t *ct, uint32_t *val_out, uint32_t *sent)(no comment)bmlrq_fetch.c:54public
int64_t BMLReqFetch(const char *host, uint16_t port, const struct BmlReq *q, uint8_t *out, size_t cap, uint32_t *sent)(no comment)bmlrq_fetch.c:65public

Core-level functions of core 9 · Core 9 in the full manual

The > Web 4 < Channel Paradigm · full manual · privacy · contact

Hits--