diff -Naur motion-3.2.2_snap11/netcam.c motion-3.2.2_snap11_patch/netcam.c
--- motion-3.2.2_snap11/netcam.c	2005-08-10 10:10:31.000000000 +0200
+++ motion-3.2.2_snap11_patch/netcam.c	2005-08-10 17:37:10.000000000 +0200
@@ -311,6 +311,10 @@
 	char *header;
 
 	/*
+	 * return if not connected
+	 */
+	if (netcam->sock == -1) return -1;
+	/*
 	 * We are expecting a header which *must* contain a mime-type of
 	 * image/jpeg, and *might* contain a Content-Length.
 	 *
@@ -1006,6 +1010,7 @@
  */
 static void *netcam_handler_loop (void *arg)
 {
+	int retval;
 	netcam_context_ptr netcam = arg;
 	struct context *cnt = netcam->cnt; /* needed for the SETUP macro :-( */
 
@@ -1025,9 +1030,8 @@
 	 * or cnt->finish is set.
 	 */
 
-	do {
+	while (!netcam->finish) {
 		if (!netcam->caps.streaming) {
-			int retval;
 
 			if (netcam_connect (netcam, NULL) < 0) {
 				motion_log(cnt, LOG_ERR, 0,
@@ -1051,14 +1055,24 @@
 			}
 		} else {
 			if (netcam_read_next_header (netcam) < 0) {
-				if (netcam_connect (netcam, NULL))
-					/* fatal if unable to re-connect */
-					break;
-			
-				if (netcam_read_first_header (netcam) != 2)
-					/* fatal if first header unreadable */
-					break;
-				continue;
+				if (netcam_connect (netcam, NULL) < 0) {
+					motion_log(cnt, LOG_ERR, 0,
+					           "re-opening camera (streaming)");
+					SLEEP(5,0);
+					continue;
+				}
+				if ((retval = netcam_read_first_header (netcam) != 2)) {
+					if (retval > 0) {
+						motion_log(cnt, LOG_ERR, 0,
+						           "Unrecognized image header "
+						           "(%d)", retval);
+					} else if (retval != -1) {
+							motion_log(cnt, LOG_ERR, 0,
+				        		   "Error in header (%d)",
+							   retval);
+					}
+					continue; /* FIX: maybe break if happens too often */
+				}
 			}
 		}
 		if (netcam_read_jpeg (netcam) < 0)
@@ -1095,7 +1109,7 @@
 			pthread_mutex_unlock(&netcam->mutex);
 		}
 	/* the loop continues forever, or until motion shutdown */
-	} while (!netcam->finish);
+	}
 
 	/* our thread is finished - decrement motion's thread count */
 	pthread_mutex_lock (&global_lock);
