summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-pda/pilot-link/ChangeLog6
-rw-r--r--app-pda/pilot-link/files/pilot-link-0.11.8-netsync.patch146
-rw-r--r--app-pda/pilot-link/pilot-link-0.11.8-r1.ebuild4
3 files changed, 154 insertions, 2 deletions
diff --git a/app-pda/pilot-link/ChangeLog b/app-pda/pilot-link/ChangeLog
index 86e6ec67becb..59afbd8f58db 100644
--- a/app-pda/pilot-link/ChangeLog
+++ b/app-pda/pilot-link/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for app-pda/pilot-link
# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-pda/pilot-link/ChangeLog,v 1.14 2004/09/23 09:32:59 sejo Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-pda/pilot-link/ChangeLog,v 1.15 2004/09/30 00:07:19 liquidx Exp $
+
+ 30 Sep 2004; Alastair Tse <liquidx@gentoo.org>
+ +files/pilot-link-0.11.8-netsync.patch, pilot-link-0.11.8-r1.ebuild:
+ add net sync patch (#62873)
*pilot-link-0.11.8-r1 (23 Sep 2004)
diff --git a/app-pda/pilot-link/files/pilot-link-0.11.8-netsync.patch b/app-pda/pilot-link/files/pilot-link-0.11.8-netsync.patch
new file mode 100644
index 000000000000..33f27e3ef504
--- /dev/null
+++ b/app-pda/pilot-link/files/pilot-link-0.11.8-netsync.patch
@@ -0,0 +1,146 @@
+*** net.c 2004/03/13 18:52:43 1.1
+--- net.c 2004/03/13 19:54:13
+***************
+*** 179,187 ****
+ bytes = next->write(ps, buf, PI_NET_HEADER_LEN, flags);
+ if (bytes < PI_NET_HEADER_LEN)
+ return bytes;
+! bytes = next->write(ps, msg, len, flags);
+! if (bytes < len)
+ return bytes;
+
+ CHECK(PI_DBG_NET, PI_DBG_LVL_INFO, net_dump_header(buf, 1));
+ CHECK(PI_DBG_NET, PI_DBG_LVL_DEBUG, dumpdata(msg, len));
+--- 179,189 ----
+ bytes = next->write(ps, buf, PI_NET_HEADER_LEN, flags);
+ if (bytes < PI_NET_HEADER_LEN)
+ return bytes;
+! if (len > 0) { /* avoid zero-length write on tickle */
+! bytes = next->write(ps, msg, len, flags);
+! if (bytes < len)
+ return bytes;
++ }
+
+ CHECK(PI_DBG_NET, PI_DBG_LVL_INFO, net_dump_header(buf, 1));
+ CHECK(PI_DBG_NET, PI_DBG_LVL_DEBUG, dumpdata(msg, len));
+***************
+*** 196,202 ****
+ total_bytes,
+ packet_len,
+ timeout,
+! size;
+
+ struct pi_protocol *prot, *next;
+ struct pi_net_data *data;
+--- 198,205 ----
+ total_bytes,
+ packet_len,
+ timeout,
+! size,
+! done;
+
+ struct pi_protocol *prot, *next;
+ struct pi_net_data *data;
+***************
+*** 216,255 ****
+ pi_setsockopt(ps->sd, PI_LEVEL_DEV, PI_DEV_TIMEOUT,
+ &timeout, &size);
+
+! total_bytes = 0;
+! if (data->txid == 0) {
+ /* Peek to see if it is a headerless packet */
+ bytes = next->read(ps, msg, 1, flags);
+ if (bytes > 0) {
+! LOG ((PI_DBG_NET, PI_DBG_LVL_INFO,
+! "NET RX: Checking for headerless packet %d\n", msg[0]));
+
+! if (msg[0] == 0x90) {
+! /* Cause the header bytes to be skipped */
+! LOG ((PI_DBG_NET, PI_DBG_LVL_INFO,
+! "NET RX: Headerless packet\n"));
+! total_bytes = PI_NET_HEADER_LEN;
+! msg[PI_NET_OFFSET_TYPE] = PI_NET_TYPE_DATA;
+! msg[PI_NET_OFFSET_TXID] = 0x01;
+! set_long (&msg[PI_NET_OFFSET_SIZE], 21);
+! } else {
+! total_bytes += bytes;
+! }
+ } else {
+! return bytes;
+ }
+! }
+
+! /* Bytes in what's left of the header */
+! while (total_bytes < PI_NET_HEADER_LEN) {
+ bytes = next->read(ps, msg + total_bytes, PI_NET_HEADER_LEN - total_bytes, flags);
+ if (bytes <= 0)
+! return bytes;
+ total_bytes += bytes;
+ }
+
+ /* Bytes in the rest of the packet */
+- packet_len = get_long(&msg[PI_NET_OFFSET_SIZE]);
+ while (total_bytes < PI_NET_HEADER_LEN + packet_len) {
+ bytes = next->read(ps, msg + total_bytes,
+ PI_NET_HEADER_LEN + packet_len - total_bytes, flags);
+--- 219,278 ----
+ pi_setsockopt(ps->sd, PI_LEVEL_DEV, PI_DEV_TIMEOUT,
+ &timeout, &size);
+
+! done = 0;
+! while (!done) {
+! total_bytes = 0;
+! if (data->txid == 0) {
+ /* Peek to see if it is a headerless packet */
+ bytes = next->read(ps, msg, 1, flags);
+ if (bytes > 0) {
+! LOG ((PI_DBG_NET, PI_DBG_LVL_INFO,
+! "NET RX: Checking for headerless packet %d\n", msg[0]));
+
+! if (msg[0] == 0x90) {
+! /* Cause the header bytes to be skipped */
+! LOG ((PI_DBG_NET, PI_DBG_LVL_INFO,
+! "NET RX: Headerless packet\n"));
+! total_bytes = PI_NET_HEADER_LEN;
+! msg[PI_NET_OFFSET_TYPE] = PI_NET_TYPE_DATA;
+! msg[PI_NET_OFFSET_TXID] = 0x01;
+! set_long (&msg[PI_NET_OFFSET_SIZE], 21);
+! } else {
+! total_bytes += bytes;
+! }
+ } else {
+! return bytes;
+ }
+! }
+
+! /* Bytes in what's left of the header */
+! while (total_bytes < PI_NET_HEADER_LEN) {
+ bytes = next->read(ps, msg + total_bytes, PI_NET_HEADER_LEN - total_bytes, flags);
+ if (bytes <= 0)
+! return bytes;
+ total_bytes += bytes;
++ }
++ packet_len = get_long(&msg[PI_NET_OFFSET_SIZE]);
++ data->type = msg[PI_NET_OFFSET_TYPE];
++ switch (data->type) {
++ case PI_NET_TYPE_TCKL:
++ if (packet_len != 0) {
++ LOG ((PI_DBG_NET, PI_DBG_LVL_ERR,
++ "NET RX: tickle packet with non-zero length\n"));
++ return -1;
++ }
++ /* valid tickle packet; continue reading. */
++ break;
++ case PI_NET_TYPE_DATA:
++ done = 1;
++ break;
++ default:
++ LOG ((PI_DBG_NET, PI_DBG_LVL_ERR,
++ "NET RX: Unknown packet type\n"));
++ }
+ }
+
+ /* Bytes in the rest of the packet */
+ while (total_bytes < PI_NET_HEADER_LEN + packet_len) {
+ bytes = next->read(ps, msg + total_bytes,
+ PI_NET_HEADER_LEN + packet_len - total_bytes, flags);
diff --git a/app-pda/pilot-link/pilot-link-0.11.8-r1.ebuild b/app-pda/pilot-link/pilot-link-0.11.8-r1.ebuild
index bfc97ea2e642..5fae45676065 100644
--- a/app-pda/pilot-link/pilot-link-0.11.8-r1.ebuild
+++ b/app-pda/pilot-link/pilot-link-0.11.8-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-pda/pilot-link/pilot-link-0.11.8-r1.ebuild,v 1.1 2004/09/23 09:32:59 sejo Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-pda/pilot-link/pilot-link-0.11.8-r1.ebuild,v 1.2 2004/09/30 00:07:19 liquidx Exp $
inherit perl-module eutils
@@ -29,6 +29,8 @@ src_unpack() {
else
epatch ${FILESDIR}/${P}-javapath.patch
fi
+ # bug #62873
+ cd ${S}/libpisock; epatch ${FILESDIR}/${P}-netsync.patch
}
src_compile() {