Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libplist
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pwn
libplist
Commits
9698bafc
Commit
9698bafc
authored
Aug 03, 2008
by
Martin Aumueller
Committed by
Matt Colyer
Aug 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print libusb errors during usb_bulk_read/write.
Signed-off-by:
Matt Colyer
<
matt@colyer.name
>
parent
4750a54d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
iphone.c
src/iphone.c
+7
-0
usbmux.c
src/usbmux.c
+5
-0
No files found.
src/iphone.c
View file @
9698bafc
...
...
@@ -148,6 +148,8 @@ int send_to_phone(iPhone *phone, char *data, int datalen) {
bytes
=
usb_bulk_write
(
phone
->
device
,
BULKOUT
,
data
,
datalen
,
800
);
if
(
debug
)
printf
(
"noooo...?
\n
"
);
if
(
bytes
<
datalen
)
{
if
(
debug
&&
bytes
<
0
)
printf
(
"send_to_iphone(): libusb gave me the error: %s
\n
"
,
usb_strerror
());
return
-
1
;
}
else
{
return
bytes
;
...
...
@@ -169,6 +171,11 @@ int recv_from_phone(iPhone *phone, char *data, int datalen) {
if
(
!
phone
)
return
-
1
;
int
bytes
=
0
;
bytes
=
usb_bulk_read
(
phone
->
device
,
BULKIN
,
data
,
datalen
,
3500
);
if
(
bytes
<
0
)
{
if
(
debug
)
printf
(
"recv_from_iphone(): libusb gave me the error: %s
\n
"
,
usb_strerror
());
return
-
1
;
}
return
bytes
;
}
src/usbmux.c
View file @
9698bafc
...
...
@@ -112,7 +112,12 @@ void mux_close_connection(iPhone *phone, usbmux_tcp_header *connection) {
int
bytes
=
0
;
bytes
=
usb_bulk_write
(
phone
->
device
,
BULKOUT
,
(
char
*
)
connection
,
sizeof
(
*
connection
),
800
);
if
(
debug
&&
bytes
<
0
)
printf
(
"mux_close_connection(): when writing, libusb gave me the error: %s
\n
"
,
usb_strerror
());
bytes
=
usb_bulk_read
(
phone
->
device
,
BULKIN
,
(
char
*
)
connection
,
sizeof
(
*
connection
),
800
);
if
(
debug
&&
bytes
<
0
)
printf
(
"get_iPhone(): when reading, libusb gave me the error: %s
\n
"
,
usb_strerror
());
free
(
connection
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment