Channel circle › core 9 Server › bmlserver
bmlserver (core 9, sub 11, flat id 155)
74 functions
| Signature | Purpose | Source | Scope |
|---|---|---|---|
| int BMLPageV21Valid(const uint8_t *doc, size_t len) | (no comment) | BMLPageV21.c:12 | public |
| struct BMLServerChannel * BMLServerChannelGet(void) | (no comment) | BMLServerChannel.c:19 | public |
| static void BsW32(uint8_t *p, uint32_t v) | (no comment) | BMLServerChannel.c:21 | static |
| 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:25 | static |
| static int BsEnds(const char *s, size_t n, const char *suf) | (no comment) | BMLServerChannel.c:31 | static |
| struct BMLServerStats * BMLServerStatsGet(void) | (no comment) | BMLServerChannel.c:37 | public |
| uint32_t BMLServerCacheFlush(uint32_t *bytes) | (no comment) | BMLServerChannel.c:39 | public |
| uint8_t BMLServeCtype(const char *p, size_t n) | (no comment) | BMLServerChannel.c:49 | public |
| static uint8_t BsCtAcc(uint8_t ct) | (no comment) | BMLServerChannel.c:62 | static |
| 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:70 | static |
| 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:121 | public |
| 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 B | BMLServerChannel.c:137 | public |
| 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:160 | public |
| struct BMLServerChannel * OpenBMLServerChannel(void) | (no comment) | BMLServerChannel.c:196 | public |
| void CloseBMLServerChannel(struct BMLServerChannel *ch) | (no comment) | BMLServerChannel.c:215 | public |
| int BMLServerSetRoot(const char *docroot) | (no comment) | BMLServerChannel.c:227 | public |
| static int BmlsrvOp(struct BMLServerChannel *ch, uint32_t op, uint32_t a, uint64_t b) | (no comment) | BMLServerChannel.c:244 | static |
| static void BmlsrvRd(struct BMLServerChannel *ch, uint32_t *m, uint32_t *a, uint64_t *b) | (no comment) | BMLServerChannel.c:266 | static |
| static int BsRec(uint32_t op, uint32_t a, uint64_t b) | (no comment) | BMLServerChannel.c:274 | static |
| int BMLServerStart(uint16_t port, int any) | (no comment) | BMLServerChannel.c:281 | public |
| int BMLServerStep(uint32_t timeout_ms) | (no comment) | BMLServerChannel.c:282 | public |
| uint16_t BMLServerPort(void) | (no comment) | BMLServerChannel.c:289 | public |
| int BmsSrvAttach(struct BMLServerChannel *ch) | (no comment) | BMLServerChannel.c:300 | public |
| void BmsSrvDetach(struct BMLServerChannel *ch) | (no comment) | BMLServerChannel.c:310 | public |
| struct BMLServerLoop * BMLServerLoopGet(void) | (no comment) | BMLServerChannel.c:345 | public |
| void BMLServerStopRun(void) | (no comment) | BMLServerChannel.c:346 | public |
| static uint64_t BmsNowMs(void) | clock for idle timeouts / RUN_MS (not a socket call) | BMLServerChannel.c:355 | static |
| static void BmsConnFree(struct BMLServerConn *c) | (no comment) | BMLServerChannel.c:369 | static |
| 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:377 | static |
| 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 r | BMLServerChannel.c:388 | static |
| 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 BMLServeWantBml | BMLServerChannel.c:398 | static |
| static int BmsBmlwCheck(const uint8_t *doc, size_t n) | 422 hook: .bmlw over HTTP validates exactly like WANT_BML (BsValidate) | BMLServerChannel.c:405 | static |
| static int BmsCiHas(const char *h, size_t n, const char *needle) | (no comment) | BMLServerChannel.c:407 | static |
| 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 drop | BMLServerChannel.c:417 | static |
| 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 drop | BMLServerChannel.c:450 | static |
| 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:479 | public |
| static int BmsWaitFds(const int64_t *fd, const uint8_t *want, uint8_t *ready, uint32_t n, int timeout_ms) | (no comment) | BMLServerChannel.c:510 | static |
| 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 = error | BMLServerChannel.c:554 | public |
| void BMLServerLoopClose(struct BMLServerLoop *L) | (no comment) | BMLServerChannel.c:630 | public |
| int BMLServerRun(uint16_t port, int any, int http, int64_t max_ms) | (no comment) | BMLServerChannel.c:638 | public |
| int main(int argc, char **argv) | (no comment) | BMLServerChannel.c:654 | public |
| unsigned BMLHttpAcceptMask(const char *acc) | (no comment) | BMLServerHTTP.c:23 | public |
| int BMLHttpWantsBml(const char *acc) | (no comment) | BMLServerHTTP.c:36 | public |
| static int BhHex(int c) | (no comment) | BMLServerHTTP.c:44 | static |
| uint32_t BMLHttpParseINM(const char *v, int *ok) | (no comment) | BMLServerHTTP.c:52 | public |
| int BMLHttpRedirect(const char *method, const char *query, char *loc, size_t cap) | (no comment) | BMLServerHTTP.c:67 | public |
| int BMLHttpResolve(const char *prefix, const char *target, char *out, size_t cap) | (no comment) | BMLServerHTTP.c:84 | public |
| const char * BMLHttpCtype(const char *p) | (no comment) | BMLServerHTTP.c:115 | public |
| void BMLHttpRespFree(struct BMLHttpResp *rs) | (no comment) | BMLServerHTTP.c:134 | public |
| static int BhLoad(const char *file, struct BMLHttpResp *rs) | (no comment) | BMLServerHTTP.c:136 | static |
| int BMLHttpHandle(const struct BMLHttpCfg *cfg, const struct BMLHttpReq *rq, struct BMLHttpResp *rs) | (no comment) | BMLServerHTTP.c:153 | public |
| static const char * BhReason(int s) | (no comment) | BMLServerHTTP.c:204 | static |
| size_t BMLHttpFormat(const struct BMLHttpResp *rs, char *out, size_t cap) | (no comment) | BMLServerHTTP.c:213 | public |
| static const char * BhHdr(const char *raw, size_t n, const char *name, char *buf, size_t cap) | (no comment) | BMLServerHTTP.c:250 | static |
| 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:270 | static |
| 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:286 | public |
| size_t BMLHttpHandleRaw(const struct BMLHttpCfg *cfg, const char *raw, size_t n, uint8_t **out, int *status) | (no comment) | BMLServerHTTP.c:307 | public |
| struct MemoryChannel * OpenMemoryChannel(void) | (no comment) | BMLStandaloneRt.c:22 | public |
| void * AllocMem(uint64_t n, ...) | (no comment) | BMLStandaloneRt.c:23 | public |
| void FreeMem(void *p) | (no comment) | BMLStandaloneRt.c:24 | public |
| int ThreadLockInit(struct HyperLock *h, const char *n) | (no comment) | BMLStandaloneRt.c:25 | public |
| void ThreadLockFree(struct HyperLock *h) | (no comment) | BMLStandaloneRt.c:26 | public |
| void ThreadLock(struct HyperLock *h) | (no comment) | BMLStandaloneRt.c:27 | public |
| void ThreadUnlock(struct HyperLock *h) | (no comment) | BMLStandaloneRt.c:28 | public |
| void SDL_Delay(uint32_t ms) | (no comment) | BMLStandaloneRt.c:29 | public |
| uint64_t SDL_GetCurrentThreadID(void) | (no comment) | BMLStandaloneRt.c:37 | public |
| struct ServerChannel * ServerChannelGet(void) | (no comment) | BMLStandaloneRt.c:50 | public |
| static int RqRecv(uint32_t h, uint8_t *b, size_t n) | (no comment) | bmlrq_fetch.c:8 | static |
| static int RqDrain(uint32_t h, size_t n) | (no comment) | bmlrq_fetch.c:14 | static |
| uint32_t BMLReqConnect(const char *host, uint16_t port) | (no comment) | bmlrq_fetch.c:16 | public |
| 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:26 | static |
| int64_t BMLReqFetchOn(uint32_t c, const struct BmlReq *q, uint8_t *out, size_t cap, uint32_t *sent) | (no comment) | bmlrq_fetch.c:43 | public |
| 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:54 | public |
| 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:65 | public |