diff -r 07b815faa6ac -r f00d03835dd9 src/server/daemon/protocol.c --- a/src/server/daemon/protocol.c Tue Dec 30 21:44:49 2025 +0100 +++ b/src/server/daemon/protocol.c Tue Jan 13 18:09:20 2026 +0100 @@ -73,161 +73,161 @@ switch (code) { case PROTOCOL_CONTINUE : // 100 - r = CX_STR("Continue"); + r = cx_str("Continue"); break; case PROTOCOL_SWITCHING: //101 - r = CX_STR("Switching Protocols"); + r = cx_str("Switching Protocols"); break; case PROTOCOL_OK: // 200 - r = CX_STR("OK"); + r = cx_str("OK"); break; case PROTOCOL_CREATED: // 201 - r = CX_STR("Created"); + r = cx_str("Created"); break; case PROTOCOL_ACCEPTED: // 202 - r = CX_STR("Accepted"); + r = cx_str("Accepted"); break; case PROTOCOL_NONAUTHORITATIVE: // 203 - r = CX_STR("Non-Authoritative Information"); + r = cx_str("Non-Authoritative Information"); break; case PROTOCOL_NO_CONTENT: //204 /* There is another define to PROTOCOL_NO_RESPONSE for 204 in nsapi.h The spec maps this to No Content. Hence cahnging this to No Content */ - r = CX_STR("No Content"); + r = cx_str("No Content"); break; case PROTOCOL_RESET_CONTENT: // 205 - r = CX_STR("Reset Content"); + r = cx_str("Reset Content"); break; case PROTOCOL_PARTIAL_CONTENT: // 206 - r = CX_STR("Partial Content"); + r = cx_str("Partial Content"); break; case PROTOCOL_MULTI_STATUS: // 207 - r = CX_STR("Multi Status"); + r = cx_str("Multi Status"); break; case PROTOCOL_MULTIPLE_CHOICES: // 300 - r = CX_STR("Multiple Choices"); + r = cx_str("Multiple Choices"); break; case PROTOCOL_MOVED_PERMANENTLY: // 301 - r = CX_STR("Moved Permanently"); + r = cx_str("Moved Permanently"); break; case PROTOCOL_REDIRECT: // 302 - r = CX_STR("Moved Temporarily"); /* The spec actually says "Found" */ + r = cx_str("Moved Temporarily"); /* The spec actually says "Found" */ break; case PROTOCOL_SEE_OTHER: // 303 - r = CX_STR("See Other"); + r = cx_str("See Other"); break; case PROTOCOL_NOT_MODIFIED: // 304 - r = CX_STR("Use local copy"); /* The spec actually says "Not Modified" */ + r = cx_str("Use local copy"); /* The spec actually says "Not Modified" */ break; case PROTOCOL_USE_PROXY: // 305 - r = CX_STR("Use Proxy"); + r = cx_str("Use Proxy"); break; case PROTOCOL_TEMPORARY_REDIRECT: // 307 - r = CX_STR("Temporary Redirect"); + r = cx_str("Temporary Redirect"); break; case PROTOCOL_BAD_REQUEST: // 400 - r = CX_STR("Bad request"); + r = cx_str("Bad request"); break; case PROTOCOL_UNAUTHORIZED: // 401 - r = CX_STR("Unauthorized"); + r = cx_str("Unauthorized"); break; case PROTOCOL_PAYMENT_REQUIRED: // 402 - r = CX_STR("Payment Required"); + r = cx_str("Payment Required"); break; case PROTOCOL_FORBIDDEN: // 403 - r = CX_STR("Forbidden"); + r = cx_str("Forbidden"); break; case PROTOCOL_NOT_FOUND: // 404 - r = CX_STR("Not found"); + r = cx_str("Not found"); break; case PROTOCOL_METHOD_NOT_ALLOWED: // 405 /* HTTP/1.1 */ - r = CX_STR("Method Not Allowed"); + r = cx_str("Method Not Allowed"); break; case PROTOCOL_NOT_ACCEPTABLE: // 406 /* HTTP/1.1 */ - r = CX_STR("Not Acceptable"); + r = cx_str("Not Acceptable"); break; case PROTOCOL_PROXY_UNAUTHORIZED: // 407 - r = CX_STR("Proxy Authentication Required"); + r = cx_str("Proxy Authentication Required"); break; case PROTOCOL_REQUEST_TIMEOUT: // 408 /* HTTP/1.1 */ - r = CX_STR("Request Timeout"); + r = cx_str("Request Timeout"); break; case PROTOCOL_CONFLICT: // 409 - r = CX_STR("Conflict"); /* HTTP/1.1 */ + r = cx_str("Conflict"); /* HTTP/1.1 */ break; case PROTOCOL_GONE: // 410 - r = CX_STR("Gone"); /* HTTP/1.1 */ + r = cx_str("Gone"); /* HTTP/1.1 */ break; case PROTOCOL_LENGTH_REQUIRED: // 411 /* HTTP/1.1 */ - r = CX_STR("Length Required"); + r = cx_str("Length Required"); break; case PROTOCOL_PRECONDITION_FAIL: // 412 /* HTTP/1.1 */ - r = CX_STR("Precondition Failed"); + r = cx_str("Precondition Failed"); break; case PROTOCOL_ENTITY_TOO_LARGE: // 413 /* HTTP/1.1 */ - r = CX_STR("Request Entity Too Large"); + r = cx_str("Request Entity Too Large"); break; case PROTOCOL_URI_TOO_LARGE: // 414 /* HTTP/1.1 */ - r = CX_STR("Request-URI Too Large"); + r = cx_str("Request-URI Too Large"); break; case PROTOCOL_UNSUPPORTED_MEDIA_TYPE: // 415 - r = CX_STR("Unsupported Media Type"); + r = cx_str("Unsupported Media Type"); break; case PROTOCOL_REQUESTED_RANGE_NOT_SATISFIABLE: // 416 - r = CX_STR("Requested range not satisfiable"); + r = cx_str("Requested range not satisfiable"); break; case PROTOCOL_EXPECTATION_FAILED: // 417 - r = CX_STR("Expectation Failed"); + r = cx_str("Expectation Failed"); break; case PROTOCOL_LOCKED: // 423 - r = CX_STR("Locked"); + r = cx_str("Locked"); break; case PROTOCOL_FAILED_DEPENDENCY: // 424 - r = CX_STR("Failed Dependency"); + r = cx_str("Failed Dependency"); break; case PROTOCOL_SERVER_ERROR: // 500 - r = CX_STR("Server Error"); /* The spec actually says "Internal Server Error" */ + r = cx_str("Server Error"); /* The spec actually says "Internal Server Error" */ break; case PROTOCOL_NOT_IMPLEMENTED: // 501 - r = CX_STR("Not Implemented"); + r = cx_str("Not Implemented"); break; case PROTOCOL_BAD_GATEWAY: // 502 - r = CX_STR("Bad Gateway"); + r = cx_str("Bad Gateway"); break; case PROTOCOL_SERVICE_UNAVAILABLE: // 503 - r = CX_STR("Service Unavailable"); + r = cx_str("Service Unavailable"); break; case PROTOCOL_GATEWAY_TIMEOUT: // 504 /* HTTP/1.1 */ - r = CX_STR("Gateway Timeout"); + r = cx_str("Gateway Timeout"); break; case PROTOCOL_VERSION_NOT_SUPPORTED: // 505 /* HTTP/1.1 */ - r = CX_STR("HTTP Version Not Supported"); + r = cx_str("HTTP Version Not Supported"); break; case PROTOCOL_INSUFFICIENT_STORAGE: // 507 - r = CX_STR("Insufficient Storage"); + r = cx_str("Insufficient Storage"); break; default: switch (code / 100) { case 1: - r = CX_STR("Information"); + r = cx_str("Information"); break; case 2: - r = CX_STR("Success"); + r = cx_str("Success"); break; case 3: - r = CX_STR("Redirect"); + r = cx_str("Redirect"); break; case 4: - r = CX_STR("Client error"); + r = cx_str("Client error"); break; case 5: - r = CX_STR("Server error"); + r = cx_str("Server error"); break; default: - r = CX_STR("Unknown reason"); + r = cx_str("Unknown reason"); break; } break; @@ -308,7 +308,7 @@ if(!writer) { return NULL; } - if(cxBufferInit(&writer->buf, NULL, 512, pool_allocator(sn->pool), CX_BUFFER_AUTO_EXTEND|CX_BUFFER_FREE_CONTENTS)) { + if(cxBufferInit(&writer->buf, pool_allocator(sn->pool), NULL, 512, CX_BUFFER_AUTO_EXTEND|CX_BUFFER_FREE_CONTENTS)) { pool_free(sn->pool, writer); return NULL; } @@ -429,7 +429,7 @@ int http_send_continue(Session *sn) { NSAPISession *s = (NSAPISession*)sn; - cxstring msg = CX_STR("HTTP/1.1 100 Continue\r\n\r\n"); + cxstring msg = cx_str("HTTP/1.1 100 Continue\r\n\r\n"); int w = s->connection->write(s->connection, msg.ptr, msg.length); if(w != msg.length) { return 1;