Skip to content

Commit

Permalink
Try fixing device detection
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewBarba committed May 30, 2024
1 parent c162d6a commit 3f60b0a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/Compute/Fastly/FastlyDevice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extension Fastly {

public static func lookup(userAgent: String) throws -> DeviceLookup {
return try wasiDecode(maxBufferLength: maxIpLookupLength) {
fastly_device__device_detection_lookup(userAgent, userAgent.utf8.count, $0, $1, &$2)
fastly_device__device_detection_lookup(userAgent, $0, $1, &$2)
}
}

Expand Down
1 change: 0 additions & 1 deletion Sources/Compute/Fastly/FastlyStubs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ func fastly_cache__cache_transaction_cancel(_ handle: WasiHandle) -> Int32 { fat

func fastly_device__device_detection_lookup(
_ user_agent: UnsafePointer<CChar>!,
_ user_agent_len: Int,
_ buf: UnsafeMutablePointer<UInt8>!,
_ buf_len: Int,
_ nwritten: UnsafeMutablePointer<Int>!
Expand Down
2 changes: 1 addition & 1 deletion Sources/ComputeRuntime/include/ComputeRuntime.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ int fastly_cache__cache_get_body(WasiHandle handle, uint32_t options_mask,
/* FASTLY_DEVICE */

WASM_IMPORT("fastly_device_detection", "lookup")
int fastly_device__device_detection_lookup(const char *user_agent, size_t user_agent_len, uint8_t *buf,
int fastly_device__device_detection_lookup(const char *user_agent, uint8_t *buf,
size_t buf_len, size_t *nwritten);

#pragma GCC diagnostic pop
Expand Down

0 comments on commit 3f60b0a

Please sign in to comment.