Project

General

Profile

Bug #1640 ยป mod_cgi.c.patch

patch for mod_cgi in lighttpd 1.4.19 -- aseem - Anonymous, 2008-04-15 06:06

View differences:

lighttpd-1.4.19.patched/src/mod_cgi.c 2008-04-15 05:06:05.335717999 +0000
1022 1022
			/* there is content to send */
1023 1023
			for (c = cq->first; c; c = cq->first) {
1024 1024
				int r = 0;
1025

  
1025
				int write_eintr = 0;
1026
				
1026 1027
				/* copy all chunks */
1027 1028
				switch(c->type) {
1028 1029
				case FILE_CHUNK:
......
1058 1059
						switch(errno) {
1059 1060
						case ENOSPC:
1060 1061
							con->http_status = 507;
1061

  
1062
							break;
1063
						case EINTR:
1064
							write_eintr = 1;
1062 1065
							break;
1063 1066
						default:
1064 1067
							con->http_status = 403;
......
1071 1074
						switch(errno) {
1072 1075
						case ENOSPC:
1073 1076
							con->http_status = 507;
1074

  
1077
							break;
1078
						case EINTR:
1079
							write_eintr = 1;
1075 1080
							break;
1076 1081
						default:
1077 1082
							con->http_status = 403;
......
1086 1091
				if (r > 0) {
1087 1092
					c->offset += r;
1088 1093
					cq->bytes_out += r;
1089
				} else {
1094
				} 
1095
				if (r < 0) {
1096
					/* if write failed for reasons other than EINTR log and break out */
1097
					if (write_eintr != 1) {
1098
						log_error_write(srv, __FILE__, __LINE__, "ss", "write() failed due to: ", strerror(errno)); 
1099
						con->http_status = 500;
1100
						break;
1101
					}
1102
				}
1103
				if (r == 0) {
1090 1104
					break;
1091 1105
				}
1092 1106
				chunkqueue_remove_finished_chunks(cq);
    (1-1/1)