Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AndroidSystemCore
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Matombo
AndroidSystemCore
Commits
d37e0840
Commit
d37e0840
authored
Apr 6, 2011
by
Mike Lockwood
Committed by
Android Code Review
Apr 6, 2011
Browse files
Options
Downloads
Plain Diff
Merge "In serial, skip over port as well if numbers found after colon."
parents
7c556549
e994f18c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
adb/sockets.c
+28
-2
28 additions, 2 deletions
adb/sockets.c
with
28 additions
and
2 deletions
adb/sockets.c
+
28
−
2
View file @
d37e0840
...
...
@@ -569,6 +569,32 @@ unsigned unhex(unsigned char *s, int len)
return
n
;
}
/* skip_host_serial return the position in a string
skipping over the 'serial' parameter in the ADB protocol,
where parameter string may be a host:port string containing
the protocol delimiter (colon). */
char
*
skip_host_serial
(
char
*
service
)
{
char
*
first_colon
,
*
serial_end
;
first_colon
=
strchr
(
service
,
':'
);
if
(
!
first_colon
)
{
/* No colon in service string. */
return
NULL
;
}
serial_end
=
first_colon
;
if
(
isdigit
(
serial_end
[
1
]))
{
serial_end
++
;
while
((
*
serial_end
)
&&
isdigit
(
*
serial_end
))
{
serial_end
++
;
}
if
((
*
serial_end
)
!=
':'
)
{
// Something other than numbers was found, reset the end.
serial_end
=
first_colon
;
}
}
return
serial_end
;
}
static
int
smart_socket_enqueue
(
asocket
*
s
,
apacket
*
p
)
{
unsigned
len
;
...
...
@@ -624,8 +650,8 @@ static int smart_socket_enqueue(asocket *s, apacket *p)
char
*
serial_end
;
service
+=
strlen
(
"host-serial:"
);
// serial number should follow "host:"
serial_end
=
s
trchr
(
service
,
':'
);
// serial number should follow "host:"
and could be a host:port string.
serial_end
=
s
kip_host_serial
(
service
);
if
(
serial_end
)
{
*
serial_end
=
0
;
// terminate string
serial
=
service
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment