servers: convert two macros to scoped static const strings

Closes #18067
This commit is contained in:
Viktor Szakats 2025-07-24 02:34:39 +02:00
parent 85e18a5b9a
commit 3bdef96aba
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
2 changed files with 10 additions and 10 deletions

View file

@ -716,19 +716,19 @@ static int rtspd_send_doc(curl_socket_t sock, struct rtspd_httprequest *req)
default:
case RCMD_NORMALREQ:
break; /* continue with business as usual */
case RCMD_STREAM:
#define STREAMTHIS "a string to stream 01234567890\n"
count = strlen(STREAMTHIS);
case RCMD_STREAM: {
static const char streamthis[] = "a string to stream 01234567890\n";
for(;;) {
written = swrite(sock, STREAMTHIS, count);
written = swrite(sock, streamthis, sizeof(streamthis)-1);
if(got_exit_signal)
return -1;
if(written != (ssize_t)count) {
if(written != (ssize_t)(sizeof(streamthis)-1)) {
logmsg("Stopped streaming");
break;
}
}
return -1;
}
case RCMD_IDLE:
/* Do nothing. Sit idle. Pretend it rains. */
return 0;

View file

@ -959,19 +959,19 @@ static int sws_send_doc(curl_socket_t sock, struct sws_httprequest *req)
default:
case RCMD_NORMALREQ:
break; /* continue with business as usual */
case RCMD_STREAM:
#define STREAMTHIS "a string to stream 01234567890\n"
count = strlen(STREAMTHIS);
case RCMD_STREAM: {
static const char streamthis[] = "a string to stream 01234567890\n";
for(;;) {
written = swrite(sock, STREAMTHIS, count);
written = swrite(sock, streamthis, sizeof(streamthis)-1);
if(got_exit_signal)
return -1;
if(written != (ssize_t)count) {
if(written != (ssize_t)(sizeof(streamthis)-1)) {
logmsg("Stopped streaming");
break;
}
}
return -1;
}
case RCMD_IDLE:
/* Do nothing. Sit idle. Pretend it rains. */
return 0;