summary refs log tree commit diff
path: root/requestHandler.c
diff options
context:
space:
mode:
authorNakidai <nakidai@disroot.org>2024-09-27 19:17:40 +0300
committerNakidai <nakidai@disroot.org>2024-09-27 19:17:40 +0300
commit34fc96bd1451d6f8dfa1add742dab6e5269ec411 (patch)
tree26d55a701c84ca2f97eacb49b5ff3829e60e14be /requestHandler.c
parentb3e4889f3d1bbf3a860e36e021e8d46d75446522 (diff)
downloadcptc-34fc96bd1451d6f8dfa1add742dab6e5269ec411.tar.gz
cptc-34fc96bd1451d6f8dfa1add742dab6e5269ec411.zip
Autogenerate root on build
Diffstat (limited to 'requestHandler.c')
-rw-r--r--requestHandler.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/requestHandler.c b/requestHandler.c
index 211947f..47ccc60 100644
--- a/requestHandler.c
+++ b/requestHandler.c
@@ -27,16 +27,6 @@ static const char *image_gif        = "Content-Type: image/gif\r\n";
 
 static const char *end              = "\r\n";
 
-static const char *root = "\
-CPTC (https://github.com/nakidai/cptc)\n\
---------------------------------------\n\
-PetTheCord but rewritten in the C cuz some people was annoying me about that a\n\
-lot.\n\
-\n\
-Paths:\n\
-/           Show this text\n\
-/<UID>.*    Return a gif that pets given UID\n";
-
 static bool isnumber(const char *s)
 {
     for (const char *cp = s; *cp != '\0' && *cp != '.'; ++cp)
@@ -86,13 +76,13 @@ void CPTC_requestHandler(int fd)
     if (strlen(path) == 1)
     {
         char *length = malloc(sizeof(*length) * 32);
-        snprintf(length, 32, content_length, strlen(root));
+        snprintf(length, 32, content_length, strlen(CPTC_root));
         strcpy(response, ok);
         strcat(response, text_plain);
         strcat(response, length);
         strcat(response, end);
         send(fd, response, strlen(response), 0);
-        send(fd, root, strlen(root), 0);
+        send(fd, CPTC_root, strlen(CPTC_root), 0);
         free(length);
         return;
     }