X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FUSBDevice.py;h=4a2ba1316eae0002b618771799e72a4011a8d0b2;hp=49ba0a47bbdc32633e6604a38f804a7101a2490f;hb=a2f6b68ebded8f6213a19adf22306e892aa9fff6;hpb=c2657490044b31c65f541c6cb86a723718129b26 diff --git a/client/USBDevice.py b/client/USBDevice.py index 49ba0a4..4a2ba13 100644 --- a/client/USBDevice.py +++ b/client/USBDevice.py @@ -223,8 +223,7 @@ class USBDevice: + "language 0x%04x, length %d") \ % (dtype, dindex, lang, n)) - # TODO: handle KeyError - response = self.descriptors[dtype] + response = self.descriptors.get(dtype, None) if callable(response): response = response(dindex) @@ -236,6 +235,8 @@ class USBDevice: if self.verbose > 5: print(self.name, "sent", n, "bytes in response") + else: + self.maxusb_app.stall_ep0() def handle_get_configuration_descriptor_request(self, num): return self.configurations[num].get_descriptor()