Mercurial
comparison hg-web/main.c @ 106:daf2d393741a
Debugging in server.
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Sat, 03 Jan 2026 10:46:58 -0800 |
| parents | 2301aeb7503b |
| children | 1423044e3d58 |
comparison
equal
deleted
inserted
replaced
| 105:4de2fb74ce82 | 106:daf2d393741a |
|---|---|
| 96 | 96 |
| 97 char *decoded_path = Dowa_Arena_Allocate(arena, strlen(rel_path) + 1); | 97 char *decoded_path = Dowa_Arena_Allocate(arena, strlen(rel_path) + 1); |
| 98 url_decode(decoded_path, rel_path); | 98 url_decode(decoded_path, rel_path); |
| 99 | 99 |
| 100 char *safe_path = sanitize_path(decoded_path, arena); | 100 char *safe_path = sanitize_path(decoded_path, arena); |
| 101 | |
| 102 Seobeo_Log(SEOBEO_INFO, "rel_path: %s\n", rel_path); | |
| 103 Seobeo_Log(SEOBEO_INFO, "decoded_path: %s\n", decoded_path); | |
| 104 Seobeo_Log(SEOBEO_INFO, "safe path: %s\n", safe_path); | |
| 105 fflush(stdout); | |
| 106 | |
| 101 char full_path[MAX_PATH]; | 107 char full_path[MAX_PATH]; |
| 102 if (strlen(safe_path) > 0) | 108 if (strlen(safe_path) > 0) |
| 103 snprintf(full_path, sizeof(full_path), "%s/%s", REPO_ROOT, safe_path); | 109 snprintf(full_path, sizeof(full_path), "%s/%s", REPO_ROOT, safe_path); |
| 104 else | 110 else |
| 105 snprintf(full_path, sizeof(full_path), "%s", REPO_ROOT); | 111 snprintf(full_path, sizeof(full_path), "%s", REPO_ROOT); |
| 178 const char *rel_path = path_kv ? ((Seobeo_Request_Entry*)path_kv)->value : ""; | 184 const char *rel_path = path_kv ? ((Seobeo_Request_Entry*)path_kv)->value : ""; |
| 179 char *decoded_path = Dowa_Arena_Allocate(arena, strlen(rel_path) + 1); | 185 char *decoded_path = Dowa_Arena_Allocate(arena, strlen(rel_path) + 1); |
| 180 url_decode(decoded_path, rel_path); | 186 url_decode(decoded_path, rel_path); |
| 181 char *safe_path = sanitize_path(decoded_path, arena); | 187 char *safe_path = sanitize_path(decoded_path, arena); |
| 182 | 188 |
| 183 Seobeo_Log(SEOBEO_DEBUG, "rel_path: %s\n", rel_path); | 189 Seobeo_Log(SEOBEO_INFO, "rel_path: %s\n", rel_path); |
| 184 Seobeo_Log(SEOBEO_DEBUG, "decoded_path: %s\n", decoded_path); | 190 Seobeo_Log(SEOBEO_INFO, "decoded_path: %s\n", decoded_path); |
| 185 Seobeo_Log(SEOBEO_DEBUG, "safe path: %s\n", safe_path); | 191 Seobeo_Log(SEOBEO_INFO, "safe path: %s\n", safe_path); |
| 186 | 192 fflush(stdout); |
| 187 | 193 |
| 188 if (strlen(safe_path) == 0) | 194 if (strlen(safe_path) == 0) |
| 189 { | 195 { |
| 190 char *error = Dowa_Arena_Allocate(arena, 64); | 196 char *error = Dowa_Arena_Allocate(arena, 64); |
| 191 strcpy(error, "File path required"); | 197 strcpy(error, "File path required"); |