diff options
author | Christian Grothoff <christian@grothoff.org> | 2008-03-28 23:38:49 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2008-03-28 23:38:49 +0000 |
commit | 7d2532ba8b0f271931b180e84f8e962af37df415 (patch) | |
tree | e123e87c8a4f677cebad51a6514595cf82df80ba | |
parent | 58107ded22da4953cafad9aece5cd9880036203d (diff) | |
download | libmicrohttpd-7d2532ba8b0f271931b180e84f8e962af37df415.tar.gz libmicrohttpd-7d2532ba8b0f271931b180e84f8e962af37df415.zip |
fixing connection clean up issue
-rw-r--r-- | src/daemon/connection.c | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/src/daemon/connection.c b/src/daemon/connection.c index 6964104c..ae93ff05 100644 --- a/src/daemon/connection.c +++ b/src/daemon/connection.c | |||
@@ -1626,7 +1626,14 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) | |||
1626 | case MHD_CONNECTION_INIT: | 1626 | case MHD_CONNECTION_INIT: |
1627 | line = get_next_header_line (connection); | 1627 | line = get_next_header_line (connection); |
1628 | if (line == NULL) | 1628 | if (line == NULL) |
1629 | break; | 1629 | { |
1630 | if (connection->read_closed) | ||
1631 | { | ||
1632 | connection->state = MHD_CONNECTION_CLOSED; | ||
1633 | continue; | ||
1634 | } | ||
1635 | break; | ||
1636 | } | ||
1630 | if (MHD_NO == parse_initial_message_line (connection, line)) | 1637 | if (MHD_NO == parse_initial_message_line (connection, line)) |
1631 | connection->state = MHD_CONNECTION_CLOSED; | 1638 | connection->state = MHD_CONNECTION_CLOSED; |
1632 | else | 1639 | else |
@@ -1635,7 +1642,14 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) | |||
1635 | case MHD_CONNECTION_URL_RECEIVED: | 1642 | case MHD_CONNECTION_URL_RECEIVED: |
1636 | line = get_next_header_line (connection); | 1643 | line = get_next_header_line (connection); |
1637 | if (line == NULL) | 1644 | if (line == NULL) |
1638 | break; | 1645 | { |
1646 | if (connection->read_closed) | ||
1647 | { | ||
1648 | connection->state = MHD_CONNECTION_CLOSED; | ||
1649 | continue; | ||
1650 | } | ||
1651 | break; | ||
1652 | } | ||
1639 | if (strlen (line) == 0) | 1653 | if (strlen (line) == 0) |
1640 | { | 1654 | { |
1641 | connection->state = MHD_CONNECTION_HEADERS_RECEIVED; | 1655 | connection->state = MHD_CONNECTION_HEADERS_RECEIVED; |
@@ -1653,7 +1667,14 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) | |||
1653 | case MHD_CONNECTION_HEADER_PART_RECEIVED: | 1667 | case MHD_CONNECTION_HEADER_PART_RECEIVED: |
1654 | line = get_next_header_line (connection); | 1668 | line = get_next_header_line (connection); |
1655 | if (line == NULL) | 1669 | if (line == NULL) |
1656 | break; | 1670 | { |
1671 | if (connection->read_closed) | ||
1672 | { | ||
1673 | connection->state = MHD_CONNECTION_CLOSED; | ||
1674 | continue; | ||
1675 | } | ||
1676 | break; | ||
1677 | } | ||
1657 | if (MHD_NO == | 1678 | if (MHD_NO == |
1658 | process_broken_line (connection, line, MHD_HEADER_KIND)) | 1679 | process_broken_line (connection, line, MHD_HEADER_KIND)) |
1659 | continue; | 1680 | continue; |
@@ -1712,7 +1733,14 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) | |||
1712 | case MHD_CONNECTION_BODY_RECEIVED: | 1733 | case MHD_CONNECTION_BODY_RECEIVED: |
1713 | line = get_next_header_line (connection); | 1734 | line = get_next_header_line (connection); |
1714 | if (line == NULL) | 1735 | if (line == NULL) |
1715 | break; | 1736 | { |
1737 | if (connection->read_closed) | ||
1738 | { | ||
1739 | connection->state = MHD_CONNECTION_CLOSED; | ||
1740 | continue; | ||
1741 | } | ||
1742 | break; | ||
1743 | } | ||
1716 | if (strlen (line) == 0) | 1744 | if (strlen (line) == 0) |
1717 | { | 1745 | { |
1718 | connection->state = MHD_CONNECTION_FOOTERS_RECEIVED; | 1746 | connection->state = MHD_CONNECTION_FOOTERS_RECEIVED; |
@@ -1730,7 +1758,14 @@ MHD_connection_handle_idle (struct MHD_Connection *connection) | |||
1730 | case MHD_CONNECTION_FOOTER_PART_RECEIVED: | 1758 | case MHD_CONNECTION_FOOTER_PART_RECEIVED: |
1731 | line = get_next_header_line (connection); | 1759 | line = get_next_header_line (connection); |
1732 | if (line == NULL) | 1760 | if (line == NULL) |
1733 | break; | 1761 | { |
1762 | if (connection->read_closed) | ||
1763 | { | ||
1764 | connection->state = MHD_CONNECTION_CLOSED; | ||
1765 | continue; | ||
1766 | } | ||
1767 | break; | ||
1768 | } | ||
1734 | if (MHD_NO == | 1769 | if (MHD_NO == |
1735 | process_broken_line (connection, line, MHD_FOOTER_KIND)) | 1770 | process_broken_line (connection, line, MHD_FOOTER_KIND)) |
1736 | continue; | 1771 | continue; |