Skip to content

Commit

Permalink
Upgrade handy-httpd version (and small fix for Mmap)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dadoum committed Mar 25, 2023
1 parent 1ad942b commit 40fd418
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
16 changes: 2 additions & 14 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
# ==============================================================================
# Fetching external libraries

if(build_sideloadipa OR build_anisetteserver)
if(build_anisetteserver)
include(UseDub)

if(build_sideloadipa)
DubProject_Add(gtk-d ~3.10.0)
DubProject_Add(gmp-d ~0.2.11)
# DubProject_Add(mofile ~0.2.1)

DubProject_Add(pbkdf2 ~0.1.3)
DubProject_Add(crypto ~0.2.17)
endif()

if(build_anisetteserver)
DubProject_Add(handy-httpd ~3.3.0)
endif()
DubProject_Add(handy-httpd ~5.2.1)
endif()
2 changes: 1 addition & 1 deletion dub.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ subPackage {
sourcePaths "anisette_server"

dependency "provision" version="*"
dependency "handy-httpd" version="~>3.3.0"
dependency "handy-httpd" version="~>5.2.1"

configuration "default" {
targetType "executable"
Expand Down
8 changes: 7 additions & 1 deletion lib/provision/androidlibrary.d
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ public struct AndroidLibrary {
allocation[headerStart - alignedMinimum..headerEnd - alignedMinimum] = elfFile[fileStart..fileEnd];

auto protectionResult = mprotect(allocation.ptr + pageFloor(headerStart), pageCeil(headerEnd) - pageFloor(headerStart), programHeader.memoryProtection());

if (protectionResult != 0) {
throw new LoaderException("Cannot protect the memory correctly.");
}
}
}

Expand Down Expand Up @@ -112,7 +116,9 @@ public struct AndroidLibrary {
}

~this() {
MmapAllocator.instance.deallocate(allocation);
if (allocation) {
MmapAllocator.instance.deallocate(allocation);
}
}

@disable this(this);
Expand Down

0 comments on commit 40fd418

Please sign in to comment.