ObjFW  Diff

Differences From Artifact [5c79012c43]:

To Artifact [af54b95e34]:


126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143









144
145
146
147
148
149
150
126
127
128
129
130
131
132



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156







-
-
-








+
+
+
+
+
+
+
+
+







			    newWithClass: isa
				     URL: URL];

		sock = [[[of_http_request_tls_socket_class alloc] init]
		    autorelease];
	}

	[sock connectToHost: [URL host]
		     onPort: [URL port]];

	@try {
		OFString *line;
		OFMutableDictionary *s_headers;
		OFDataArray *data;
		OFEnumerator *enumerator;
		OFString *key;
		int status;
		const char *t;

		[sock connectToHost: [URL host]
			     onPort: [URL port]];

		/*
		 * Work around a bug with packet bisection in lighttpd when
		 * using HTTPS.
		 */
		[sock setBuffersWrites: YES];

		if (requestType == OF_HTTP_REQUEST_TYPE_GET)
			t = "GET";
		if (requestType == OF_HTTP_REQUEST_TYPE_HEAD)
			t = "HEAD";
		if (requestType == OF_HTTP_REQUEST_TYPE_POST)
			t = "POST";
175
176
177
178
179
180
181




182
183
184
185
186
187
188
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198







+
+
+
+








			if ([headers objectForKey: @"Content-Length"] == nil)
				[sock writeFormat: @"Content-Length: %d\r\n",
				    [queryString cStringLength]];
		}

		[sock writeString: @"\r\n"];

		/* Work around a bug in lighttpd, see above */
		[sock flushWriteBuffer];
		[sock setBuffersWrites: NO];

		if (requestType == OF_HTTP_REQUEST_TYPE_POST)
			[sock writeString: queryString];

		/*
		 * We also need to check for HTTP/1.1 since Apache always
		 * declares the reply to be HTTP/1.1.