[1934] 2008-12-12 Alex Smith <[email protected]>

Bean <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 1934
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=1934
Author:   bean
Date:     2008-12-12 04:12:05 +0000 (Fri, 12 Dec 2008)

Log Message:
-----------
2008-12-12  Alex Smith  <[email protected]>

	* fs/i386/pc/pxe.c (grub_pxefs_open): Handle the one open connection
	at a time limit of the PXE TFTP API correctly.
	(grub_pxefs_close): Likewise.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/fs/i386/pc/pxe.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2008-11-29 21:05:59 UTC (rev 1933)
+++ trunk/grub2/ChangeLog	2008-12-12 04:12:05 UTC (rev 1934)
@@ -1,3 +1,9 @@
+2008-12-12  Alex Smith  <[email protected]>
+
+	* fs/i386/pc/pxe.c (grub_pxefs_open): Handle the one open connection
+	at a time limit of the PXE TFTP API correctly.
+	(grub_pxefs_close): Likewise.
+
 2008-11-29  Robert Millan  <[email protected]>
 
 	* disk/ata.c (grub_ata_pciinit): Handle errors rised by

Modified: trunk/grub2/fs/i386/pc/pxe.c
===================================================================
--- trunk/grub2/fs/i386/pc/pxe.c	2008-11-29 21:05:59 UTC (rev 1933)
+++ trunk/grub2/fs/i386/pc/pxe.c	2008-12-12 04:12:05 UTC (rev 1934)
@@ -125,6 +125,12 @@
   struct grub_pxe_data *data;
   grub_file_t file_int, bufio;
 
+  if (curr_file != 0)
+    {
+      grub_pxe_call (GRUB_PXENV_TFTP_CLOSE, &c.c2);
+      curr_file = 0;
+    }
+
   c.c1.server_ip = grub_pxe_server_ip;
   c.c1.gateway_ip = grub_pxe_gateway_ip;
   grub_strcpy (c.c1.filename, name);
@@ -190,7 +196,8 @@
     {
       struct grub_pxenv_tftp_open o;
 
-      grub_pxe_call (GRUB_PXENV_TFTP_CLOSE, &o);
+      if (curr_file != 0)
+        grub_pxe_call (GRUB_PXENV_TFTP_CLOSE, &o);
 
       o.server_ip = grub_pxe_server_ip;
       o.gateway_ip = grub_pxe_gateway_ip;
@@ -227,7 +234,12 @@
 {
   struct grub_pxenv_tftp_close c;
 
-  grub_pxe_call (GRUB_PXENV_TFTP_CLOSE, &c);
+  if (curr_file == file)
+    {
+      grub_pxe_call (GRUB_PXENV_TFTP_CLOSE, &c);
+      curr_file = 0;
+    }
+
   grub_free (file->data);
 
   return GRUB_ERR_NONE;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.