diff --git a/firmware_handler.cpp b/firmware_handler.cpp
index 21556e1..f6c5472 100644
--- a/firmware_handler.cpp
+++ b/firmware_handler.cpp
@@ -18,13 +18,18 @@
 
 std::unique_ptr<GenericBlobInterface>
     FirmwareBlobHandler::CreateFirmwareBlobHandler(
-        const std::vector<HandlerPack>& firmwares, std::uint16_t transports)
+        const std::vector<HandlerPack>& firmwares,
+        const std::vector<DataHandlerPack>& transports)
 {
     /* There must be at least one. */
     if (!firmwares.size())
     {
         return nullptr;
     }
+    if (!transports.size())
+    {
+        return nullptr;
+    }
 
     std::vector<std::string> blobs;
     for (const auto& item : firmwares)
@@ -33,7 +38,15 @@
     }
     blobs.push_back(hashBlobID);
 
-    return std::make_unique<FirmwareBlobHandler>(firmwares, blobs, transports);
+    std::uint16_t bitmask = 0;
+    for (const auto& item : transports)
+    {
+        /* TODO: can use std::accumulate() unless I'm mistaken. :D */
+        bitmask |= item.bitmask;
+    }
+
+    return std::make_unique<FirmwareBlobHandler>(firmwares, blobs, transports,
+                                                 bitmask);
 }
 
 bool FirmwareBlobHandler::canHandleBlob(const std::string& path)
@@ -92,7 +105,7 @@
     else
     {
         /* They are requesting information about the generic blob_id. */
-        meta->blobState = transports;
+        meta->blobState = bitmask;
         meta->size = 0;
 
         /* The generic blob_ids state is only the bits related to the transport
@@ -148,7 +161,7 @@
 
     /* Check the flags for the transport mechanism: if none match we don't
      * support what they request. */
-    if ((flags & transports) == 0)
+    if ((flags & bitmask) == 0)
     {
         return false;
     }
@@ -170,6 +183,16 @@
     }
     else
     {
+        /* How are they expecting to copy this data? */
+        auto d = std::find_if(
+            transports.begin(), transports.end(),
+            [&flags](const auto& iter) { return (iter.bitmask & flags); });
+        if (d != transports.end())
+        {
+            /* We found the transport handler they requested, no surprise since
+             * above we verify they selected at least one we wanted. */
+        }
+
         /* 2d) are they opening the /flash/tarball ? (to start the UBI process)
          */
         /* 2e) are they opening the /flash/image ? (to start the process) */
