Skip to content

Commit

Permalink
Merge pull request #121 from onionshare/change-random-content-path-wh…
Browse files Browse the repository at this point in the history
…en-new-files-are-shared

Change the random content path each time new files are shared
  • Loading branch information
grote committed Jan 29, 2024
2 parents 64c4046 + da3e160 commit 4919b62
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,13 @@ class WebserverManager @Inject constructor() {
private var server: ApplicationEngine? = null
private val _state = MutableStateFlow<WebServerState>(WebServerState.Stopped(false))
val state = _state.asStateFlow()
val contentPath = getRandomPath()
@Volatile
var contentPath = ""
private set

suspend fun start(sendPage: SendPage): Int {
_state.value = WebServerState.Starting
contentPath = getRandomPath()
val staticPath = getStaticPath()
val pathMap = mapOf("static_url_path" to staticPath, "content_path" to contentPath)
TrafficStats.setThreadStatsTag(0x42)
Expand Down

0 comments on commit 4919b62

Please sign in to comment.