Attention is currently required from: Timur Davydov, fixeria, laforge, neels, 
osmith.

Timur Davydov has posted comments on this change by Timur Davydov. ( 
https://gerrit.osmocom.org/c/libosmocore/+/41813?usp=email )

Change subject: Add Emscripten build support and JS callback logging backend
......................................................................


Patch Set 26:

(2 comments)

File src/core/logging_emscripten.c:

https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/83cbc39d_1d5cedc4?usp=email
 :
PS25, Line 47:  char subsys_buf[16];
> That's due to "struct gsmtap_osmocore_log_hdr" being "char subsys[16]" 
> because it's sent as fixed si […]
Thanks for the note. You’re right: the 16-byte limit comes from the GSMTAP 
on-wire header.

For the Emscripten logging path there is no such limitation: `on_log_wrapper()` 
receives pointers to NUL-terminated C strings, and on the JS/TS side we convert 
them using `AsciiToString()` (i.e. read until the terminating \0). So, keeping 
a separate `subsys_buf[16]` here is unnecessary “buffer-to-buffer” copying just 
to pass the subsystem name through.

I’ve updated the implementation accordingly to pass the subsystem name directly 
(falling back to an empty string when not available).


File src/core/logging_emscripten.c:

https://gerrit.osmocom.org/c/libosmocore/+/41813/comment/845c52af_a00924ab?usp=email
 :
PS26, Line 45:  const int msgLen = MAX_LOG_SIZE;
> Simply drop the variable and use MAX_LOG_SIZE directly, otherwise you are 
> simply duplicating stuff a […]
Sounds good, I’ve updated the code accordingly and now use MAX_LOG_SIZE 
directly, dropping the extra variable as suggested.



--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41813?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia8d5f4bb6570b5e055826f3a051e5e5896866e31
Gerrit-Change-Number: 41813
Gerrit-PatchSet: 26
Gerrit-Owner: Timur Davydov <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: neels <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-CC: laforge <[email protected]>
Gerrit-Attention: osmith <[email protected]>
Gerrit-Attention: neels <[email protected]>
Gerrit-Attention: laforge <[email protected]>
Gerrit-Attention: fixeria <[email protected]>
Gerrit-Attention: Timur Davydov <[email protected]>
Gerrit-Comment-Date: Wed, 04 Feb 2026 11:14:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <[email protected]>
Comment-In-Reply-To: Timur Davydov <[email protected]>

Reply via email to