Browse Source

[downloader] Provide direct access to the underlying data transfer buffer

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 years ago
parent
commit
2b15ae5507
1 changed files with 14 additions and 0 deletions
  1. 14
    0
      src/core/downloader.c

+ 14
- 0
src/core/downloader.c View File

153
 	return rc;
153
 	return rc;
154
 }
154
 }
155
 
155
 
156
+/**
157
+ * Get underlying data transfer buffer
158
+ *
159
+ * @v downloader	Downloader
160
+ * @ret xferbuf		Data transfer buffer, or NULL on error
161
+ */
162
+static struct xfer_buffer *
163
+downloader_xfer_buffer ( struct downloader *downloader ) {
164
+
165
+	/* Provide direct access to underlying data transfer buffer */
166
+	return &downloader->buffer;
167
+}
168
+
156
 /** Downloader data transfer interface operations */
169
 /** Downloader data transfer interface operations */
157
 static struct interface_operation downloader_xfer_operations[] = {
170
 static struct interface_operation downloader_xfer_operations[] = {
158
 	INTF_OP ( xfer_deliver, struct downloader *, downloader_xfer_deliver ),
171
 	INTF_OP ( xfer_deliver, struct downloader *, downloader_xfer_deliver ),
172
+	INTF_OP ( xfer_buffer, struct downloader *, downloader_xfer_buffer ),
159
 	INTF_OP ( intf_close, struct downloader *, downloader_finished ),
173
 	INTF_OP ( intf_close, struct downloader *, downloader_finished ),
160
 };
174
 };
161
 
175
 

Loading…
Cancel
Save