• Home
  • History
  • Annotate
  • Raw
  • Download

Lines Matching refs:p

125 static int local_socket_enqueue(asocket* s, apacket* p) {  in local_socket_enqueue()  argument
126 D("LS(%d): enqueue %d", s->id, p->len); in local_socket_enqueue()
128 p->ptr = p->data; in local_socket_enqueue()
141 while (p->len > 0) { in local_socket_enqueue()
142 int r = adb_write(s->fd, p->ptr, p->len); in local_socket_enqueue()
144 p->len -= r; in local_socket_enqueue()
145 p->ptr += r; in local_socket_enqueue()
150 put_apacket(p); in local_socket_enqueue()
159 if (p->len == 0) { in local_socket_enqueue()
160 put_apacket(p); in local_socket_enqueue()
165 p->next = 0; in local_socket_enqueue()
167 s->pkt_last->next = p; in local_socket_enqueue()
169 s->pkt_first = p; in local_socket_enqueue()
171 s->pkt_last = p; in local_socket_enqueue()
187 apacket *p, *n; in local_socket_destroy() local
198 for (p = s->pkt_first; p; p = n) { in local_socket_destroy()
199 D("LS(%d): discarding %d bytes", s->id, p->len); in local_socket_destroy()
200 n = p->next; in local_socket_destroy()
201 put_apacket(p); in local_socket_destroy()
258 apacket* p; in local_socket_event_func() local
259 while ((p = s->pkt_first) != nullptr) { in local_socket_event_func()
260 while (p->len > 0) { in local_socket_event_func()
261 int r = adb_write(fd, p->ptr, p->len); in local_socket_event_func()
270 p->ptr += r; in local_socket_event_func()
271 p->len -= r; in local_socket_event_func()
281 if (p->len == 0) { in local_socket_event_func()
282 s->pkt_first = p->next; in local_socket_event_func()
286 put_apacket(p); in local_socket_event_func()
308 apacket* p = get_apacket(); in local_socket_event_func() local
309 unsigned char* x = p->data; in local_socket_event_func()
336 put_apacket(p); in local_socket_event_func()
338 p->len = max_payload - avail; in local_socket_event_func()
344 r = s->peer->enqueue(s->peer, p); in local_socket_event_func()
452 static int remote_socket_enqueue(asocket* s, apacket* p) { in remote_socket_enqueue() argument
454 p->msg.command = A_WRTE; in remote_socket_enqueue()
455 p->msg.arg0 = s->peer->id; in remote_socket_enqueue()
456 p->msg.arg1 = s->id; in remote_socket_enqueue()
457 p->msg.data_length = p->len; in remote_socket_enqueue()
458 send_packet(p, s->transport); in remote_socket_enqueue()
464 apacket* p = get_apacket(); in remote_socket_ready() local
465 p->msg.command = A_OKAY; in remote_socket_ready()
466 p->msg.arg0 = s->peer->id; in remote_socket_ready()
467 p->msg.arg1 = s->id; in remote_socket_ready()
468 send_packet(p, s->transport); in remote_socket_ready()
474 apacket* p = get_apacket(); in remote_socket_shutdown() local
475 p->msg.command = A_CLSE; in remote_socket_shutdown()
477 p->msg.arg0 = s->peer->id; in remote_socket_shutdown()
479 p->msg.arg1 = s->id; in remote_socket_shutdown()
480 send_packet(p, s->transport); in remote_socket_shutdown()
521 apacket* p = get_apacket(); in connect_to_remote() local
529 p->msg.command = A_OPEN; in connect_to_remote()
530 p->msg.arg0 = s->id; in connect_to_remote()
531 p->msg.data_length = len; in connect_to_remote()
532 strcpy((char*)p->data, destination); in connect_to_remote()
533 send_packet(p, s->transport); in connect_to_remote()
650 static int smart_socket_enqueue(asocket* s, apacket* p) { in smart_socket_enqueue() argument
658 D("SS(%d): enqueue %d", s->id, p->len); in smart_socket_enqueue()
661 s->pkt_first = p; in smart_socket_enqueue()
662 s->pkt_last = p; in smart_socket_enqueue()
664 if ((s->pkt_first->len + p->len) > s->get_max_payload()) { in smart_socket_enqueue()
666 put_apacket(p); in smart_socket_enqueue()
670 memcpy(s->pkt_first->data + s->pkt_first->len, p->data, p->len); in smart_socket_enqueue()
671 s->pkt_first->len += p->len; in smart_socket_enqueue()
672 put_apacket(p); in smart_socket_enqueue()
674 p = s->pkt_first; in smart_socket_enqueue()
678 if (p->len < 4) { in smart_socket_enqueue()
682 len = unhex(p->data, 4); in smart_socket_enqueue()
690 if ((len + 4) > p->len) { in smart_socket_enqueue()
691 D("SS(%d): waiting for %d more bytes", s->id, len + 4 - p->len); in smart_socket_enqueue()
695 p->data[len + 4] = 0; in smart_socket_enqueue()
697 D("SS(%d): '%s'", s->id, (char*)(p->data + 4)); in smart_socket_enqueue()
700 service = (char*)p->data + 4; in smart_socket_enqueue()
740 p->len = 0; in smart_socket_enqueue()
808 connect_to_remote(s->peer, (char*)(p->data + 4)); in smart_socket_enqueue()