summaryrefslogtreecommitdiff
path: root/nuttx/netutils
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-10-27 18:56:04 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-10-27 18:56:04 +0000
commit1e60556b89305022b6cefe9bb28badb51dc15620 (patch)
treed07c947b44430bff1520bd7ced5fe49e19b26bf3 /nuttx/netutils
parenta7e644a852025eeb8af8648f73aac7c9ffc315bd (diff)
downloadpx4-nuttx-1e60556b89305022b6cefe9bb28badb51dc15620.tar.gz
px4-nuttx-1e60556b89305022b6cefe9bb28badb51dc15620.tar.bz2
px4-nuttx-1e60556b89305022b6cefe9bb28badb51dc15620.zip
Fixes found in smtp testing
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@356 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/netutils')
-rw-r--r--nuttx/netutils/smtp/smtp.c58
-rw-r--r--nuttx/netutils/webserver/httpd.c1
2 files changed, 31 insertions, 28 deletions
diff --git a/nuttx/netutils/smtp/smtp.c b/nuttx/netutils/smtp/smtp.c
index 7a2e69c03..aa351d64b 100644
--- a/nuttx/netutils/smtp/smtp.c
+++ b/nuttx/netutils/smtp/smtp.c
@@ -75,21 +75,21 @@
struct smtp_state
{
- uint8 state;
- boolean connected;
- sem_t sem;
+ uint8 state;
+ boolean connected;
+ sem_t sem;
uip_ipaddr_t smtpserver;
- char *localhostname;
- char *to;
- char *cc;
- char *from;
- char *subject;
- char *msg;
- int msglen;
- int sentlen;
- int textlen;
- int sendptr;
- char buffer[SMTP_INPUT_BUFFER_SIZE];
+ const char *localhostname;
+ const char *to;
+ const char *cc;
+ const char *from;
+ const char *subject;
+ const char *msg;
+ int msglen;
+ int sentlen;
+ int textlen;
+ int sendptr;
+ char buffer[SMTP_INPUT_BUFFER_SIZE];
};
static inline int smtp_send_message(int sockfd, struct smtp_state *psmtp)
@@ -242,33 +242,35 @@ static inline int smtp_send_message(int sockfd, struct smtp_state *psmtp)
/* Specificy an SMTP server and hostname.
*
- * This function is used to configure the SMTP module with an SMTP
- * server and the hostname of the host.
+ * This function is used to configure the SMTP module with an SMTP server and
+ * the hostname of the host.
*
- * lhostname The hostname of the uIP host.
+ * lhostname - The hostname of the local, uIP host.
*
- * server A pointer to a 4-byte array representing the IP
- * address of the SMTP server to be configured.
+ * paddr - A pointer to the IP address of the SMTP server to be
+ * configured.
*/
-void smtp_configure(void *handle, char *lhostname, void *server)
+void smtp_configure(void *handle, const char *lhostname,
+ const uip_ipaddr_t *paddr)
{
struct smtp_state *psmtp = (struct smtp_state *)handle;
psmtp->localhostname = lhostname;
- uip_ipaddr_copy(psmtp->smtpserver, server);
+ uip_ipaddr_copy(psmtp->smtpserver, paddr);
}
/* Send an e-mail.
*
- * to The e-mail address of the receiver of the e-mail.
- * cc The e-mail address of the CC: receivers of the e-mail.
- * from The e-mail address of the sender of the e-mail.
- * subject The subject of the e-mail.
- * msg The actual e-mail message.
- * msglen The length of the e-mail message.
+ * to - The e-mail address of the receiver of the e-mail.
+ * cc - The e-mail address of the CC: receivers of the e-mail.
+ * from - The e-mail address of the sender of the e-mail.
+ * subject - The subject of the e-mail.
+ * msg - The actual e-mail message.
+ * msglen - The length of the e-mail message.
*/
-int smtp_send(void *handle, char *to, char *cc, char *from, char *subject, char *msg, int msglen)
+int smtp_send(void *handle, const char *to, const char *cc, const char *from,
+ const char *subject, const char *msg, int msglen)
{
struct smtp_state *psmtp = (struct smtp_state *)handle;
struct sockaddr_in server;
diff --git a/nuttx/netutils/webserver/httpd.c b/nuttx/netutils/webserver/httpd.c
index 7c3271fd6..1f6f58df8 100644
--- a/nuttx/netutils/webserver/httpd.c
+++ b/nuttx/netutils/webserver/httpd.c
@@ -289,6 +289,7 @@ static void handle_connection(struct httpd_state *pstate)
int httpd_listen(void)
{
#warning "this is all very broken at the moment"
+ return OK;
}
/****************************************************************************