Fossil SCM

Add the 'test-pid' web page.

mistachkin 2020-06-07 18:23 trunk
Commit d6e900a58153bcd0da2c07d4fd621a34d71d41f97834935ef005c0ff220a1137
1 file changed +28
+28
--- src/main.c
+++ src/main.c
@@ -2345,10 +2345,38 @@
23452345
}else{
23462346
fossil_fatal("failed to parse pid key");
23472347
}
23482348
}
23492349
#endif
2350
+
2351
+/*
2352
+** WEBPAGE: test-pid
2353
+**
2354
+** Return the process identifier of the running Fossil server instance.
2355
+**
2356
+** Query parameters:
2357
+**
2358
+** usepidkey When present and available, also return the
2359
+** address and size, within this server process,
2360
+** of the saved database encryption key. This
2361
+** is only supported when using SEE on Windows.
2362
+*/
2363
+void test_pid_page(void){
2364
+ login_check_credentials();
2365
+ if( !g.perm.Setup ){ login_needed(0); return; }
2366
+#if defined(_WIN32) && USE_SEE
2367
+ if( P("usepidkey")!=0 ){
2368
+ const char *zSavedKey = db_get_saved_encryption_key();
2369
+ size_t savedKeySize = db_get_saved_encryption_key_size();
2370
+ if( zSavedKey!=0 && savedKeySize>0 ){
2371
+ @ %lu(GetCurrentProcessId()):%p(zSavedKey):%u(savedKeySize)
2372
+ return;
2373
+ }
2374
+ }
2375
+#endif
2376
+ @ %d(GETPID())
2377
+}
23502378
23512379
/*
23522380
** COMMAND: http*
23532381
**
23542382
** Usage: %fossil http ?REPOSITORY? ?OPTIONS?
23552383
--- src/main.c
+++ src/main.c
@@ -2345,10 +2345,38 @@
2345 }else{
2346 fossil_fatal("failed to parse pid key");
2347 }
2348 }
2349 #endif
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2350
2351 /*
2352 ** COMMAND: http*
2353 **
2354 ** Usage: %fossil http ?REPOSITORY? ?OPTIONS?
2355
--- src/main.c
+++ src/main.c
@@ -2345,10 +2345,38 @@
2345 }else{
2346 fossil_fatal("failed to parse pid key");
2347 }
2348 }
2349 #endif
2350
2351 /*
2352 ** WEBPAGE: test-pid
2353 **
2354 ** Return the process identifier of the running Fossil server instance.
2355 **
2356 ** Query parameters:
2357 **
2358 ** usepidkey When present and available, also return the
2359 ** address and size, within this server process,
2360 ** of the saved database encryption key. This
2361 ** is only supported when using SEE on Windows.
2362 */
2363 void test_pid_page(void){
2364 login_check_credentials();
2365 if( !g.perm.Setup ){ login_needed(0); return; }
2366 #if defined(_WIN32) && USE_SEE
2367 if( P("usepidkey")!=0 ){
2368 const char *zSavedKey = db_get_saved_encryption_key();
2369 size_t savedKeySize = db_get_saved_encryption_key_size();
2370 if( zSavedKey!=0 && savedKeySize>0 ){
2371 @ %lu(GetCurrentProcessId()):%p(zSavedKey):%u(savedKeySize)
2372 return;
2373 }
2374 }
2375 #endif
2376 @ %d(GETPID())
2377 }
2378
2379 /*
2380 ** COMMAND: http*
2381 **
2382 ** Usage: %fossil http ?REPOSITORY? ?OPTIONS?
2383

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button