aboutsummaryrefslogtreecommitdiff
path: root/libraries/Ethernet
diff options
context:
space:
mode:
authorFederico Fissore <f.fissore@arduino.cc>2013-01-28 11:37:51 +0100
committerFederico Fissore <f.fissore@arduino.cc>2013-01-28 11:37:51 +0100
commit5c67c7e5c674a572dd99e9d0d8c19c718c9985bc (patch)
tree1f22ba2385ad22eca306d67793c0827451f2b50a /libraries/Ethernet
parentc453e0a32e7adf5e7bab7bfb7c8f7a21e30ca563 (diff)
parentc6287dd6ac33544179a6544b8f3f55a396ec6608 (diff)
Merge branch 'ide-1.5.x' into lib-1.5
Diffstat (limited to 'libraries/Ethernet')
-rw-r--r--libraries/Ethernet/Dhcp.cpp1
-rw-r--r--libraries/Ethernet/Ethernet.cpp3
-rw-r--r--libraries/Ethernet/examples/WebServer/WebServer.ino2
3 files changed, 4 insertions, 2 deletions
diff --git a/libraries/Ethernet/Dhcp.cpp b/libraries/Ethernet/Dhcp.cpp
index e4d27f7..56d5b69 100644
--- a/libraries/Ethernet/Dhcp.cpp
+++ b/libraries/Ethernet/Dhcp.cpp
@@ -43,6 +43,7 @@ int DhcpClass::request_DHCP_lease(){
_dhcpTransactionId = random(1UL, 2000UL);
_dhcpInitialTransactionId = _dhcpTransactionId;
+ _dhcpUdpSocket.stop();
if (_dhcpUdpSocket.begin(DHCP_CLIENT_PORT) == 0)
{
// Couldn't get a socket
diff --git a/libraries/Ethernet/Ethernet.cpp b/libraries/Ethernet/Ethernet.cpp
index 5d28f71..c31a85f 100644
--- a/libraries/Ethernet/Ethernet.cpp
+++ b/libraries/Ethernet/Ethernet.cpp
@@ -10,7 +10,8 @@ uint16_t EthernetClass::_server_port[MAX_SOCK_NUM] = {
int EthernetClass::begin(uint8_t *mac_address)
{
- _dhcp = new DhcpClass();
+ static DhcpClass s_dhcp;
+ _dhcp = &s_dhcp;
// Initialise the basic info
diff --git a/libraries/Ethernet/examples/WebServer/WebServer.ino b/libraries/Ethernet/examples/WebServer/WebServer.ino
index ce8dbb1..0573f05 100644
--- a/libraries/Ethernet/examples/WebServer/WebServer.ino
+++ b/libraries/Ethernet/examples/WebServer/WebServer.ino
@@ -63,7 +63,7 @@ void loop() {
// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
- client.println("Connnection: close");
+ client.println("Connection: close");
client.println();
client.println("<!DOCTYPE HTML>");
client.println("<html>");