Mostly looks good, just a couple of errors...
On 6/14/22 16:38, Julian Klemann wrote:
- if (!(new_entry = malloc(sizeof(struct url))))
return STATUS_NO_MEMORY;
This leaks "url".
- for (int i = 0; i < 4; ++i)
ports[i] = add_url_v1(queue);
- for (int i = 0; i < 4; ++i)
- {
s = create_client_socket(ports[i]);
sprintf(req_text, simple_req, ports[i]);
ret = send(s, req_text, strlen(req_text), 0);
ok(ret == strlen(req_text), "send() returned %d.\n", ret);
memset(req_buffer, 0xcc, sizeof(req_buffer));
ret = HttpReceiveHttpRequest(queue, HTTP_NULL_ID, 0, (HTTP_REQUEST *)req, sizeof(req_buffer), &ret_size, NULL);
ok(!ret, "Got error %u.\n", ret);
ok(ret_size > sizeof(*req), "Got size %lu.\n", ret_size);
send_response_v1(queue, req->RequestId, s);
closesocket(s);
- }
I believe some compilers still don't like declarations in for-loop initializers. Also, something of a nitpick, but those should probably be unsigned.