summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /net-ftp/atftp/files/atftp-0.7-blockno.patch
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'net-ftp/atftp/files/atftp-0.7-blockno.patch')
-rw-r--r--net-ftp/atftp/files/atftp-0.7-blockno.patch136
1 files changed, 136 insertions, 0 deletions
diff --git a/net-ftp/atftp/files/atftp-0.7-blockno.patch b/net-ftp/atftp/files/atftp-0.7-blockno.patch
new file mode 100644
index 000000000000..6a3184f98bec
--- /dev/null
+++ b/net-ftp/atftp/files/atftp-0.7-blockno.patch
@@ -0,0 +1,136 @@
+--- atftp-0.7/tftp_file.c~ 2010-05-27 13:05:12.000000000 -0500
++++ atftp-0.7/tftp_file.c 2010-05-27 12:50:05.000000000 -0500
+@@ -133,19 +133,21 @@
+ int mcast_sockfd = 0;
+ struct sockaddr_in sa_mcast;
+ struct ip_mreq mreq;
+ struct hostent *host;
+ int master_client = 0;
+ unsigned int file_bitmap[NB_BLOCK];
+ int prev_bitmap_hole = -1; /* the previous hole found in the bitmap */
+ char string[MAXLEN];
++ int rx_block_number;
+
+ int prev_block_number = 0; /* needed to support netascii convertion */
+ int temp = 0;
++ size_t ignore;
+
+ data->file_size = 0;
+ tftp_cancel = 0;
+ from.sin_addr.s_addr = 0;
+
+ memset(&sa_mcast, 0, sizeof(struct sockaddr_in));
+ memset(&file_bitmap, 0, sizeof(file_bitmap));
+
+@@ -300,17 +302,17 @@
+ {
+ connect(sockfd, (struct sockaddr *)&sa, sizeof(sa));
+ connected = 1;
+ }
+ state = S_OACK_RECEIVED;
+ break;
+ case GET_ERROR:
+ fprintf(stderr, "tftp: error received from server <");
+- fwrite(tftphdr->th_msg, 1, data_size - 4 - 1, stderr);
++ ignore = fwrite(tftphdr->th_msg, 1, data_size - 4 - 1, stderr);
+ fprintf(stderr, ">\n");
+ state = S_ABORT;
+ break;
+ case GET_DATA:
+ number_of_timeout = 0;
+ /* if the socket if not connected, connect it */
+ if (!connected)
+ {
+@@ -513,21 +515,24 @@
+ state = S_WAIT_PACKET;
+ break;
+ case S_DATA_RECEIVED:
+ if ((multicast && master_client) || (!multicast))
+ timeout_state = S_SEND_ACK;
+ else
+ timeout_state = S_WAIT_PACKET;
+
+- block_number = ntohs(tftphdr->th_block);
++ rx_block_number = ntohs(tftphdr->th_block);
+ if (data->trace)
+ fprintf(stderr, "received DATA <block: %d, size: %d>\n",
+ ntohs(tftphdr->th_block), data_size - 4);
+
++ if ((uint16_t)rx_block_number == (uint16_t)(block_number+1))
++ ++block_number;
++
+ if (tftp_file_write(fp, tftphdr->th_data, data->data_buffer_size - 4, block_number,
+ data_size - 4, convert, &prev_block_number, &temp)
+ != data_size - 4)
+ {
+
+ fprintf(stderr, "tftp: error writing to file %s\n",
+ data->local_file);
+ tftp_send_error(sockfd, &sa, ENOSPACE, data->data_buffer,
+@@ -613,19 +618,21 @@
+ int connected; /* 1 when sockfd is connected */
+ struct tftphdr *tftphdr = (struct tftphdr *)data->data_buffer;
+ FILE *fp; /* the local file pointer */
+ int number_of_timeout = 0;
+ struct stat file_stat;
+ int convert = 0; /* if true, do netascii convertion */
+ char string[MAXLEN];
+
++ int ack_block_number;
+ int prev_block_number = 0; /* needed to support netascii convertion */
+ int prev_file_pos = 0;
+ int temp = 0;
++ size_t ignore;
+
+ data->file_size = 0;
+ tftp_cancel = 0;
+ from.sin_addr.s_addr = 0;
+
+ /* make sure the socket is not connected */
+ sa.sin_family = AF_UNSPEC;
+ connect(sockfd, (struct sockaddr *)&sa, sizeof(sa));
+@@ -759,20 +766,23 @@
+ case GET_ACK:
+ number_of_timeout = 0;
+ /* if the socket if not connected, connect it */
+ if (!connected)
+ {
+ //connect(sockfd, (struct sockaddr *)&sa, sizeof(sa));
+ connected = 1;
+ }
+- block_number = ntohs(tftphdr->th_block);
++ ack_block_number = ntohs(tftphdr->th_block);
++ if ((uint16_t)(block_number+1) == ack_block_number)
++ ++block_number;
+ if (data->trace)
+ fprintf(stderr, "received ACK <block: %d>\n",
+- block_number);
++ ack_block_number);
++
+ if ((last_block != -1) && (block_number > last_block))
+ {
+ state = S_END;
+ break;
+ }
+ state = S_SEND_DATA;
+ break;
+ case GET_OACK:
+@@ -782,17 +792,17 @@
+ {
+ //connect(sockfd, (struct sockaddr *)&sa, sizeof(sa));
+ connected = 1;
+ }
+ state = S_OACK_RECEIVED;
+ break;
+ case GET_ERROR:
+ fprintf(stderr, "tftp: error received from server <");
+- fwrite(tftphdr->th_msg, 1, data_size - 4 - 1, stderr);
++ ignore = fwrite(tftphdr->th_msg, 1, data_size - 4 - 1, stderr);
+ fprintf(stderr, ">\n");
+ state = S_ABORT;
+ break;
+ case GET_DISCARD:
+ /* consider discarded packet as timeout to make sure when don't lock up
+ if routing is broken */
+ number_of_timeout++;
+ fprintf(stderr, "tftp: packet discard <%s:%d>.\n",