<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2011-02-21)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>sh</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-02-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libnetworking/lib/ftpfs.c: Workaround for some firewalls.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2719&r2=text&tr2=1.2720&diff_format=h">M</a></td><td width='1%'>1.2720</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libnetworking/lib/ftpfs.c.diff?r1=text&tr1=1.35&r2=text&tr2=1.36&diff_format=h">M</a></td><td width='1%'>1.36</td><td width='100%'>cpukit/libnetworking/lib/ftpfs.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2719 rtems/cpukit/ChangeLog:1.2720
--- rtems/cpukit/ChangeLog:1.2719 Fri Feb 18 09:12:43 2011
+++ rtems/cpukit/ChangeLog Mon Feb 21 04:58:14 2011
</font><font color='#997700'>@@ -1,3 +1,7 @@
</font><font color='#000088'>+2011-02-21 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * libnetworking/lib/ftpfs.c: Workaround for some firewalls.
+
</font> 2011-02-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* sapi/include/confdefs.h, score/Makefile.am,
<font color='#006600'>diff -u rtems/cpukit/libnetworking/lib/ftpfs.c:1.35 rtems/cpukit/libnetworking/lib/ftpfs.c:1.36
--- rtems/cpukit/libnetworking/lib/ftpfs.c:1.35 Tue Oct 19 04:16:20 2010
+++ rtems/cpukit/libnetworking/lib/ftpfs.c Mon Feb 21 04:58:15 2011
</font><font color='#997700'>@@ -5,7 +5,7 @@
</font> */
/*
<font color='#880000'>- * Copyright (c) 2009, 2010
</font><font color='#000088'>+ * Copyright (c) 2009, 2010, 2011
</font> * embedded brains GmbH
* Obere Lagerstr. 30
* D-82178 Puchheim
<font color='#997700'>@@ -347,40 +347,37 @@
</font> bool verbose
)
{
<font color='#880000'>- const char *const eol = "\r\n";
- int rv = 0;
-
- /* Send command */
- rv = send(socket, cmd, strlen(cmd), 0);
- if (rv < 0) {
- return RTEMS_FTPFS_REPLY_ERROR;
- }
- if (verbose) {
- write(STDERR_FILENO, cmd, strlen(cmd));
- }
</font><font color='#000088'>+ rtems_ftpfs_reply reply = RTEMS_FTPFS_REPLY_ERROR;
+ size_t cmd_len = strlen(cmd);
+ size_t arg_len = arg != NULL ? strlen(arg) : 0;
+ size_t len = cmd_len + arg_len + 2;
+ char *buf = malloc(len);
+
+ if (buf != NULL) {
+ ssize_t n = 0;
+ char *buf_arg = buf + cmd_len;
+ char *buf_eol = buf_arg + arg_len;
+
+ memcpy(buf, cmd, cmd_len);
+ memcpy(buf_arg, arg, arg_len);
+ buf_eol [0] = '\r';
+ buf_eol [1] = '\n';
+
+ /* Send */
+ n = send(socket, buf, len, 0);
+ if (n == (ssize_t) len) {
+ if (verbose) {
+ write(STDERR_FILENO, buf, len);
+ }
</font>
<font color='#880000'>- /* Send command argument if necessary */
- if (arg != NULL) {
- rv = send(socket, arg, strlen(arg), 0);
- if (rv < 0) {
- return RTEMS_FTPFS_REPLY_ERROR;
- }
- if (verbose) {
- write(STDERR_FILENO, arg, strlen(arg));
</font><font color='#000088'>+ /* Reply */
+ reply = rtems_ftpfs_get_reply(socket, parser, parser_arg, verbose);
</font> }
<font color='#880000'>- }
</font>
<font color='#880000'>- /* Send end of line */
- rv = send(socket, eol, 2, 0);
- if (rv < 0) {
- return RTEMS_FTPFS_REPLY_ERROR;
- }
- if (verbose) {
- write(STDERR_FILENO, &eol [1], 1);
</font><font color='#000088'>+ free(buf);
</font> }
<font color='#880000'>- /* Return reply */
- return rtems_ftpfs_get_reply(socket, parser, parser_arg, verbose);
</font><font color='#000088'>+ return reply;
</font> }
static rtems_ftpfs_reply rtems_ftpfs_send_command(
</pre>
<p> </p>
<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>