[sheepdog] add http transport stub

Liu Yuan namei.unix at gmail.com
Mon Jul 1 18:35:26 CEST 2013


This patch set adds transport stub, on top of which we can build Swift or Amazon
S3 service.

Only HTTP GET/PUT/POST/HEAD/DELETE (RESTful API) is allowd to interface with
sheepdog storage.

The transport is implemented via fastcgi in the address space of sheepdog to
favor performance. It is currently disabled at compile time.

How To Test:

1 install libfcgi-dev and nginx
2 ./configure --enable-http
3 run nginx as following:
  # edit ~/nginx.conf as following:
=======================================================
events {
	worker_connections 1024;
}

http {
	server {
		listen 80;
		server_name localhost;

		location / {
			fastcgi_pass   localhost:7100;

			fastcgi_param   SCRIPT_NAME             $fastcgi_script_name;
			fastcgi_param   REQUEST_METHOD          $request_method;
			fastcgi_param	CONTENT_LENGTH		$content_length;
			fastcgi_param   HTTP_RANGE              $http_range;
		}
	}
}
=======================================================
  # nginx -c ~/nginx.conf
4 sheep/sheep -d -f -o store/ -c local -r localhost:7100
5 use curl to test:
  $ curl -v -X GET http://localhost/test # issue a get request
  $ curl -v -X PUT -d "hello" http://localhost/test # issue a put request

Thanks
Yuan



More information about the sheepdog mailing list