#include <stdio.h>
#include <string.h>
#include <stdint.h>
+#include <unistd.h>
#include <assert.h>
#include <arpa/inet.h>
#include <sys/socket.h>
parse_url(url, &protocol, &host, &port, &path); // Don't care if it fails.
}
+void HTTPInput::close_socket()
+{
+ int ret;
+ do {
+ ret = close(sock);
+ } while (ret == -1 && errno == EINTR);
+
+ if (ret == -1) {
+ perror("close()");
+ }
+}
+
InputProto HTTPInput::serialize() const
{
InputProto serialized;
return sock;
}
+ do {
+ err = close(sock);
+ } while (err == -1 && errno == EINTR);
+
+ if (err == -1) {
+ perror("close");
+ // Can still continue.
+ }
+
ai = ai->ai_next;
}
request.clear();
request_bytes_sent = 0;
response.clear();
+ pending_data.clear();
{
string protocol; // Thrown away.